diff --git a/PaddleCV/PaddleDetection/configs/ssd/ssd_mobilenet_v1_voc.yml b/PaddleCV/PaddleDetection/configs/ssd/ssd_mobilenet_v1_voc.yml index 0bdf7e724ded5da7af8d46a1d338925e9218852b..8830de953c1db40ab389c1f442139e77dec135a0 100644 --- a/PaddleCV/PaddleDetection/configs/ssd/ssd_mobilenet_v1_voc.yml +++ b/PaddleCV/PaddleDetection/configs/ssd/ssd_mobilenet_v1_voc.yml @@ -8,6 +8,7 @@ max_iters: 28000 snapshot_iter: 2000 log_smooth_window: 1 metric: VOC +map_type: 11point save_dir: output weights: output/ssd_mobilenet_v1_voc/model_final/ num_classes: 21 diff --git a/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_300_voc.yml b/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_300_voc.yml index ac3b758cf89e0f0ff16f57bd883588f881a0fa13..eb74c1ee8baa5e46953f9f70e12a436f98926867 100644 --- a/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_300_voc.yml +++ b/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_300_voc.yml @@ -8,6 +8,7 @@ snapshot_iter: 10000 log_smooth_window: 20 log_iter: 20 metric: VOC +map_type: 11point pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar save_dir: output weights: output/ssd_vgg16_300_voc/model_final/ diff --git a/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_512_voc.yml b/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_512_voc.yml index 235111ed7b6e417c8becd6cd6fc982500b114ece..12de33be5ad3729a29fd668f0357eada8f4c8b4e 100644 --- a/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_512_voc.yml +++ b/PaddleCV/PaddleDetection/configs/ssd/ssd_vgg16_512_voc.yml @@ -8,6 +8,7 @@ snapshot_iter: 10000 log_smooth_window: 20 log_iter: 20 metric: VOC +map_type: 11point pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar save_dir: output weights: output/ssd_vgg16_512_voc/model_final/ diff --git a/PaddleCV/PaddleDetection/configs/yolov3_darknet_voc.yml b/PaddleCV/PaddleDetection/configs/yolov3_darknet_voc.yml index 08e00a533e04ab4e996086da69dee2dd191c21ee..1f6c10b7d8cd453e9b9c89247eb073d5ad74b4f8 100644 --- a/PaddleCV/PaddleDetection/configs/yolov3_darknet_voc.yml +++ b/PaddleCV/PaddleDetection/configs/yolov3_darknet_voc.yml @@ -8,6 +8,7 @@ log_smooth_window: 20 save_dir: output snapshot_iter: 2000 metric: VOC +map_type: 11point pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/DarkNet53_pretrained.tar weights: output/yolov3_darknet_voc/model_final num_classes: 20 diff --git a/PaddleCV/PaddleDetection/configs/yolov3_mobilenet_v1_voc.yml b/PaddleCV/PaddleDetection/configs/yolov3_mobilenet_v1_voc.yml index 4601f68f33c0eb0c84604380595e965f2f9a5ffb..8933773ef9d9d2116d6a2ec61a14027661be1c67 100644 --- a/PaddleCV/PaddleDetection/configs/yolov3_mobilenet_v1_voc.yml +++ b/PaddleCV/PaddleDetection/configs/yolov3_mobilenet_v1_voc.yml @@ -8,6 +8,7 @@ log_smooth_window: 20 save_dir: output snapshot_iter: 2000 metric: VOC +map_type: 11point pretrain_weights: http://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_pretrained.tar weights: output/yolov3_mobilenet_v1_voc/model_final num_classes: 20 diff --git a/PaddleCV/PaddleDetection/configs/yolov3_r34_voc.yml b/PaddleCV/PaddleDetection/configs/yolov3_r34_voc.yml index cb8e370bba96c942716de208a8100944cab454c6..5bb6a1366aa8fa38f4c4fe1feeb26528579f75c9 100644 --- a/PaddleCV/PaddleDetection/configs/yolov3_r34_voc.yml +++ b/PaddleCV/PaddleDetection/configs/yolov3_r34_voc.yml @@ -8,6 +8,7 @@ log_smooth_window: 20 save_dir: output snapshot_iter: 2000 metric: VOC +map_type: 11point pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet34_pretrained.tar weights: output/yolov3_r34_voc/model_final num_classes: 20 diff --git a/PaddleCV/PaddleDetection/docs/config_example/ssd_vgg16_300.yml b/PaddleCV/PaddleDetection/docs/config_example/ssd_vgg16_300.yml index 9f812f175ce6990d95469abf29770eaef9c2f934..5a6dc7c210edc0ed2ac550a653463f3142dbc393 100644 --- a/PaddleCV/PaddleDetection/docs/config_example/ssd_vgg16_300.yml +++ b/PaddleCV/PaddleDetection/docs/config_example/ssd_vgg16_300.yml @@ -17,8 +17,10 @@ snapshot_iter: 10000 log_smooth_window: 20 # The log in training is displayed once every period. log_iter: 20 -# Evalution method, COCO and VOC are available. +# Evaluation method, COCO and VOC are available. metric: COCO +# Evaluation mAP calculation method in VOC metric, 11point and integral are available. +map_type: 11point # The path of final model for evaluation and test. pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar # The directory to save models. diff --git a/PaddleCV/PaddleDetection/ppdet/utils/eval_utils.py b/PaddleCV/PaddleDetection/ppdet/utils/eval_utils.py index 9dd7edc11f0619f425d05965197ca9cc8322d14b..afd3dbc7a7e2de298576db4781509e6e2f8cf14d 100644 --- a/PaddleCV/PaddleDetection/ppdet/utils/eval_utils.py +++ b/PaddleCV/PaddleDetection/ppdet/utils/eval_utils.py @@ -96,7 +96,8 @@ def eval_results(results, num_classes, resolution=None, is_bbox_normalized=False, - output_directory=None): + output_directory=None, + map_type='11point'): """Evaluation for evaluation program results""" box_ap_stats = [] if metric == 'COCO': @@ -129,7 +130,9 @@ def eval_results(results, box_ap_stats.append(res * 100.) elif 'bbox' in results[0]: box_ap = voc_bbox_eval( - results, num_classes, is_bbox_normalized=is_bbox_normalized) + results, num_classes, + is_bbox_normalized=is_bbox_normalized, + map_type=map_type) box_ap_stats.append(box_ap) return box_ap_stats diff --git a/PaddleCV/PaddleDetection/tools/eval.py b/PaddleCV/PaddleDetection/tools/eval.py index 264605db4f4e8417ccac6057265fcac45d64c027..3df77b21fd73d8d994df2083e1d596dd323b0bfe 100644 --- a/PaddleCV/PaddleDetection/tools/eval.py +++ b/PaddleCV/PaddleDetection/tools/eval.py @@ -137,7 +137,7 @@ def main(): if 'mask' in results[0]: resolution = model.mask_head.resolution eval_results(results, eval_feed, cfg.metric, cfg.num_classes, resolution, - is_bbox_normalized, FLAGS.output_eval) + is_bbox_normalized, FLAGS.output_eval, cfg.map_type) if __name__ == '__main__':