glenn-jocher
commited on
Commit
·
d187459
1
Parent(s):
1f698af
study changes
Browse files
test.py
CHANGED
@@ -234,7 +234,7 @@ if __name__ == '__main__':
|
|
234 |
parser = argparse.ArgumentParser(prog='test.py')
|
235 |
parser.add_argument('--weights', type=str, default='weights/yolov5s.pt', help='model.pt path')
|
236 |
parser.add_argument('--data', type=str, default='data/coco.yaml', help='*.data path')
|
237 |
-
parser.add_argument('--batch-size', type=int, default=
|
238 |
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
|
239 |
parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold')
|
240 |
parser.add_argument('--iou-thres', type=float, default=0.65, help='IOU threshold for NMS')
|
@@ -262,13 +262,14 @@ if __name__ == '__main__':
|
|
262 |
opt.augment)
|
263 |
|
264 |
elif opt.task == 'study': # run over a range of settings and save/plot
|
265 |
-
for weights in ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt'
|
266 |
f = 'study_%s_%s.txt' % (Path(opt.data).stem, Path(weights).stem) # filename to save to
|
267 |
-
x = list(range(
|
268 |
y = [] # y axis
|
269 |
for i in x: # img-size
|
270 |
print('\nRunning %s point %s...' % (f, i))
|
271 |
r, _, t = test(opt.data, weights, opt.batch_size, i, opt.conf_thres, opt.iou_thres, opt.save_json)
|
272 |
y.append(r + t) # results and times
|
273 |
np.savetxt(f, y, fmt='%10.4g') # save
|
274 |
-
|
|
|
|
234 |
parser = argparse.ArgumentParser(prog='test.py')
|
235 |
parser.add_argument('--weights', type=str, default='weights/yolov5s.pt', help='model.pt path')
|
236 |
parser.add_argument('--data', type=str, default='data/coco.yaml', help='*.data path')
|
237 |
+
parser.add_argument('--batch-size', type=int, default=32, help='size of each image batch')
|
238 |
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
|
239 |
parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold')
|
240 |
parser.add_argument('--iou-thres', type=float, default=0.65, help='IOU threshold for NMS')
|
|
|
262 |
opt.augment)
|
263 |
|
264 |
elif opt.task == 'study': # run over a range of settings and save/plot
|
265 |
+
for weights in ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt']:
|
266 |
f = 'study_%s_%s.txt' % (Path(opt.data).stem, Path(weights).stem) # filename to save to
|
267 |
+
x = list(range(288, 896, 64)) # x axis
|
268 |
y = [] # y axis
|
269 |
for i in x: # img-size
|
270 |
print('\nRunning %s point %s...' % (f, i))
|
271 |
r, _, t = test(opt.data, weights, opt.batch_size, i, opt.conf_thres, opt.iou_thres, opt.save_json)
|
272 |
y.append(r + t) # results and times
|
273 |
np.savetxt(f, y, fmt='%10.4g') # save
|
274 |
+
os.system('zip -r study.zip study_*.txt')
|
275 |
+
# plot_study_txt(f, x) # plot
|