mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
group conv: forward pass works (#34)
* forward pass works * got the backward pass * okay, it's now a coho
This commit is contained in:
@@ -119,8 +119,10 @@ if __name__ == "__main__":
|
||||
# load cat image and preprocess
|
||||
from PIL import Image
|
||||
img = Image.open(io.BytesIO(fetch("https://c.files.bbci.co.uk/12A9B/production/_111434467_gettyimages-1143489763.jpg")))
|
||||
img = img.resize((224, 224))
|
||||
img = np.moveaxis(np.array(img), [2,0,1], [0,1,2])
|
||||
img = img.resize((398, 224))
|
||||
img = np.array(img)
|
||||
img = img[:, 87:-87]
|
||||
img = np.moveaxis(img, [2,0,1], [0,1,2])
|
||||
img = img.astype(np.float32).reshape(1,3,224,224)
|
||||
img /= 256
|
||||
img -= np.array([0.485, 0.456, 0.406]).reshape((1,-1,1,1))
|
||||
|
||||
Reference in New Issue
Block a user