PyTorch 1.7.0 Compatibility Updates (#1233)

* torch 1.7.0 compatibility updates

* add inference verification
This commit is contained in:
Glenn Jocher authored and GitHub committed 2020-10-28 15:03:50 +01:00
1 parent 453acdec67
commit c8c5ef36c9
4 files changed
+16 -2

No files matched your search

+8
View File
@@ -108,3 +108,11 @@ def yolov5x(pretrained=False, channels=3, classes=80):
if __name__ == '__main__':
model = create(name='yolov5s', pretrained=True, channels=3, classes=80) # example
model = model.fuse().eval().autoshape() # for autoshaping of PIL/cv2/np inputs and NMS
# Verify inference
from PIL import Image
img = Image.open('inference/images/zidane.jpg')
y = model(img)
print(y[0].shape)