Simplify val.py benchmark mode with speed mode (#9674)

Update
This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-10-02 13:37:54 +02:00
1 parent 8a19437690
commit 1158a50abd
3 files changed
+4 -6

No files matched your search

+2 -2
View File
@@ -81,10 +81,10 @@ def run(
# Validate
if model_type == SegmentationModel:
result = val_seg(data, w, batch_size, imgsz, plots=False, device=device, task='benchmark', half=half)
result = val_seg(data, w, batch_size, imgsz, plots=False, device=device, task='speed', half=half)
metric = result[0][7] # (box(p, r, map50, map), mask(p, r, map50, map), *loss(box, obj, cls))
else: # DetectionModel:
result = val_det(data, w, batch_size, imgsz, plots=False, device=device, task='benchmark', half=half)
result = val_det(data, w, batch_size, imgsz, plots=False, device=device, task='speed', half=half)
metric = result[0][3] # (p, r, map50, map, *loss(box, obj, cls))
speed = result[2][1] # times (preprocess, inference, postprocess)
y.append([name, round(file_size(w), 1), round(metric, 4), round(speed, 2)]) # MB, mAP, t_inference