mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-07 03:00:26 -04:00
add back scale
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user