Skip to content

Commit

Permalink
Update google_utils.py (#1690)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Feb 23, 2021
1 parent d353371 commit c1f8dd9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions utils/google_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def attempt_download(file, repo='ultralytics/yolov3'):
file = Path(str(file).strip().replace("'", '').lower())

if not file.exists():
try:
response = requests.get(f'https://github.com/gitapi/repos/{repo}/releases/latest').json() # github api
assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...]
tag = response['tag_name'] # i.e. 'v1.0'
except: # fallback plan
assets = ['yolov3.pt', 'yolov3-spp.pt', 'yolov3-tiny.pt']
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
# try:
# response = requests.get(f'https://github.com/gitapi/repos/{repo}/releases/latest').json() # github api
# assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...]
# tag = response['tag_name'] # i.e. 'v1.0'
# except: # fallback plan
assets = ['yolov3.pt', 'yolov3-spp.pt', 'yolov3-tiny.pt']
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]

name = file.name
if name in assets:
Expand Down

0 comments on commit c1f8dd9

Please sign in to comment.