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的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章