问题
I used tensorflow object detection api with RFCN_resnet101 for little objects, but sometimes the detection result is not good, it will detect the object with offset, and sometimes it detects an object by mistake. Does anyone knows how to deal with it?
回答1:
Debugging object detection can be tricky. I recommend checking the input data (does it make sense):
- Do object bounding boxes get displayed correctly when overlayed with images?
- Are you using pixel box coordinates (vs normalized) when preparing the training data?
- Do you have boxes that are too small or outside the image boundary that cause tensor NaN errors?
- Do you have images that are too large and cause CUDA out of memory errors?
Once you are satisfied with input data and able to successfully generate TF records files for training and evaluation. I recommend asking the following questions:
- Are you training the network for sufficient number of global iterations (e.g. 200K) on preferrably multiple GPUs with a sufficiently large batch size?
Are you getting resonable detections when evaluating on a few images, e.g. by specifying the following config file:
eval_config: { num_examples: 1000 num_visualizations: 16 min_score_threshold: 0.15 # Note: The below line limits the evaluation process to 10 evaluations. # Remove the below line to evaluate indefinitely. max_evals: 1 }
Here
num_visualizations
will create animages
tab in tensorboard when you runeval.py
script, and you'll be able to visualize detections and vary the IoUmin_score_threshold
.Are you fine-tuning a pre-trained model, e.g. check to make sure you have
fine_tune_checkpoint: "/path/to/model.ckpt" from_detection_checkpoint: true
Finally, the beauty of TensorFlow object detection API is that you can try different object detection models: Faster R-CNN, YOLO, SSD that have different speed-accuracy tradeoffs without much extra work. You may find a different object detector works better for your application.
来源:https://stackoverflow.com/questions/46841927/tensorflow-object-detection-api-for-object-detection-but-the-result-is-not-good