YOLOv5 v5.0 Release patch 1 (#2764)

* torch.jit.trace(model, img, strict=False)

* Update check_file()

* Update hubconf.py

* Update README.md
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-04-11 23:11:43 +02:00
1 parent f5b8f7d54c
commit 0f395b3e3b
4 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
"""File for accessing YOLOv5 models via PyTorch Hub https://pytorch.org/hub/ultralytics_yolov5/
"""YOLOv5 PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5/
Usage:
import torch
@@ -31,9 +31,9 @@ def create(name, pretrained, channels, classes, autoshape):
Returns:
pytorch model
"""
config = Path(__file__).parent / 'models' / f'{name}.yaml' # model.yaml path
try:
model = Model(config, channels, classes)
cfg = list((Path(__file__).parent / 'models').rglob(f'{name}.yaml'))[0] # model.yaml path
model = Model(cfg, channels, classes)
if pretrained:
fname = f'{name}.pt' # checkpoint filename
attempt_download(fname) # download if not found locally