All work

Selected work / Case study

CCTV Person Counter

A recorded-video person-counting pipeline combining scene-grouped dataset cleaning, pretrained YOLO26s fine-tuning, tracking, line-crossing reports, and local runtime comparisons.

The problem

Build a reproducible path from a noisy CCTV export to person detection and counting, while distinguishing per-frame detections, directional crossings, and tracker identities.

Engineering focus

Audit duplicates and scene grouping, evaluate detection and count error separately, and compare inference runtimes without presenting model-call timing as full video-pipeline throughput.

Implementation overview

  1. Audit and clean scenes

    Group duplicate exports, normalize person labels, and split by scene families.

  2. Fine-tune and evaluate

    Fine-tune pretrained YOLO26s and measure detection and per-frame count quality separately.

  3. Compare local runtimes

    Export compatible backends and benchmark model calls with explicit fixed input dimensions.

  4. Track recorded video

    Use ByteTrack or BoT-SORT with a calibrated virtual line; tracker identities can fragment.

  5. Review file outputs

    Write CSV/JSON and optional annotated video. This is a CLI workflow without an inference API or application database.

Component flow derived from the reviewed code; this is not an observed production deployment.

Implementation

  • Audit augmented duplicates, remove shoe labels and non-CCTV scenes, convert COCO/YOLO labels to one person class, and split by heuristic scene groups stratified by domain and density.
  • Fine-tune pretrained YOLO26s in default, tuned, and indoor runs; evaluate detection with COCOeval and counts with MAE, RMSE, bias, and within-one error.
  • Process local recorded video with ByteTrack or BoT-SORT and Supervision LineZone. Export per-frame occupancy and cumulative crossings to CSV/JSON, with optional annotated video.
  • Compare PyTorch, ONNX Runtime, OpenVINO, and TensorRT using the same local image sample; account for fixed model-export dimensions and separate predict-call timing from tracking and encoding.
  • Implement frame sampling, draft labels, manual-correction merging, and store-training configuration. Store-only evaluation, its error gallery, and progress monitoring remain unimplemented.
  • Document one local single-frame model example returning four detections at confidence 0.25 and image size 640. Its reviewed illustration masks the visible face and camera overlay; it does not validate video tracking.

Evidence & source

Saved default-run evaluation covers 475 test images and 1,844 boxes: mAP50 0.8907, mAP50–95 0.5842, count MAE 0.640, within-one 88%, and exact count 55.58% at confidence 0.25. Threshold selection used the evaluated split, so these are exploratory results. A historical 40-image comparison on an i5-13400F / RTX 4060 Ti records about 19.9 FPS for OpenVINO CPU and 78.3 FPS for TensorRT at 640 pixels, excluding tracking and encoding. These historical experiments were not rerun here. The single-frame illustration comes from a separate documented local example, not the historical test evaluation.

Decisions & limitations

Historical warehouse output averages 2.35 tracked detections where the README visually estimates 5–7 people, exposing a domain gap. Forty cumulative tracker IDs are not forty verified visitors. There are no ground-truth track IDs or empty images, and scene grouping is heuristic. The shared fallback ID −1 can create false crossings; optimizer=auto can ignore a requested learning rate. The CLI accepts local files and has no explicit device/image-size options; store adaptation is partial. Dataset and model redistribution rights are unverified: only the owner-directed redacted example is shown, without a general dataset licence. No operational accuracy, hosted demo, or complete reproducibility from the package alone is claimed.

Technology stack

  • Python
  • PyTorch
  • YOLO26
  • OpenCV
  • Supervision
  • OpenVINO
  • TensorRT