|
|
|
|
|
|
|
|
# Configure |
|
|
# Configure |
|
|
model.eval() |
|
|
model.eval() |
|
|
cuda = device.type != 'cpu' |
|
|
cuda = device.type != 'cpu' |
|
|
is_coco = isinstance(data.get('val'), str) and data['val'].endswith('coco/val2017.txt') # COCO dataset |
|
|
|
|
|
|
|
|
is_coco = isinstance(data.get('val'), str) and data['val'].endswith(f'coco{os.sep}val2017.txt') # COCO dataset |
|
|
nc = 1 if single_cls else int(data['nc']) # number of classes |
|
|
nc = 1 if single_cls else int(data['nc']) # number of classes |
|
|
iouv = torch.linspace(0.5, 0.95, 10, device=device) # iou vector for mAP@0.5:0.95 |
|
|
iouv = torch.linspace(0.5, 0.95, 10, device=device) # iou vector for mAP@0.5:0.95 |
|
|
niou = iouv.numel() |
|
|
niou = iouv.numel() |