FixTheRobot Explore Robotics / Perception / P6 / P6-L2

This lab works on phones, but writing code is much easier on a laptop.

Perception · Object Detection and Semantic Understanding · P6-L2 · Intermediate

Evaluate Predictions Against Ground Truth

Two teams report “90% precision” for their detectors on the same images, and one of them is clearly worse. Their evaluation scripts disagree about what counts as a correct box.

You will fix the definition, write the matching that every benchmark relies on, and compute average precision.

Your task

    Simulation
    solution.pyLoading Python…
    Ctrl+Enter runs
    What Python can I use?

    Plain Python with math (and slamkit for small matrix helpers: matmul, transpose, solve, inverse, identity). Images, point clouds and detections arrive as lists inside the dictionary D; an image is a list of rows, each row a list of pixels. There is no NumPy or OpenCV: you write the algorithm yourself, which is the point of the lab. Print with print().

    Hints

    What this lab teaches

    Stage 1 explores the IoU threshold. Stage 2 writes the one-to-one matching of predictions to ground truth. Stage 3 computes average precision and mean average precision. The predictions are produced by a simulated detector with a stated error model, not by a trained neural network. Your code is graded on hidden datasets against a reference evaluation.

    Theory for this lab

    Object Detection and Semantic Understanding labs

    1. P6-L1: Interpret Detection Outputs
    2. P6-L2: Evaluate Predictions Against Ground Truth: this lab.
    3. P6-L3: Investigate Confidence Thresholds and Missed Detections
    4. P6-L4: Compare Performance Across Scene Conditions

    Educational simplification and honesty note: predictions come from a simulator that turns known ground truth into detector-like output with an explicit error model (missed objects, jittered boxes, wrong classes, duplicates, false alarms), then through non-maximum suppression; no neural network is run. Real benchmarks use many more images and classes, several IoU thresholds and interpolation rules that differ between datasets. All data in this lab are simulated.

    Get the next lab

    Get notified when new robotics labs are released. One email per new lab, nothing else.