facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.3k stars 2.49k forks source link

Can I modify the library to make networks run faster? #42

Open anuar12 opened 6 years ago

anuar12 commented 6 years ago

❓ Questions and Help

Hello, thank you for amazing library!

I am working on an application that requires near realtime processing (~10 fps, i.e. 100 ms) on ~1050 GPU on ~ 1280x720 images. Is there anything I could easily modify that can make the object detection networks faster. I tried Resnet-50-FPN and got ~160 ms on 1070 GPU. I was thinking to modify the number of proposals (number of objects in my images are < 14, classes are < 6) that are processed by ROI heads or can I modify the architecture itself easily (e.g. number of filters)? What would you recommend? I don't mind to suffer a small decrease in mAP.

Cheers,

fmassa commented 6 years ago

I have a some smaller networks that runs faster, but have significantly worse map (24 map on COCO, compared to 36 for R-50). I might still look into getting smaller models with better accuracies, but I can't promise I'll get anything better for now.

Decreasing the number of proposals in the RPN and increasing the MODEL.ROI_HEADS.SCORE_THRESH will speed things up a bit as well

anuar12 commented 6 years ago

Thank you! I will try to change those parameters, will see how it improves.

Yep, smaller models would def be great. E.g. TF's object detection API has SSD-mobilenet.

wangzhangup commented 6 years ago

Smaller input will speed up inference time.

lucasjinreal commented 6 years ago

@wangzhangup MobileNet backend are expecting to extremly faster inference proccess

fmassa commented 6 years ago

If anyone is willing to send a PR adding a MobileNet backbone, I'd be more than happy to help review it and merge it into the library