matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.75k stars 11.71k forks source link

Strategy for dense imaging (2000+ same objects/image) #463

Open YubinXie opened 6 years ago

YubinXie commented 6 years ago

I have dense images, 1024 * 1024 but there are 2000 same objects in every image. There are two strategies I can think of, hope you can give me some suggestion.

  1. Train on small patch (128 128) and test on big image (1024 1024). Small patch training gives perfect results on small testing image. However, the performance on big test image is terrible (many objects are not detected). This is weird. How can I overcome this?

  2. Train on big size image and test on big size image. I noticed bad performance when training on 256 * 256 images. where there are 100 objects/image.

The reason that I can not split my testing image is that, the image is too dense, splitting will cause many half objects and hard to stitch. Any suggestion is appreciated! Thanks.

apacha commented 6 years ago

Have you tried https://github.com/fizyr/keras-retinanet? It's a one-shot detector for dense objects with the Feature Pyramid Network for multi-scale detection. They've used it on 4k videos with 7fps

YubinXie commented 6 years ago

Thanks for the suggestion. I will have a look. I tried Train on small patch (128 128) and test on big image (1024 1024). and after tuning some parameters, it gives me good results. The only limit now is the GPU memory.

waleedka commented 6 years ago

Make sure you update DETECTION_MAX_INSTANCES. This sets the maximum number of detected objects per image and it defaults to 100.

Also, check MAX_GT_INSTANCES which controls the maximum number of objects per image during training.