Computer Vision · Advanced level

Advanced level · Module 3: Advanced Object Detection · Lesson 1 of 3

Detector Families and Instance Segmentation

Learners compare Faster R-CNN (two-stage, torchvision) with YOLO (one-stage), and add instance segmentation masks for counting and measuring objects.

In this lesson you will

  • Explain two-stage, one-stage and anchor-free detection
  • Run and evaluate instance segmentation

Key concepts

region proposalsFaster R-CNNone-stage detectorsanchor-free headsMask R-CNN and segmentation heads

The lesson

Two-stage detectors such as Faster R-CNN first propose candidate regions, then classify and refine them; they are accurate but slower. One-stage detectors such as YOLO predict boxes directly in one pass. Modern detectors are often anchor-free, predicting object centres and sizes rather than adjusting predefined anchor boxes.

Instance segmentation adds a mask per object. torchvision's maskrcnn_resnet50_fpn and Ultralytics segmentation models produce masks, which allow measuring object area, for example the leaf area affected by disease or the size of livestock in an aerial view.

The torchvision object detection fine-tuning tutorial shows how to train Mask R-CNN on a small custom dataset.

Step by step

  1. Run a pretrained Faster R-CNN and a YOLO model on the same ten images.
  2. Compare detections and inference times.
  3. Run an instance segmentation model and compute object areas from masks.
  4. Write when you would choose each detector.

Practice activity

Compare detector families on the capstone images and demonstrate instance segmentation.

Expected result: A comparison table with timings and a working mask-based measurement.

Check your understanding

  1. What does a two-stage detector do first?

    Show answer

    It proposes candidate regions.

  2. What extra output does instance segmentation give?

    Show answer

    A pixel mask for each detected object.

Further learning

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.