|
|
|
|
|
|
|
|
try: # GitHub |
|
|
try: # GitHub |
|
|
url = 'https://github.com/ultralytics/yolov5/releases/download/v3.0/' + file |
|
|
url = 'https://github.com/ultralytics/yolov5/releases/download/v3.0/' + file |
|
|
print('Downloading %s to %s...' % (url, weights)) |
|
|
print('Downloading %s to %s...' % (url, weights)) |
|
|
if platform.system() == 'Darwin': # avoid MacOS python requests certificate error |
|
|
|
|
|
r = os.system('curl -L %s -o %s' % (url, weights)) |
|
|
|
|
|
else: |
|
|
|
|
|
torch.hub.download_url_to_file(url, weights) |
|
|
|
|
|
|
|
|
torch.hub.download_url_to_file(url, weights) |
|
|
assert os.path.exists(weights) and os.path.getsize(weights) > 1E6 # check |
|
|
assert os.path.exists(weights) and os.path.getsize(weights) > 1E6 # check |
|
|
except Exception as e: # GCP |
|
|
except Exception as e: # GCP |
|
|
print('Download error: %s' % e) |
|
|
print('Download error: %s' % e) |