Repo
-
Feature of Single-Scale:
https://github.com/machingclee/Minimal-Code-for-Faster-RCNN-in-pytorch
-
Feature of Multi-Scale with Feature Pyramid Network
https://github.com/machingclee/Minimal-Code-for-Faster-RCNN-with-FPN-in-pytorch
Results
Here the faded white boxes are the ROIs, and blue boxes are refined ROIs that are estimated from the feature of ROIAlign module.


Model Structure

How to Read the Source Code
It is not easy to explain everything in a blog post. Rather one can delve into the source code and see how it works!
Reader can treat src/faster_rcnn.py
as an entry point, the class FasterRCNN
is our target result. The FasterRCNN.forward
method behaves differently when it is in:
- Training Mode. It returns
rpn_cls_loss
rpn_reg_loss
roi_cls_loss
roi_reg_loss
- Evaluation Mode. It returns
scores
roi_refined_box
cls_idxes
rois
(no use, debugging purpose)