How ifzhang/fairmot works
Project Type and Purpose
• FairMOT is a research-grade, full-stack machine-learning pipeline for real-time multi-object tracking (MOT).
• It fuses object detection and person re-identification (“Re-ID”) in a single network backbone to achieve high tracking accuracy at 30+ FPS.
File Structure Analysis
• Top-level:
• build/Dockerfile – container definition with Python, PyTorch, FFmpeg, DCNv2 runtime.
• experiments/*.sh – shell scripts defining common training/evaluation workflows.
• requirements.txt – Python dependencies.
• assets/ – static images illustrating pipeline and demo GIFs.
• videos/ – sample input videos.
• src/ – core codebase split into:
• Entry scripts (train.py, track.py, track_half.py, demo.py, detect.py, detection_demo.py, test_det.py, test_emb.py)
• data/ – precomputed data splits and raw paths.
• lib/ – modular packages:
– cfg/ – dataset and model configuration JSONs
– datasets/ – PyTorch dataset wrappers and factories
– models/ – network definitions (common, backbones, heads, loss, decode, data_parallel)
– tracker/ – multi-object tracking logic (Hungarian matcher, Kalman filter, base track)
– tracking_utils/ – I/O, evaluation metrics, visualization, NMS, timing, logging
– trains/ – training loops and scheduler factories
– utils/ – image and post-processing helpers
– logger.py, opts.py – global logging and command-line option parsing
README Insights
• Dependencies: Python 3.8, PyTorch ≥1.7, DCNv2, FFmpeg
• Data preparation: CrowdHuman, MIX (Caltech, CityPersons, MOT16/17, etc.), MOT15, MOT20
• Pretrained weights & shell scripts automate common train/eval flows