From 300e2b5dfc04e626f2e9aa8fce5b8b1a4ec678e9 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 10 Sep 2018 16:41:02 +0200 Subject: [PATCH] updates --- test.py | 2 +- utils/gcp.sh | 8 ++++++++ utils/utils.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index 5ff81729..7252e291 100644 --- a/test.py +++ b/test.py @@ -11,7 +11,7 @@ parser.add_argument('-weights_path', type=str, default='checkpoints/yolov3.weigh parser.add_argument('-class_path', type=str, default='data/coco.names', help='path to class label 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.5, help='object confidence threshold') -parser.add_argument('-nms_thres', type=float, default=0.45, help='iou threshold for non-maximum suppression') +parser.add_argument('-nms_thres', type=float, default=0.4, help='iou threshold for non-maximum suppression') parser.add_argument('-n_cpu', type=int, default=0, help='number of cpu threads to use during batch generation') parser.add_argument('-img_size', type=int, default=416, help='size of each image dimension') parser.add_argument('-use_cuda', type=bool, default=True, help='whether to use cuda if available') diff --git a/utils/gcp.sh b/utils/gcp.sh index 50e1b9a5..ed1d189c 100644 --- a/utils/gcp.sh +++ b/utils/gcp.sh @@ -12,3 +12,11 @@ python3 detect.py # Test python3 test.py -img_size 416 -weights_path checkpoints/yolov3.weights + + +sudo rm -rf yolov3 && git clone https://github.com/ultralytics/yolov3 +cd yolov3 +cd checkpoints +wget https://pjreddie.com/media/files/yolov3.weights +cd .. +python3 test.py -img_size 416 -weights_path checkpoints/yolov3.weights diff --git a/utils/utils.py b/utils/utils.py index fc590bc1..fe620193 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -99,7 +99,7 @@ def ap_per_class(tp, conf, pred_cls, target_cls): tp, conf, pred_cls = tp[i], conf[i], pred_cls[i] # Find unique classes - unique_classes = target_cls# np.unique(np.concatenate((pred_cls, target_cls), 0)) + unique_classes = np.unique(np.concatenate((pred_cls, target_cls), 0)) # Create Precision-Recall curve and compute AP for each class ap = []