Supporting .png files in efficientnet (#102)

* to make it work locally

* definitely not working

* Conv2D GPU passes some of the tests

* Conv2D GPU passes more of the tests

* passes some tests and mnist

* removed unecessary code

* Conv2D Backpass works

* wrong test_ops.py

* white space + test backward

* ereased useless code

* removed default argument

* long lines

* works also with 4 channel .png files

* commenting out

* track
This commit is contained in:
Marcel Bischoff
2020-11-10 23:06:24 -05:00
committed by GitHub
parent d93cd945aa
commit a3989f9e18

View File

@@ -183,7 +183,7 @@ def infer(model, img):
# low level preprocess
img = np.moveaxis(img, [2,0,1], [0,1,2])
img = img.astype(np.float32).reshape(1,3,224,224)
img = img.astype(np.float32)[:3].reshape(1,3,224,224)
img /= 255.0
img -= np.array([0.485, 0.456, 0.406]).reshape((1,-1,1,1))
img /= np.array([0.229, 0.224, 0.225]).reshape((1,-1,1,1))