This commit is contained in:
Glenn Jocher 2019-04-02 14:41:52 +02:00
parent 6ae25fc597
commit 9b92794e20
1 changed files with 5 additions and 2 deletions

View File

@ -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')