How hafidh561/multi-camera-people-tracking works
Project type and purpose
• This is a Python-based computer-vision pipeline for multi-camera people tracking.
• It uses YOLOv4-tiny for object detection, Omni-Scale models for person re-identification, and combines detections across multiple camera feeds to label and track individuals over time.
File structure
• Top-level scripts:
• download_model.py – downloads object-detection & re-ID model weights and class files
• object_detection.py – wraps the YOLOv4-tiny inference logic
• feature_extraction.py – wraps the Omni-Scale re-ID model inference
• main.py – entry point that loads config, initializes components, processes video streams, aggregates results, and handles display/save logic
• config.yaml – user-supplied settings (paths, thresholds, camera layout, device selection, output options)
• requirements.txt – Python dependencies
• results/ – sample output GIF and saved videos
Key insights from README
• Single entry point with python3 main.py -s config.yaml
• Configurable thresholds for detection/re-ID, multi-camera layout, display and save options
• Two major model families: detection (YOLOv4-tiny) and feature extraction (Omni-Scale)
Main components and their interactions
a. Components:
1. Configuration Loader
2. Model Downloader
3. Object Detection Engine
4. Feature Extraction / Re-ID Engine
5. Multi-Camera Frame Manager
6. Tracker & Cross-Camera Matcher
7. Visualization & Output Manager
b. Data flow:
• The Config Loader reads config.yaml →
• Downloader (optionally) fetches model files →
• Multi-Camera Frame Manager opens video(s), splits to individual camera streams →
• For each frame:
– Feature Extraction Engine computes person embeddings →
– Tracker / Matcher assigns consistent IDs across frames and cameras →
• Visualization & Output Manager overlays IDs/bboxes, displays live windows and/or writes output video →
c. Architectural patterns:
– Pipeline pattern (modular stages: load, detect, embed, match, display)
– Manager/Worker separation (frame manager vs. detection/extraction workers)
– Config-driven behavior for thresholds, device selection, and I/O paths
d. Key technologies/libraries:
– Python 3.7+
– OpenCV or similar (video I/O and drawing)
– PyTorch / TensorFlow (model inference)
– YOLOv4-tiny weights & class files
– Omni-Scale person re-ID model