ViT-Tiny Person Re-ID (Commercial-Safe, 256Γ128, ONNX)
Compact person re-identification model (11.36 MB FP16 ONNX, 5.7M parameters, 512-d L2-normalized embeddings) for multi-object tracking (nltrack, botsort, boosttrack) and cross-exit track merging (--reid-merge), built for Trackflow. Apache-2.0, trained only on commercially usable CC-BY / public-domain data.
Standard person Re-ID checkpoints (such as osnet_ain_x1_0 on MSMT17) carry academic-only dataset terms and struggle on non-surveillance scenes like dance and sports. This model distills an Apache-2.0 DINOv2-Base teacher fine-tuned on commercial-safe video and image person crops into a fast vit_tiny_patch16_224 student with a CLS + GAP + 4-stripe vertical part head, beating 2019 MSMT17 osnet across all 81 official MOT validation videos while running 38% faster on Apple Silicon CoreML.
Use with Trackflow
pip install trackflow-python
trackflow run video.mp4 --tracker nltrack --reid vit-tiny --postprocess
trackflow run mall.mp4 --tracker nltrack --reid vit-tiny --reid-merge
Tracking Benchmarks (All 81 Official Validation Videos)
Trackflow nltrack + --postprocess (+pp), HOTA / AssA / IDSW across DanceTrack-val (25), SportsMOT-val (45), MOT17-val (7), and MOT20-val (4). No frames from MOT17, MOT20, DanceTrack, SportsMOT, MSMT17, Market-1501, DukeMTMC, CUHK03, CrowdHuman, or Objects365 were used in training.
With rtdetr-v2-r18
| Re-ID Model | DanceTrack-val (HOTA / AssA) | SportsMOT-val (HOTA / AssA) | MOT17-val (HOTA / AssA) | MOT20-val (HOTA / AssA) | Mean Re-ID ms/f (M4 Pro CoreML) |
|---|---|---|---|---|---|
osnet (MSMT17, NC) |
47.46 / 36.31 | 52.54 / 56.92 | 50.76 / 62.61 | 27.86 / 38.70 | 30.41 |
this model (onnx/model_fp16.onnx) |
47.82 / 37.18 | 53.76 / 59.51 | 50.64 / 62.38 | 27.75 / 38.68 | 18.93 |
With dfine-s-person
| Re-ID Model | DanceTrack-val (HOTA / AssA) | SportsMOT-val (HOTA / AssA) | MOT17-val (HOTA / AssA) | MOT20-val (HOTA / AssA) | Mean Re-ID ms/f (M4 Pro CoreML) |
|---|---|---|---|---|---|
osnet (MSMT17, NC) |
50.21 / 38.12 | 38.62 / 62.39 | 53.00 / 62.33 | 40.66 / 43.98 | 44.68 |
this model (onnx/model_fp16.onnx) |
51.65 / 40.20 | 39.56 / 65.24 | 53.21 / 62.87 | 40.82 / 44.30 | 28.97 |
Across all 1,126 fragmented ground-truth tracks in the 81 validation videos (--reid-merge probe), this model improves Rank-1 from 69.63% to 76.11% and Best F1 from 45.04% to 59.03% (SportsMOT Merge F1@0.80: 23.74% -> 47.95% at 97.6% precision).
Speed and Parity
Static batch B=8, input [8, 3, 256, 128].
| File | Size | M4 Pro CPU (B=8) |
M4 Pro CoreML (B=8) |
CoreML vs CPU (cos_min) |
T4 CUDA (B=8, cos_min) |
|---|---|---|---|---|---|
onnx/model_fp16.onnx |
11.36 MB (10.83 MiB) | 48.41 ms | 8.35 ms | 0.999999 (max_diff 0.00026) |
7.75 ms (1.000000) |
onnx/model.onnx (FP32) |
22.53 MB (21.49 MiB) | 20.95 ms | 9.40 ms | 1.000000 (max_diff 0.00000) |
10.34 ms (1.000000) |
FP32 vs FP16 cosine similarity at B=8: cos_min = 0.999999 (max_abs_diff = 0.000284).
Exported with fused_attn=False and static batch B=8 so Apple CoreML MLProgram compiles 462/465 nodes cleanly into 3 partitions (ReduceMean, Pow, Sqrt, LpNormalization, and Div kept in FP32 during FP16 conversion).
Training Data and License
- Student backbone:
vit_tiny_patch16_224.augreg_in21k_ft_in1k(Apache-2.0) + CLS + GAP + 4-stripe vertical part projection head (512-d). - Teacher:
facebook/dinov2-with-registers-base(Apache-2.0), fine-tuned on the same commercial-safe corpus (86.71%MEVID val Rank-1), precomputed flip-averaged embeddings distilled across all182,696crops. - Data (
182,696real person crops +3,000RGBA person occluders, 100% commercial-safe):- MEVID Train (Kitware / IARPA, CC BY-4.0): 574 person-outfits across 146 actors in multi-camera video.
- SA-V Subset 51 (Meta / Voxel51, CC BY-4.0): 683 videos (437 multi-person, 1,560 person tracklets) with same-frame hard negatives.
- Open Images V7 (CC BY 2.0 images / CC BY 4.0 annotations) and COCO 2017 (CC BY 4.0 annotations, images strictly filtered to
license in {4, 7, 8}β CC BY 2.0 and Public Domain only, excluding all NC/ND/SA images): 10,056 multi-person scenes plus single-person crops and 3,000 RGBA person masks for Copy-Paste occlusion augmentation.
- Not used: MSMT17, Market-1501, DukeMTMC, CUHK03, CrowdHuman, Objects365, MOTSynth, MOT17, MOT20, DanceTrack, SportsMOT.
Model I/O
- Input:
images,float32, static shape[8, 3, 256, 128], RGB ImageNet-normalized (mean=[0.485, 0.456, 0.406],std=[0.229, 0.224, 0.225]). Pad batches smaller than 8 with zeros and slice the firstNrows of the output. - Output:
embeddings,[8, 512](float16inmodel_fp16.onnx,float32inmodel.onnx), L2-normalized per row.