This commit is contained in:
Glenn Jocher 2019-12-20 08:41:28 -08:00
parent 2e1c415e59
commit 8d54770859
1 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ def test(cfg,
# Configure run # Configure run
data = parse_data_cfg(data) data = parse_data_cfg(data)
nc = int(data['classes']) # number of classes nc = int(data['classes']) # number of classes
test_path = data['valid'] # path to test images path = data['valid'] # path to test images
names = load_classes(data['names']) # class names names = load_classes(data['names']) # class names
iou_thres = torch.linspace(0.5, 0.95, 10).to(device) # for mAP@0.5:0.95 iou_thres = torch.linspace(0.5, 0.95, 10).to(device) # for mAP@0.5:0.95
iou_thres = iou_thres[0].view(1) # for mAP@0.5 iou_thres = iou_thres[0].view(1) # for mAP@0.5
@ -54,7 +54,7 @@ def test(cfg,
# Dataloader # Dataloader
if dataloader is None: if dataloader is None:
dataset = LoadImagesAndLabels(test_path, img_size, batch_size, rect=True) dataset = LoadImagesAndLabels(path, img_size, batch_size, rect=True)
batch_size = min(batch_size, len(dataset)) batch_size = min(batch_size, len(dataset))
dataloader = DataLoader(dataset, dataloader = DataLoader(dataset,
batch_size=batch_size, batch_size=batch_size,