Unverified 提交 31ee54c2 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Hubconf.py bug fix (#3007)

上级 7c89c829
...@@ -62,7 +62,7 @@ def create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbos ...@@ -62,7 +62,7 @@ def create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbos
def custom(path='path/to/model.pt', autoshape=True, verbose=True): def custom(path='path/to/model.pt', autoshape=True, verbose=True):
# YOLOv5 custom or local model # YOLOv5 custom or local model
return create(path, autoshape, verbose) return create(path, autoshape=autoshape, verbose=verbose)
def yolov5s(pretrained=True, channels=3, classes=80, autoshape=True, verbose=True): def yolov5s(pretrained=True, channels=3, classes=80, autoshape=True, verbose=True):
......
...@@ -21,6 +21,7 @@ def attempt_download(file, repo='ultralytics/yolov5'): ...@@ -21,6 +21,7 @@ def attempt_download(file, repo='ultralytics/yolov5'):
file = Path(str(file).strip().replace("'", '')) file = Path(str(file).strip().replace("'", ''))
if not file.exists(): if not file.exists():
file.parent.mkdir(parents=True, exist_ok=True) # make parent dir (if required)
try: try:
response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api
assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...] assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论