TensorFlow Object Detection API使用问题小记

1. Faster RCNN batch size 只能设为1?

参考:object detect api fasterrcnn OOM:https://github.com/tensorflow/models/issues/3697#issuecomment-425992882

有三种可选的办法:

  1. Add pad_to_max_dimension : true in keep_aspect_ratio_resizer:
keep_aspect_ratio_resizer {
  pad_to_max_dimension : true
}
  1. Change batch size to 1:
train_config: {
  batch_size: 1
}
  1. Use fixed_shape_resizer instead of keep_aspect_ratio_resizer:
fixed_shape_resizer { 
	width: 1024
	height: 2014
}

2. config文件里的keep_aspect_ratio_resizer是什么意思?

    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 600
        max_dimension: 1024
      }
    }

在resize图像大小过程中保持原图像的长宽比不变,并确保图像的尺寸在最小最大范围内。

3. coco_detection_metrics ——COCO检测指标

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.025
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.078
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.005
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.045
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.018
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.043
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.047
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.047
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.070
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.038
1.Average Precision (AP)和Average Recall (AR)等等这些都是啥意思?
  • IoU=0.50意味着IoU大于0.5被认为是检测到。
  • IoU=0.50:0.95意味着IoU在0.5到0.95的范围内被认为是检测到。
  • 越低的IoU阈值,则判为正确检测的越多,相应的,Average Precision (AP)也就越高。参考上面的第二第三行。
  • small表示标注的框面积小于32 * 32
  • medium表示标注的框面积同时小于96 * 96
  • large表示标注的框面积大于等于96 * 96
  • all表示不论大小,我都要。
  • maxDets=100表示最大检测目标数为100。
2. Average Precision (AP)和Average Recall (AR)值里面有-1是什么情况?

参考:https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/cocoeval.py#L52

标注里面没有此类型的目标框,则Average PrecisionAverage Recall值为-1。

上面的例子中,area= smallAverage PrecisionAverage Recall值为-1,说明验证集中的标注框面积没有小于32 * 32的。

你可能感兴趣的:(深度学习)