提交 e9dea08b 编写于 作者: K Kaipeng Deng 提交者: GitHub

add --map_type to set voc_eval map_type (#3260)

上级 1b42de24
...@@ -8,6 +8,7 @@ max_iters: 28000 ...@@ -8,6 +8,7 @@ max_iters: 28000
snapshot_iter: 2000 snapshot_iter: 2000
log_smooth_window: 1 log_smooth_window: 1
metric: VOC metric: VOC
map_type: 11point
save_dir: output save_dir: output
weights: output/ssd_mobilenet_v1_voc/model_final/ weights: output/ssd_mobilenet_v1_voc/model_final/
num_classes: 21 num_classes: 21
......
...@@ -8,6 +8,7 @@ snapshot_iter: 10000 ...@@ -8,6 +8,7 @@ snapshot_iter: 10000
log_smooth_window: 20 log_smooth_window: 20
log_iter: 20 log_iter: 20
metric: VOC metric: VOC
map_type: 11point
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar
save_dir: output save_dir: output
weights: output/ssd_vgg16_300_voc/model_final/ weights: output/ssd_vgg16_300_voc/model_final/
......
...@@ -8,6 +8,7 @@ snapshot_iter: 10000 ...@@ -8,6 +8,7 @@ snapshot_iter: 10000
log_smooth_window: 20 log_smooth_window: 20
log_iter: 20 log_iter: 20
metric: VOC metric: VOC
map_type: 11point
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar
save_dir: output save_dir: output
weights: output/ssd_vgg16_512_voc/model_final/ weights: output/ssd_vgg16_512_voc/model_final/
......
...@@ -8,6 +8,7 @@ log_smooth_window: 20 ...@@ -8,6 +8,7 @@ log_smooth_window: 20
save_dir: output save_dir: output
snapshot_iter: 2000 snapshot_iter: 2000
metric: VOC metric: VOC
map_type: 11point
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/DarkNet53_pretrained.tar pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/DarkNet53_pretrained.tar
weights: output/yolov3_darknet_voc/model_final weights: output/yolov3_darknet_voc/model_final
num_classes: 20 num_classes: 20
......
...@@ -8,6 +8,7 @@ log_smooth_window: 20 ...@@ -8,6 +8,7 @@ log_smooth_window: 20
save_dir: output save_dir: output
snapshot_iter: 2000 snapshot_iter: 2000
metric: VOC metric: VOC
map_type: 11point
pretrain_weights: http://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_pretrained.tar pretrain_weights: http://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_pretrained.tar
weights: output/yolov3_mobilenet_v1_voc/model_final weights: output/yolov3_mobilenet_v1_voc/model_final
num_classes: 20 num_classes: 20
......
...@@ -8,6 +8,7 @@ log_smooth_window: 20 ...@@ -8,6 +8,7 @@ log_smooth_window: 20
save_dir: output save_dir: output
snapshot_iter: 2000 snapshot_iter: 2000
metric: VOC metric: VOC
map_type: 11point
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet34_pretrained.tar pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet34_pretrained.tar
weights: output/yolov3_r34_voc/model_final weights: output/yolov3_r34_voc/model_final
num_classes: 20 num_classes: 20
......
...@@ -17,8 +17,10 @@ snapshot_iter: 10000 ...@@ -17,8 +17,10 @@ snapshot_iter: 10000
log_smooth_window: 20 log_smooth_window: 20
# The log in training is displayed once every period. # The log in training is displayed once every period.
log_iter: 20 log_iter: 20
# Evalution method, COCO and VOC are available. # Evaluation method, COCO and VOC are available.
metric: COCO 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. # The path of final model for evaluation and test.
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/VGG16_caffe_pretrained.tar
# The directory to save models. # The directory to save models.
......
...@@ -96,7 +96,8 @@ def eval_results(results, ...@@ -96,7 +96,8 @@ def eval_results(results,
num_classes, num_classes,
resolution=None, resolution=None,
is_bbox_normalized=False, is_bbox_normalized=False,
output_directory=None): output_directory=None,
map_type='11point'):
"""Evaluation for evaluation program results""" """Evaluation for evaluation program results"""
box_ap_stats = [] box_ap_stats = []
if metric == 'COCO': if metric == 'COCO':
...@@ -129,7 +130,9 @@ def eval_results(results, ...@@ -129,7 +130,9 @@ def eval_results(results,
box_ap_stats.append(res * 100.) box_ap_stats.append(res * 100.)
elif 'bbox' in results[0]: elif 'bbox' in results[0]:
box_ap = voc_bbox_eval( 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) box_ap_stats.append(box_ap)
return box_ap_stats return box_ap_stats
......
...@@ -137,7 +137,7 @@ def main(): ...@@ -137,7 +137,7 @@ def main():
if 'mask' in results[0]: if 'mask' in results[0]:
resolution = model.mask_head.resolution resolution = model.mask_head.resolution
eval_results(results, eval_feed, cfg.metric, cfg.num_classes, 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__': if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册