-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PyTorch 1.7.0 Compatibility Updates (#1233)
* torch 1.7.0 compatibility updates * add inference verification
- Loading branch information
1 parent
453acde
commit c8c5ef3
Showing
4 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
glenn-jocher
Author
Member
|
||
|
||
# Verify inference | ||
from PIL import Image | ||
|
||
img = Image.open('inference/images/zidane.jpg') | ||
y = model(img) | ||
print(y[0].shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@glenn-jocher sorry to bother you, love all of your work. Mind if I ask what .autoshape() is and how it works... It sounds fantastic and a real solution to a lot of headaches, but I've never seen it before, nor can I find any documentation 👍 Thanks!