glenn-jocher pre-commit-ci[bot] commited on
Commit
3a89377
·
unverified ·
1 Parent(s): 4cac1cf

Improve availability of YOLOv5 in Russia (#7545)

Browse files

* Add redundant weights download mirrors

This PR seeks to improve access worldwide to YOLOv5 weights. Universal access to AI for all is our core value, and we are against any censorship or restriction efforts.

I've uploaded the official YOLOv5 v6.1 weights to a primary backup bucket on GCP and to secondary backup on Google Drive at https://drive.google.com/drive/folders/1EFQTEUeXWSFww0luse2jB9M1QNZQGwNl. Autodownload with try the first two locations (GitHuB release assets and GCP bucket), and point users to the Google Drive folder if the first two fail.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Files changed (1) hide show
  1. utils/downloads.py +3 -2
utils/downloads.py CHANGED
@@ -72,12 +72,13 @@ def attempt_download(file, repo='ultralytics/yolov5'): # from utils.downloads i
72
  tag = 'v6.1' # current release
73
 
74
  if name in assets:
 
75
  safe_download(
76
  file,
77
  url=f'https://github.com/{repo}/releases/download/{tag}/{name}',
78
- # url2=f'https://storage.googleapis.com/{repo}/ckpt/{name}', # backup url (optional)
79
  min_bytes=1E5,
80
- error_msg=f'{file} missing, try downloading from https://github.com/{repo}/releases/')
81
 
82
  return str(file)
83
 
 
72
  tag = 'v6.1' # current release
73
 
74
  if name in assets:
75
+ url3 = 'https://drive.google.com/drive/folders/1EFQTEUeXWSFww0luse2jB9M1QNZQGwNl' # backup gdrive mirror
76
  safe_download(
77
  file,
78
  url=f'https://github.com/{repo}/releases/download/{tag}/{name}',
79
+ url2=f'https://storage.googleapis.com/{repo}/{tag}/{name}', # backup url (optional)
80
  min_bytes=1E5,
81
+ error_msg=f'{file} missing, try downloading from https://github.com/{repo}/releases/{tag} or {url3}')
82
 
83
  return str(file)
84