glenn-jocher
commited on
Commit
•
a70e554
1
Parent(s):
46c43b7
Remove redundant downloads mirror (#1461)
Browse files- test.py +1 -1
- utils/autoanchor.py +1 -1
- utils/google_utils.py +2 -0
test.py
CHANGED
@@ -322,4 +322,4 @@ if __name__ == '__main__':
|
|
322 |
y.append(r + t) # results and times
|
323 |
np.savetxt(f, y, fmt='%10.4g') # save
|
324 |
os.system('zip -r study.zip study_*.txt')
|
325 |
-
# utils.
|
|
|
322 |
y.append(r + t) # results and times
|
323 |
np.savetxt(f, y, fmt='%10.4g') # save
|
324 |
os.system('zip -r study.zip study_*.txt')
|
325 |
+
# utils.plots.plot_study_txt(f, x) # plot
|
utils/autoanchor.py
CHANGED
@@ -67,7 +67,7 @@ def kmean_anchors(path='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen=10
|
|
67 |
k: kmeans evolved anchors
|
68 |
|
69 |
Usage:
|
70 |
-
from utils.
|
71 |
"""
|
72 |
thr = 1. / thr
|
73 |
|
|
|
67 |
k: kmeans evolved anchors
|
68 |
|
69 |
Usage:
|
70 |
+
from utils.autoanchor import *; _ = kmean_anchors()
|
71 |
"""
|
72 |
thr = 1. / thr
|
73 |
|
utils/google_utils.py
CHANGED
@@ -22,6 +22,7 @@ def attempt_download(weights):
|
|
22 |
|
23 |
msg = weights + ' missing, try downloading from https://github.com/ultralytics/yolov5/releases/'
|
24 |
models = ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt'] # available models
|
|
|
25 |
|
26 |
if file in models and not os.path.isfile(weights):
|
27 |
# Google Drive
|
@@ -40,6 +41,7 @@ def attempt_download(weights):
|
|
40 |
assert os.path.exists(weights) and os.path.getsize(weights) > 1E6 # check
|
41 |
except Exception as e: # GCP
|
42 |
print('Download error: %s' % e)
|
|
|
43 |
url = 'https://storage.googleapis.com/ultralytics/yolov5/ckpt/' + file
|
44 |
print('Downloading %s to %s...' % (url, weights))
|
45 |
r = os.system('curl -L %s -o %s' % (url, weights)) # torch.hub.download_url_to_file(url, weights)
|
|
|
22 |
|
23 |
msg = weights + ' missing, try downloading from https://github.com/ultralytics/yolov5/releases/'
|
24 |
models = ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt'] # available models
|
25 |
+
redundant = False # offer second download option
|
26 |
|
27 |
if file in models and not os.path.isfile(weights):
|
28 |
# Google Drive
|
|
|
41 |
assert os.path.exists(weights) and os.path.getsize(weights) > 1E6 # check
|
42 |
except Exception as e: # GCP
|
43 |
print('Download error: %s' % e)
|
44 |
+
assert redundant, 'No secondary mirror'
|
45 |
url = 'https://storage.googleapis.com/ultralytics/yolov5/ckpt/' + file
|
46 |
print('Downloading %s to %s...' % (url, weights))
|
47 |
r = os.system('curl -L %s -o %s' % (url, weights)) # torch.hub.download_url_to_file(url, weights)
|