Update val.py (#7478)
Browse files* Update val.py
is_coco doesn't work!! '/' -> os.sep!!
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Cleanup
* fix
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
val.py
CHANGED
@@ -155,7 +155,7 @@ def run(
|
|
155 |
# Configure
|
156 |
model.eval()
|
157 |
cuda = device.type != 'cpu'
|
158 |
-
is_coco = isinstance(data.get('val'), str) and data['val'].endswith('coco
|
159 |
nc = 1 if single_cls else int(data['nc']) # number of classes
|
160 |
iouv = torch.linspace(0.5, 0.95, 10, device=device) # iou vector for [email protected]:0.95
|
161 |
niou = iouv.numel()
|
|
|
155 |
# Configure
|
156 |
model.eval()
|
157 |
cuda = device.type != 'cpu'
|
158 |
+
is_coco = isinstance(data.get('val'), str) and data['val'].endswith(f'coco{os.sep}val2017.txt') # COCO dataset
|
159 |
nc = 1 if single_cls else int(data['nc']) # number of classes
|
160 |
iouv = torch.linspace(0.5, 0.95, 10, device=device) # iou vector for [email protected]:0.95
|
161 |
niou = iouv.numel()
|