Hubconf.py bug fix (#3007)
Browse files- hubconf.py +1 -1
- utils/google_utils.py +1 -0
hubconf.py
CHANGED
@@ -62,7 +62,7 @@ def create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbos
|
|
62 |
|
63 |
def custom(path='path/to/model.pt', autoshape=True, verbose=True):
|
64 |
# YOLOv5 custom or local model
|
65 |
-
return create(path, autoshape, verbose)
|
66 |
|
67 |
|
68 |
def yolov5s(pretrained=True, channels=3, classes=80, autoshape=True, verbose=True):
|
|
|
62 |
|
63 |
def custom(path='path/to/model.pt', autoshape=True, verbose=True):
|
64 |
# YOLOv5 custom or local model
|
65 |
+
return create(path, autoshape=autoshape, verbose=verbose)
|
66 |
|
67 |
|
68 |
def yolov5s(pretrained=True, channels=3, classes=80, autoshape=True, verbose=True):
|
utils/google_utils.py
CHANGED
@@ -21,6 +21,7 @@ def attempt_download(file, repo='ultralytics/yolov5'):
|
|
21 |
file = Path(str(file).strip().replace("'", ''))
|
22 |
|
23 |
if not file.exists():
|
|
|
24 |
try:
|
25 |
response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api
|
26 |
assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...]
|
|
|
21 |
file = Path(str(file).strip().replace("'", ''))
|
22 |
|
23 |
if not file.exists():
|
24 |
+
file.parent.mkdir(parents=True, exist_ok=True) # make parent dir (if required)
|
25 |
try:
|
26 |
response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api
|
27 |
assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...]
|