add back scale

This commit is contained in:
George Hotz
2020-11-09 10:20:56 -08:00
parent 3ffbd47335
commit 53157fb876
2 changed files with 4 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ Despite being tiny, tinygrad supports the full EfficientNet. Pass in a picture t
python3 examples/efficientnet.py https://upload.wikimedia.org/wikipedia/commons/4/41/Chicken.jpg
```
Or, if you have a webcam and pygame+cv2 installed
Or, if you have a webcam and cv2 installed
```bash
python3 examples/efficientnet.py webcam

View File

@@ -180,7 +180,9 @@ if __name__ == "__main__":
img = Image.fromarray(frame[:, :, [2,1,0]])
out, retimg = infer(model, img)
print(np.argmax(out.data), np.max(out.data), lbls[np.argmax(out.data)])
retimg = cv2.cvtColor(retimg, cv2.COLOR_RGB2BGR)
SCALE = 3
simg = cv2.resize(retimg, (224*SCALE, 224*SCALE))
retimg = cv2.cvtColor(simg, cv2.COLOR_RGB2BGR)
cv2.imshow('capture', retimg)
if cv2.waitKey(1) & 0xFF == ord('q'):
break