endernewton / tf-faster-rcnn

Tensorflow Faster RCNN for Object Detection
https://arxiv.org/pdf/1702.02138.pdf
MIT License
3.65k stars 1.58k forks source link

Are images without gt bounding box all filtered out during training? #459

Closed yyc9268 closed 4 years ago

yyc9268 commented 5 years ago

Hi. I am trying to train the network using my custom 'food' dataset. To guide the network not to detect False-Positive objects which are not actually foods, I added non-food images(like scenes with pedestrians or equipments) and corresponding xml, wihtout any bb label. Although there's no bounding box on image, corresponding xml file is necessary since it commits error if not. The training is OK. But i found the message produced by training code saying that roidb is filtered out. image

Is this mean that my background only images are all filtered out and havn't been used during training? Training data consists of imdb and roidb. So, i'm quite confused because there's also a possibility that only roidb of those background image are removed and the images(imdb) have been used for training. And currently, it is hard to validate the effect of those background images in accuracy.

I'm tracking the code but currently have no idea on this problem. Thanks!

rnsandeep commented 5 years ago

I think somewhere in the code it is coded in the way that it won't take images which doesn't have any positive box. If you want to add more background images, then one trick would be to cut down the positive box from original images and randomly place in your background images and include that in training. That will make sure that your background images would be included in training.

If not, you have to add code to consider your background images which doesn't have any positive. It can be doable.

yyc9268 commented 5 years ago

@rnsandeep Nice idea. Its worth to be tried. So, as I assumed, the code filters our void images without bounding-boxes. I understand that those images may degrade the performance in some case. But for a few cases like me, training with void images should be helpful. I hope there exists an option to turn this filtering off or on. Anyway, I will try your idea and if failed, may have to modify the code by myself. Thanks!