FurkanOM / tf-faster-rcnn

Tensorflow 2 Faster-RCNN implementation from scratch supporting to the batch processing with MobileNetV2 and VGG16 backbones
Apache License 2.0
94 stars 61 forks source link

bouding boxes predictions on rpn #3

Closed emipasat closed 4 years ago

emipasat commented 4 years ago

Hi, I trained the RPN only with rpn_trainer.py with mobilenet_v2 backbone on voc2007, batch size 1 and 50 epochs. But when running rpn_predictor.py as it is, no changes, I got tons of bounding boxes like in attached image. Which code should be run to get similar predictions (i.e. just a few bounding boxes) like you obtained in your example with the lion picture? Thanks! image image

emipasat commented 4 years ago

This is your example I was referring to (from the other repository): image

FurkanOM commented 4 years ago

Hi, the lion prediction was made without the nms. If you remove the non max suppression method, sort the predictions according to the probabilities and draw the first few results, you can get similar results.

FurkanOM commented 4 years ago

Or you can try my last update. I made the change mentioned above in rpn predictor.

emipasat commented 4 years ago

With the latest update I got these (with a clean pulled master branch). All boxes are starting from upper left: image image Doing a quick print of the selected_rpn_bboxes tensor gives values between 1 and 10: image From the TF docs it seems expected values should be between 0 and 1: image

Should I try to retrain my model or I'm missing something? Model is trained with rpn_trainer.py, mobilenet_v2 and voc/2007.

FurkanOM commented 4 years ago

Hi, your results already range from 0 to 1. We can simply say that your model is not well trained. When your model is sufficiently trained, you should get similar results below. dog people

emipasat commented 4 years ago

Ok, I'll train it again for 100 epochs and for voc2012. Thanks a lot!