glenn-jocher
commited on
Commit
•
fad57c2
1
Parent(s):
234e8ae
Fix `is_coco` on missing `data['val']` key (#4642)
Browse files
val.py
CHANGED
@@ -134,7 +134,7 @@ def run(data,
|
|
134 |
|
135 |
# Configure
|
136 |
model.eval()
|
137 |
-
is_coco =
|
138 |
nc = 1 if single_cls else int(data['nc']) # number of classes
|
139 |
iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for mAP@0.5:0.95
|
140 |
niou = iouv.numel()
|
|
|
134 |
|
135 |
# Configure
|
136 |
model.eval()
|
137 |
+
is_coco = isinstance(data.get('val'), str) and data['val'].endswith('coco/val2017.txt') # COCO dataset
|
138 |
nc = 1 if single_cls else int(data['nc']) # number of classes
|
139 |
iouv = torch.linspace(0.5, 0.95, 10).to(device) # iou vector for mAP@0.5:0.95
|
140 |
niou = iouv.numel()
|