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.

Found an error on this page? Report an issue.