Skip to main content
Open In Colab

Faster RCNN Inference Pipeline

Section 6 of 6 in the Faster RCNN from-scratch series We load the checkpoint saved in section 05, run inference on COCO validation images streamed from Hugging Face, and visualise detections. Topics covered:
  • Loading and verifying a checkpoint
  • Running model.eval() forward pass (proposal generation + postprocessing)
  • Visualising class-agnostic proposals and final detections
  • Measuring per-image inference latency
  • Pseudo-evaluation: counting detections above a confidence threshold
Expected outcome after 5-step training: the checkpoint from section 05 is a sanity-check model, not a trained detector. Expect zero or very few final detections above the 0.05 score threshold, the ROI classifier has seen only 5 images and its weights are essentially random. What you should see is a healthy set of RPN proposals (cyan boxes), confirming the proposal pipeline works end-to-end. A properly trained COCO model (≥12 epochs) would show labelled red boxes on every image.
Output from cell 5
Output from cell 6

Pseudo-evaluation: detection counts above threshold

This is not mAP evaluation. It counts detections that survive the score threshold (0.05) and NMS, a rough proxy for “did the model produce any confident predictions?” on a small sample. For real evaluation use the COCO evaluation API with a fully trained checkpoint.
Key references: (Redmon & Farhadi, 2016; Ren et al., 2015; Redmon et al., 2015; Szegedy et al., 2016; Faster -, 2022)

References

  • (2022). Faster R-CNN.
  • Redmon, J., Farhadi, A. (2016). YOLO9000: Better, Faster, Stronger.
  • Redmon, J., Divvala, S., Girshick, R., Farhadi, A. (2015). You only look once: Unified, real-time object detection.
  • Ren, S., He, K., Girshick, R., Sun, J. (2015). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks.
  • Szegedy, C., Ioffe, S., Vanhoucke, V., Alemi, A. (2016). Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning.