From 9b92794e20009794589a251309f8cdd25291e2c3 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 2 Apr 2019 14:41:52 +0200 Subject: [PATCH] updates --- test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index 136dc112..0cfa22e6 100644 --- a/test.py +++ b/test.py @@ -72,6 +72,9 @@ def test( seen += 1 if pred is None: + if len(labels): + tcls = labels[:, 0].cpu() # target classes + stats.append((correct, torch.Tensor(), torch.Tensor(), tcls)) continue if save_json: # add to json pred dictionary @@ -162,8 +165,8 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(prog='test.py') parser.add_argument('--batch-size', type=int, default=32, help='size of each image batch') parser.add_argument('--cfg', type=str, default='cfg/yolov3.cfg', help='cfg file path') - parser.add_argument('--data-cfg', type=str, default='cfg/coco.data', help='coco.data file path') - parser.add_argument('--weights', type=str, default='weights/yolov3.weights', help='path to weights file') + parser.add_argument('--data-cfg', type=str, default='cfg/example_single_class.data', help='coco.data file path') + parser.add_argument('--weights', type=str, default='weights/latesth.pt', help='path to weights file') parser.add_argument('--iou-thres', type=float, default=0.5, help='iou threshold required to qualify as detected') parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold') parser.add_argument('--nms-thres', type=float, default=0.5, help='iou threshold for non-maximum suppression')