Remove redundant downloads mirror (#1461)
This commit is contained in:
1 parent
46c43b7b17
commit
a70e554fc3
3 files changed
+4
-2
No files matched your search
@@ -322,4 +322,4 @@ if __name__ == '__main__':
|
|||||||
y.append(r + t) # results and times
|
y.append(r + t) # results and times
|
||||||
np.savetxt(f, y, fmt='%10.4g') # save
|
np.savetxt(f, y, fmt='%10.4g') # save
|
||||||
os.system('zip -r study.zip study_*.txt')
|
os.system('zip -r study.zip study_*.txt')
|
||||||
# utils.general.plot_study_txt(f, x) # plot
|
# utils.plots.plot_study_txt(f, x) # plot
|
||||||
+1
-1
@@ -67,7 +67,7 @@ def kmean_anchors(path='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen=10
|
|||||||
k: kmeans evolved anchors
|
k: kmeans evolved anchors
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
from utils.general import *; _ = kmean_anchors()
|
from utils.autoanchor import *; _ = kmean_anchors()
|
||||||
"""
|
"""
|
||||||
thr = 1. / thr
|
thr = 1. / thr
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ def attempt_download(weights):
|
|||||||
|
|
||||||
msg = weights + ' missing, try downloading from https://github.com/ultralytics/yolov5/releases/'
|
msg = weights + ' missing, try downloading from https://github.com/ultralytics/yolov5/releases/'
|
||||||
models = ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt'] # available models
|
models = ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt'] # available models
|
||||||
|
redundant = False # offer second download option
|
||||||
|
|
||||||
if file in models and not os.path.isfile(weights):
|
if file in models and not os.path.isfile(weights):
|
||||||
# Google Drive
|
# Google Drive
|
||||||
@@ -40,6 +41,7 @@ def attempt_download(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)
|
||||||
|
assert redundant, 'No secondary mirror'
|
||||||
url = 'https://storage.googleapis.com/ultralytics/yolov5/ckpt/' + file
|
url = 'https://storage.googleapis.com/ultralytics/yolov5/ckpt/' + file
|
||||||
print('Downloading %s to %s...' % (url, weights))
|
print('Downloading %s to %s...' % (url, weights))
|
||||||
r = os.system('curl -L %s -o %s' % (url, weights)) # torch.hub.download_url_to_file(url, weights)
|
r = os.system('curl -L %s -o %s' % (url, weights)) # torch.hub.download_url_to_file(url, weights)
|
||||||
|
|||||||
Reference in new issue
Block a user