1. Faster RCNN batch size 只能設爲1?
參考:object detect api fasterrcnn OOM:https://github.com/tensorflow/models/issues/3697#issuecomment-425992882
有三種可選的辦法:
- Add
pad_to_max_dimension : true
inkeep_aspect_ratio_resizer
:
keep_aspect_ratio_resizer {
pad_to_max_dimension : true
}
- Change batch size to
1
:
train_config: {
batch_size: 1
}
- Use
fixed_shape_resizer
instead ofkeep_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 Precision
和Average Recall
值爲-1。
上面的例子中,area= small
的Average Precision
和Average Recall
值爲-1,說明驗證集中的標註框面積沒有小於32 * 32
的。