Skip to content

Case study 3 of 6

Social distance analyzer

People closer than 2 m, measured on the floor from one camera; 11 detectors benchmarked on two public datasets.

0.99

pair F1 at 2 m, from four clicked floor points

tick = the pixel rule, 0.50 on the same frames

4.2 cm

distance error (MAE) over 67,606 ground-truth pairs

P90 8.5 cm; 3.5 to 6.0 cm at every range to 40 m

0.44

COCO AP, best of 11 detectors on MOT17

tick = the YOLOv3 baseline, 0.27; 5,316 frames

Ground-plane instrument WILDTRACK camera 1, the repo's calibration file

Screen pixels against floor metres

Two foot points on a real frame. The pixel rule reads the gap on the screen; the instrument projects both feet to the floor through the camera's homography and reads it in metres. Drag a marker. Tap anywhere to move the nearer one. Or place a pair with the buttons.

bird's-eye, 1 m grid; the frame's floor corners map to this plane

pixel rule: 50 px at 700 px width (137 px on this 1920 px frame), applied to the same two points; homography from docs/calibration_wildtrack_c1.json, derived from the dataset's camera model

Near the camera 137 px is about 1.3 m; at the far end of the square the same 137 px is over 2 m. A pixel threshold cannot be right at both ends, so every tuned pixel rule stalls near F1 0.55 on this dataset while the floor projection reaches 0.99.

Running on the two datasets annotated frames from the repo, shown under the dataset terms
WILDTRACK camera 1: boxes, red lines between people closer than 2 metres, bird's-eye inset top right
WILDTRACK C1, calibrated: pairs under 2 m in red, bird's-eye inset top right.
MOT17-09 street scene with BoT-SORT track ids and the pixel rule
MOT17-09, no calibration available: BoT-SORT ids and the pixel rule (50 px at 700 px width).

The pixel rule scored against WILDTRACK ground truth

The original Colab notebook used YOLOv3 through OpenCV, box centres, and a flag whenever two centres sat closer than 50 pixels on a 700 px frame. The repo keeps that detector and that rule as the baseline and scores it where the truth is known. WILDTRACK has seven calibrated cameras over one square, with every person's floor position annotated on a 2.5 cm grid.

On ground-truth boxes the pixel rule agrees with the 2 m truth on half of the pairs (pair F1 0.50). Tuning the threshold per camera moves it to 0.54, and measuring from feet instead of box centres to 0.57. The limit is the geometry, so the project projects feet through a homography fitted once from four clicked floor points with known spacing, and reads the distance on the floor.

Pair F1 at 2 m for eight distance methods WILDTRACK, ground-truth boxes, pair F1 at 2 m, frames 1000-1995

The four-click homography matches the full camera calibration (0.987 against 0.987). Clicks are not exact, so the benchmark adds Gaussian noise to the four points over 20 seeds: at 10 px of noise the pair F1 is still 0.957.

F1 against confidence for 11 detectors MOT17 train, 5,316 frames; F1 against confidence; hover to read

At 640 px every newer model has a higher AP than the YOLOv3 baseline and a lower F1 at the baseline's 0.3 threshold, because their score scales differ. Run at 1280 px, the s and m models pass it at every threshold. The threshold is part of the model, so the app exposes it.

End-to-end F1 with detector boxes

End to end, with detector boxes instead of ground truth, person-level F1 at 2 m goes from 0.58 (YOLOv3 and the pixel rule) to 0.66 (yolo26s and four clicked points). Precision moves from 0.84 to 0.96; recall stays near 0.5 for every row because the detector misses people in the crowd, and WILDTRACK's own boxes come from a model, which costs recall under IoU matching. The geometry scores 0.99 when the boxes are right.

Fine-tuning on crowd footage did not help. yolo26s trained for 15 epochs on four MOT17 scenes scored AP 0.33 on three held-out scenes against 0.36 zero-shot, while its same-scene validation mAP rose from 0.67 to 0.72. The split is by sequence, so the gap is scene overfitting.

Frames per second, full pipeline at 1080p median latency, i9-13900H CPU and RTX 4060 laptop GPU

BoT-SORT on yolo26s at 1280 px reaches HOTA 0.49 on MOT17 (ByteTrack 0.46). Neither dataset is redistributed. The repo ships parsers, a manifest and the evaluation code, and git ignores the data, weights and prediction caches.