trackflow-python-tensorrt 0.6.1__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. trackflow_python_tensorrt-0.7.0/Cargo.lock +132 -0
  2. trackflow_python_tensorrt-0.7.0/Cargo.toml +22 -0
  3. trackflow_python_tensorrt-0.6.1/README.md → trackflow_python_tensorrt-0.7.0/PKG-INFO +111 -9
  4. trackflow_python_tensorrt-0.6.1/PKG-INFO → trackflow_python_tensorrt-0.7.0/README.md +54 -57
  5. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/pyproject.toml +19 -5
  6. trackflow_python_tensorrt-0.7.0/rust/src/detr.rs +369 -0
  7. trackflow_python_tensorrt-0.7.0/rust/src/image.rs +192 -0
  8. trackflow_python_tensorrt-0.7.0/rust/src/interop.rs +217 -0
  9. trackflow_python_tensorrt-0.7.0/rust/src/iou.rs +307 -0
  10. trackflow_python_tensorrt-0.7.0/rust/src/kalman.rs +705 -0
  11. trackflow_python_tensorrt-0.7.0/rust/src/lap.rs +265 -0
  12. trackflow_python_tensorrt-0.7.0/rust/src/lib.rs +31 -0
  13. trackflow_python_tensorrt-0.7.0/rust/src/nltrack.rs +1672 -0
  14. trackflow_python_tensorrt-0.7.0/rust/src/postproc.rs +175 -0
  15. trackflow_python_tensorrt-0.7.0/rust/src/trackers.rs +2103 -0
  16. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/__init__.py +33 -2
  17. trackflow_python_tensorrt-0.7.0/src/trackflow/_accel.py +36 -0
  18. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/boosttrack.py +36 -0
  19. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/cli.py +79 -5
  20. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/detector.py +75 -13
  21. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/lines.py +5 -0
  22. trackflow_python_tensorrt-0.7.0/src/trackflow/mask_fallback.py +1025 -0
  23. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/models.py +70 -0
  24. trackflow_python_tensorrt-0.7.0/src/trackflow/nltrack.py +1107 -0
  25. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/ocsort.py +38 -0
  26. trackflow_python_tensorrt-0.7.0/src/trackflow/pipeline.py +1473 -0
  27. trackflow_python_tensorrt-0.7.0/src/trackflow/postprocess.py +2068 -0
  28. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/privacy.py +122 -23
  29. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/reid.py +178 -12
  30. trackflow_python_tensorrt-0.7.0/src/trackflow/sam2_adapter.py +222 -0
  31. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/tracker.py +124 -12
  32. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/types.py +7 -1
  33. trackflow_python_tensorrt-0.6.1/src/trackflow/pipeline.py +0 -910
  34. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/LICENSE +0 -0
  35. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/benchmark.py +0 -0
  36. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/homography.py +0 -0
  37. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/inspector.py +0 -0
  38. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/inspector_ui.html +0 -0
  39. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/py.typed +0 -0
  40. {trackflow_python_tensorrt-0.6.1 → trackflow_python_tensorrt-0.7.0}/src/trackflow/sinks.py +0 -0
@@ -0,0 +1,132 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "heck"
7
+ version = "0.5.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
10
+
11
+ [[package]]
12
+ name = "libc"
13
+ version = "0.2.191"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
16
+
17
+ [[package]]
18
+ name = "once_cell"
19
+ version = "1.21.4"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
22
+
23
+ [[package]]
24
+ name = "portable-atomic"
25
+ version = "1.15.0"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
28
+
29
+ [[package]]
30
+ name = "proc-macro2"
31
+ version = "1.0.107"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
34
+ dependencies = [
35
+ "unicode-ident",
36
+ ]
37
+
38
+ [[package]]
39
+ name = "pyo3"
40
+ version = "0.30.1"
41
+ source = "registry+https://github.com/rust-lang/crates.io-index"
42
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
43
+ dependencies = [
44
+ "libc",
45
+ "once_cell",
46
+ "portable-atomic",
47
+ "pyo3-build-config",
48
+ "pyo3-ffi",
49
+ "pyo3-macros",
50
+ ]
51
+
52
+ [[package]]
53
+ name = "pyo3-build-config"
54
+ version = "0.30.1"
55
+ source = "registry+https://github.com/rust-lang/crates.io-index"
56
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
57
+ dependencies = [
58
+ "target-lexicon",
59
+ ]
60
+
61
+ [[package]]
62
+ name = "pyo3-ffi"
63
+ version = "0.30.1"
64
+ source = "registry+https://github.com/rust-lang/crates.io-index"
65
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
66
+ dependencies = [
67
+ "libc",
68
+ "pyo3-build-config",
69
+ ]
70
+
71
+ [[package]]
72
+ name = "pyo3-macros"
73
+ version = "0.30.1"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
76
+ dependencies = [
77
+ "proc-macro2",
78
+ "pyo3-macros-backend",
79
+ "quote",
80
+ "syn",
81
+ ]
82
+
83
+ [[package]]
84
+ name = "pyo3-macros-backend"
85
+ version = "0.30.1"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
88
+ dependencies = [
89
+ "heck",
90
+ "proc-macro2",
91
+ "quote",
92
+ "syn",
93
+ ]
94
+
95
+ [[package]]
96
+ name = "quote"
97
+ version = "1.0.47"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
100
+ dependencies = [
101
+ "proc-macro2",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "syn"
106
+ version = "3.0.10"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
109
+ dependencies = [
110
+ "proc-macro2",
111
+ "quote",
112
+ "unicode-ident",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "target-lexicon"
117
+ version = "0.13.6"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
120
+
121
+ [[package]]
122
+ name = "trackflow-native"
123
+ version = "0.7.0"
124
+ dependencies = [
125
+ "pyo3",
126
+ ]
127
+
128
+ [[package]]
129
+ name = "unicode-ident"
130
+ version = "1.0.27"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
@@ -0,0 +1,22 @@
1
+ [package]
2
+ name = "trackflow-native"
3
+ version = "0.7.0"
4
+ edition = "2021"
5
+ license = "Apache-2.0"
6
+ description = "Native Rust/PyO3 acceleration kernels for Trackflow."
7
+ publish = false
8
+ readme = "README.md"
9
+
10
+ [lib]
11
+ name = "_native"
12
+ path = "rust/src/lib.rs"
13
+ crate-type = ["cdylib"]
14
+
15
+ [dependencies]
16
+ pyo3 = { version = "0.30", features = ["extension-module", "abi3-py310"] }
17
+
18
+ [profile.release]
19
+ opt-level = 3
20
+ lto = "fat"
21
+ codegen-units = 1
22
+ strip = "symbols"
@@ -1,9 +1,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: trackflow-python-tensorrt
3
+ Version: 0.7.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Intended Audience :: Science/Research
8
+ Classifier: License :: OSI Approved :: Apache Software License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Multimedia :: Video
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Classifier: Topic :: Scientific/Engineering :: Image Recognition
18
+ Requires-Dist: huggingface-hub>=0.24
19
+ Requires-Dist: numpy>=1.26
20
+ Requires-Dist: onnxruntime-gpu[cuda,cudnn]>=1.28
21
+ Requires-Dist: tensorrt-cu13-libs>=10,<11
22
+ Requires-Dist: opencv-python-headless>=4.9
23
+ Requires-Dist: pyarrow>=15.0
24
+ Requires-Dist: rich>=13.7
25
+ Requires-Dist: scipy>=1.11
26
+ Requires-Dist: tokenizers>=0.19
27
+ Requires-Dist: typer>=0.12
28
+ Requires-Dist: pytest>=8.0 ; extra == 'dev'
29
+ Requires-Dist: ruff>=0.6 ; extra == 'dev'
30
+ Requires-Dist: opencv-python>=4.9 ; extra == 'display'
31
+ Requires-Dist: mkdocs-material>=9.6 ; extra == 'docs'
32
+ Requires-Dist: mkdocstrings[python]>=0.29 ; extra == 'docs'
33
+ Requires-Dist: transformers>=5.18,<6 ; extra == 'sam2'
34
+ Requires-Dist: torch>=2.6 ; extra == 'sam2'
35
+ Requires-Dist: torchvision>=0.21 ; extra == 'sam2'
36
+ Requires-Dist: transformers>=5.18,<6 ; extra == 'transformers'
37
+ Requires-Dist: torch>=2.6 ; extra == 'transformers'
38
+ Requires-Dist: torchvision>=0.21 ; extra == 'transformers'
39
+ Requires-Dist: sentence-transformers>=6.1,<7 ; extra == 'transformers'
40
+ Provides-Extra: dev
41
+ Provides-Extra: display
42
+ Provides-Extra: docs
43
+ Provides-Extra: sam2
44
+ Provides-Extra: transformers
45
+ License-File: LICENSE
46
+ Summary: Stream or export multi-object tracks with ONNX and optional Transformers detectors, ByteTrack, BoT-SORT, OC-SORT or BoostTrack, text search, floorplan projection, and anonymization. (NVIDIA TensorRT FP16 build with bundled CUDA 13/cuDNN/TensorRT 10 runtimes.)
47
+ Keywords: object-tracking,people-tracking,multi-object-tracking,mot,bytetrack,botsort,ocsort,boosttrack,rtdetr,rf-detr,d-fine,onnxruntime,computer-vision,video-tracking,re-identification,homography,parquet,webgpu,clip,siglip
48
+ Author: Ouail Bendidi
49
+ License-Expression: Apache-2.0
50
+ Requires-Python: >=3.11
51
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
52
+ Project-URL: Documentation, https://obendidi.github.io/trackflow/docs/
53
+ Project-URL: Homepage, https://obendidi.github.io/trackflow/
54
+ Project-URL: Issues, https://github.com/obendidi/trackflow/issues
55
+ Project-URL: Repository, https://github.com/obendidi/trackflow
56
+
1
57
  # Trackflow
2
58
 
3
59
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/obendidi/trackflow/blob/main/LICENSE)
4
60
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](https://pypi.org/project/trackflow-python/)
5
61
 
6
- Real-time people and object tracking in Python and in the browser. Trackflow runs current detectors (RF-DETR, RT-DETRv2, D-FINE, DEIMv2, YOLO26) with ByteTrack, BoT-SORT, OC-SORT or BoostTrack, streams or exports track data (Parquet, JSONL, CSV, MOTChallenge, HTML), and includes text-based track search, a local run inspector with 4-point floorplan projection, and anonymization.
62
+ Real-time people and object tracking in Python and in the browser. Trackflow runs current detectors (RF-DETR, RT-DETRv2, D-FINE, DEIMv2, YOLO26) with ByteTrack, BoT-SORT, OC-SORT, BoostTrack or NLTrack, streams or exports track data (Parquet, JSONL, CSV, MOTChallenge, HTML), and includes text-based track search, a local run inspector with 4-point floorplan projection, and anonymization.
7
63
 
8
64
  ![Trackflow tracking people crossing Yonge and Dundas in Toronto, with an ID, box and trail on each person](https://raw.githubusercontent.com/obendidi/trackflow/main/docs/demo.webp)
9
65
 
@@ -13,7 +69,7 @@ Real-time people and object tracking in Python and in the browser. Trackflow run
13
69
 
14
70
  *`trackflow inspect` on the same clip: scrubbing with live video frames, jumping to recovery events, searching Track Cards with natural language, and comparing ByteTrack against BoT-SORT.*
15
71
 
16
- Try it in the browser without installing anything: [obendidi.github.io/trackflow](https://obendidi.github.io/trackflow/).
72
+ Try it in the browser without installing anything: [obendidi.github.io/trackflow](https://obendidi.github.io/trackflow/) · Full docs & API reference: [obendidi.github.io/trackflow/docs](https://obendidi.github.io/trackflow/docs/).
17
73
 
18
74
  ## Quickstart
19
75
 
@@ -64,6 +120,33 @@ Measured on an isolated venv (system CUDA/TRT paths stripped, proving zero-confi
64
120
 
65
121
  </details>
66
122
 
123
+ <details>
124
+ <summary>Native Rust core &amp; version speed comparison (bundled by default in CPU, CUDA, and TensorRT wheels)</summary>
125
+
126
+ All three packages (`trackflow-python`, `trackflow-python-cuda`, and `trackflow-python-tensorrt`) bundle the compiled `trackflow._native` Rust extension (`abi3-py310`, zero extra packages or flags required). Cutting host-side preprocessing, DETR postprocessing, Re-ID crop batching, and multi-object tracking from `~6–10 ms/frame` down to `<1–2 ms/frame` keeps the CPU out of the way on CPU/CoreML runs and removes the host bottleneck on high-FPS CUDA and TensorRT GPUs. Set `TRACKFLOW_BACKEND=python` to force the pure-Python reference path, or check the active backend with `trackflow info`.
127
+
128
+ Measured interleaved on Apple M4 Pro (`OMP_NUM_THREADS=4`, 1080p inputs & 1,203 crowded `MOT20-03` frames, no-CMC pure engine time, `0` ID diffs across all 5 trackers):
129
+
130
+ | Component / Tracker | `v0.6.1` *(NumPy/SciPy)* | Pure-Python + OpenCV (`#148`) | **Rust default (`_native`)** | Speedup vs `v0.6.1` | Parity |
131
+ | :--- | ---: | ---: | ---: | ---: | :--- |
132
+ | `detector.preprocess` (`norm=False`, 1080p) | `0.888 ms/f` | `0.414 ms/f` | **`0.308 ms/f`** | **2.9x** | `0.0` diff |
133
+ | `detector.preprocess` (`norm=True`, 1080p) | `3.425 ms/f` | `0.479 ms/f` | **`0.304 ms/f`** | **11.3x** | `4.77e-7` |
134
+ | `ReidEmbedder` crop prep *(16 crops)* | `4.183 ms/f` | `0.960 ms/f` | **`0.587 ms/f`** | **7.1x** | `0.0` diff |
135
+ | `postprocess_detr_outputs` *(300×80)* | `0.197 ms/f` | `0.167 ms/f` | **`0.040 ms/f`** | **4.9x** | `0.0` box diff |
136
+ | `bytetrack` *(MOT20-03, 1,203f)* | `0.911 ms/f` | `0.878 ms/f` | **`0.079 ms/f`** *(12,671 FPS)* | **11.5x** | `0` ID diffs |
137
+ | `botsort` *(MOT20-03, 1,203f)* | `0.872 ms/f` | `0.841 ms/f` | **`0.092 ms/f`** *(10,906 FPS)* | **9.5x** | `0` ID diffs |
138
+ | `botsort + osnet` *(MOT20-03, 1,203f)* | `1.204 ms/f` | `1.201 ms/f` | **`0.151 ms/f`** *(6,626 FPS)* | **8.0x** | `0` ID diffs |
139
+ | `ocsort` *(MOT20-03, 1,203f)* | `0.949 ms/f` | `0.916 ms/f` | **`0.058 ms/f`** *(17,174 FPS)* | **16.3x** | `0` ID diffs |
140
+ | `boosttrack` *(MOT20-03, 1,203f)* | `1.280 ms/f` | `1.218 ms/f` | **`0.093 ms/f`** *(10,750 FPS)* | **13.8x** | `0` ID diffs |
141
+ | `boosttrack + osnet` *(MOT20-03, 1,203f)* | `1.608 ms/f` | `1.466 ms/f` | **`0.181 ms/f`** *(5,529 FPS)* | **8.9x** | `0` ID diffs |
142
+ | `nltrack` *(MOT20-03, 1,203f)* | — | `1.579 ms/f` | **`0.137 ms/f`** *(7,301 FPS)* | **11.5x** *(vs `#148`)* | `0` ID diffs |
143
+ | `nltrack + osnet` *(MOT20-03, 1,203f)* | — | `2.277 ms/f` | **`0.962 ms/f`** *(1,039 FPS)* | **2.4x** *(vs `#148`)* | `0` ID diffs |
144
+ | `postprocess_records` *(68.9k rows)* | — | `982.3 ms` | **`885.8 ms`** | **1.11x** *(vs `#148`)* | bit-exact |
145
+
146
+ Reproduce Python vs. Rust timings on your own CPU/CUDA/TensorRT machine with `uv run python scripts/bench_rust_vs_python.py`.
147
+
148
+ </details>
149
+
67
150
  ## Usage
68
151
 
69
152
  ### Tracking and exports
@@ -96,8 +179,9 @@ GROUP BY track_id ORDER BY frames DESC;
96
179
  | `botsort` | [BoT-SORT](https://arxiv.org/abs/2206.14651) (2022) | ByteTrack plus camera-motion compensation, and appearance matching with `--reid osnet`. |
97
180
  | `ocsort` | [OC-SORT](https://arxiv.org/abs/2203.14360) (CVPR 2023) | Trusts detections over motion predictions: after an occlusion it re-matches a track to its last observed box and corrects the motion model along the gap. |
98
181
  | `boosttrack` | [BoostTrack++](https://arxiv.org/abs/2408.13003) (2024) | Raises the confidence of weak detections that fit a track or look like a new object, and matches with motion, shape and, with `--reid osnet`, appearance. Compensates for camera motion. |
182
+ | `nltrack` | NLTrack *(pure Apache-2.0, zero extra weights)* | Non-linear motion tracker with damped dual-anchor prediction, observation-centric re-update, scene-calibrated clean-bank Re-ID (`--reid osnet`), and guarded lost-track recovery. Highest accuracy across all four benchmarks. |
99
183
 
100
- All four keep a person and a bag in the same box as separate tracks, and only give out an ID once a track has been seen on more than one frame. OC-SORT and BoostTrack report a track again after a miss once it has matched three frames in a row; in between, the annotated video shows it as a coasting box. The browser playground uses ByteTrack.
184
+ All five keep a person and a bag in the same box as separate tracks, and only give out an ID once a track has been seen on more than one frame. OC-SORT and BoostTrack report a track again after a miss once it has matched three frames in a row; in between, the annotated video shows it as a coasting box. The browser playground uses ByteTrack.
101
185
 
102
186
  #### Benchmarks across 4 official datasets (81 videos, ~59,800 frames)
103
187
 
@@ -107,16 +191,28 @@ Every tracker below receives the exact same detections from Trackflow's default
107
191
 
108
192
  | Tracker | DanceTrack (25) | SportsMOT (45) | MOT17 (7) | MOT20 (4) | Mean HOTA | Total ID switches | Tracker FPS | End-to-End FPS |
109
193
  | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
110
- | **`botsort --reid osnet`** | **39.0** | 45.0 | **46.9** | **24.4** | **38.8** | 6,435 | 205 | 5.5 |
111
- | **`ocsort`** *(no Re-ID)* | 37.9 | **46.0** | 46.3 | 23.3 | **38.4** | **5,501** | 203 | 9.2 |
112
- | **`boosttrack`** *(no Re-ID)* | 37.5 | 44.4 | **46.9** | 24.0 | **38.2** | 5,549 | 201 | 9.2 |
113
- | **`botsort`** *(no Re-ID)* | 36.7 | 44.3 | 46.5 | 24.3 | **37.9** | 6,475 | 221 | 9.3 |
194
+ | **`nltrack --reid osnet --postprocess`** *(offline)* | **47.5** | **52.5** | **50.8** | **27.9** | **44.7** | **4,294** | 131 | 5.4\* |
195
+ | **`nltrack --reid osnet`** | 47.1 | 50.2 | 48.1 | 26.1 | **42.9** | 5,193 | 133 | 5.4 |
196
+ | **`botsort --reid osnet --postprocess`** *(offline)* | 42.4 | 50.3 | 49.7 | 25.7 | **42.0** | 4,748 | 198 | 5.5\* |
197
+ | **`nltrack`** *(no Re-ID)* | 39.0 | 45.6 | 47.3 | 26.3 | **39.6** | 6,209 | 143 | 9.0 |
198
+ | **`botsort --reid osnet`** | 39.0 | 45.0 | 46.9 | 24.4 | 38.8 | 6,435 | 205 | 5.5 |
199
+ | **`ocsort`** *(no Re-ID)* | 37.9 | 46.0 | 46.3 | 23.3 | 38.4 | 5,501 | 203 | 9.2 |
200
+ | **`boosttrack`** *(no Re-ID)* | 37.5 | 44.4 | 46.9 | 24.0 | 38.2 | 5,549 | 201 | 9.2 |
201
+ | **`botsort`** *(no Re-ID)* | 36.7 | 44.3 | 46.5 | 24.3 | 37.9 | 6,475 | 221 | 9.3 |
114
202
  | `bytetrack` *(also in browser)* | 33.1 | 39.8 | 45.1 | 23.5 | 35.4 | 7,038 | **2,900** | **9.7** |
115
203
  | *Roboflow `cbiou` (`0.45/0.50`)* | 36.0 | 43.4 | 46.4 | 24.2 | 37.5 | 7,533 | 2,072 | 9.6 |
116
204
  | *Roboflow `botsort` (`0.45/0.50`)* | 35.9 | 43.6 | 46.3 | 24.0 | 37.4 | 6,922 | 194 | 9.2 |
117
205
  | *Roboflow `ocsort+cmc` (`0.45`)* | 33.4 | 43.8 | 44.2 | 15.9 | 34.3 | 8,057 | 196 | 9.2 |
118
206
  | *Roboflow `botsort` (defaults `0.60/0.70`)* | 39.6 | 50.0 | 42.6 | 13.6 | 36.4 | 4,349 | 207 | 9.2 |
119
207
 
208
+ #### Offline post-processing (`--postprocess`)
209
+
210
+ ```bash
211
+ trackflow run game.mp4 --tracker botsort --reid osnet --postprocess
212
+ ```
213
+
214
+ For recorded video files and image folders, `--postprocess` runs a pure NumPy/SciPy pass after tracking finishes: it splits high-confidence mid-track swaps, stitches broken tracklets globally with camera-motion-compensated kinematics and sequence-calibrated OSNet similarity, fills short supported occlusion gaps, and smooths box jitter on steady tracks. Across all 81 validation videos, it improves every dataset and tracker (`+3.2` mean HOTA and `-1,687` ID switches vs the online table row on `botsort --reid osnet`; `+0.7` to `+1.1` without Re-ID) in `~64–265 ms/video` (max `397 ms`). It is opt-in, rejects live camera/RTSP streams, buffers track records and float16 Re-ID embeddings in memory (`~1 KB/observation` when `--reid osnet` is active — split multi-hour crowded clips or omit `--reid` if RAM is tight), and leaves `stream()` and browser ByteTrack untouched. \*Table End-to-End FPS (`5.5`) measures detection + tracking + postprocess (`--no-video`); saving `annotated.mp4` adds a second decode/render pass. Benchmarks used `frame_stride=1` on 14–30 fps footage; time horizons are expressed in seconds and frame stride. Combine with `--reid-merge` to also link long cross-exit re-entries in the same offline pass.
215
+
120
216
  **How to read this chart and table:**
121
217
  - **HOTA (0–100, higher is better)**: Overall tracking accuracy. It combines two halves equally: finding the right people in each frame and keeping the same ID on each person as they move and cross paths.
122
218
  - **ID switches (lower is better)**: How many times a tracker accidentally swaps or resets a person's ID mid-video.
@@ -240,15 +336,20 @@ trackflow run crowd.mp4 -m rfdetr-large
240
336
  trackflow run crowd.mp4 -m hf:PekingU/rtdetr_v2_r50vd --device mps
241
337
  ```
242
338
 
243
- Re-ID and text-search models:
339
+ Re-ID, text-search, and optional mask fallback models:
244
340
 
245
341
  | Flag | Model | Size | License | Used for |
246
342
  | :--- | :--- | ---: | :--- | :--- |
247
- | `--reid osnet` | OSNet-AIN x1.0 person Re-ID | ~9 MB | MIT code; weights trained on MSMT17 (check dataset terms for commercial use) | BoT-SORT and BoostTrack appearance, and `--reid-merge` |
343
+ | `--reid osnet` | OSNet-AIN x1.0 person Re-ID | ~9 MB | MIT code; weights trained on MSMT17 (check dataset terms for commercial use) | BoT-SORT, BoostTrack, and NLTrack appearance, and `--reid-merge` |
248
344
  | `--vlm clip` | CLIP ViT-B/32 (INT8) | ~153 MB | MIT | Default for `--query` and `search` |
249
345
  | `--vlm siglip` | SigLIP Base (INT8) | ~205 MB | Apache-2.0 | Better on fine clothing/attribute queries |
250
346
  | `--vlm siglip2` | SigLIP 2 Base (INT8) | ~378 MB | Apache-2.0 | Strongest pure-ONNX search (no PyTorch) |
251
347
  | `--vlm embeddinggemma` | EmbeddingGemma 2 (PyTorch, needs `[transformers]`) | ~1.5 GB | Apache-2.0 | Best on clothing and accessory queries |
348
+ | `--mask-fallback sam2.1-tiny` | SAM 2.1 Hiera-Tiny (needs `[sam2]`) | ~156 MB | Apache-2.0 | Default selective occlusion mask fallback |
349
+ | `--mask-fallback edgetam` | EdgeTAM (needs `[sam2]`) | ~56 MB | Apache-2.0 | Fastest / lowest-VRAM selective mask fallback |
350
+ | `--mask-fallback sam2.1-small` | SAM 2.1 Hiera-Small (needs `[sam2]`) | ~184 MB | Apache-2.0 | Optional SAM 2.1 Small mask fallback |
351
+ | `--mask-fallback sam2.1-base-plus` | SAM 2.1 Hiera-Base+ (needs `[sam2]`) | ~324 MB | Apache-2.0 | Higher-capacity SAM 2.1 Base+ mask fallback |
352
+ | `--mask-fallback sam2.1-large` | SAM 2.1 Hiera-Large (needs `[sam2]`) | ~898 MB | Apache-2.0 | Largest SAM 2.1 mask fallback for GPU |
252
353
 
253
354
  ## Python API
254
355
 
@@ -317,3 +418,4 @@ What changed in each version is in [CHANGELOG.md](https://github.com/obendidi/tr
317
418
  Apache-2.0 — see [LICENSE](https://github.com/obendidi/trackflow/blob/main/LICENSE). Model weights are downloaded separately and keep their own licenses (see [Models](#models)).
318
419
 
319
420
  The original 2017 `Tracking-with-darkflow` codebase (YOLOv2 + DeepSORT + TensorFlow 1.0) is kept on the [`legacy-2017`](https://github.com/obendidi/trackflow/tree/legacy-2017) branch and [`v1.0-legacy-2017`](https://github.com/obendidi/trackflow/releases/tag/v1.0-legacy-2017) tag under GPL-3.0.
421
+
@@ -1,57 +1,9 @@
1
- Metadata-Version: 2.5
2
- Name: trackflow-python-tensorrt
3
- Version: 0.6.1
4
- Summary: Stream or export multi-object tracks with ONNX and optional Transformers detectors, ByteTrack, BoT-SORT, OC-SORT or BoostTrack, text search, floorplan projection, and anonymization. (NVIDIA TensorRT FP16 build with bundled CUDA 13/cuDNN/TensorRT 10 runtimes.)
5
- Project-URL: Homepage, https://obendidi.github.io/trackflow/
6
- Project-URL: Repository, https://github.com/obendidi/trackflow
7
- Project-URL: Issues, https://github.com/obendidi/trackflow/issues
8
- Author: Ouail Bendidi
9
- License-Expression: Apache-2.0
10
- License-File: LICENSE
11
- Keywords: boosttrack,botsort,bytetrack,clip,computer-vision,d-fine,homography,mot,multi-object-tracking,object-tracking,ocsort,onnxruntime,parquet,people-tracking,re-identification,rf-detr,rtdetr,siglip,video-tracking,webgpu
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Environment :: Console
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Intended Audience :: Science/Research
16
- Classifier: License :: OSI Approved :: Apache Software License
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Topic :: Multimedia :: Video
24
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
- Classifier: Topic :: Scientific/Engineering :: Image Recognition
26
- Requires-Python: >=3.11
27
- Requires-Dist: huggingface-hub>=0.24
28
- Requires-Dist: numpy>=1.26
29
- Requires-Dist: onnxruntime-gpu[cuda,cudnn]>=1.28
30
- Requires-Dist: opencv-python-headless>=4.9
31
- Requires-Dist: pyarrow>=15.0
32
- Requires-Dist: rich>=13.7
33
- Requires-Dist: scipy>=1.11
34
- Requires-Dist: tensorrt-cu13-libs<11,>=10
35
- Requires-Dist: tokenizers>=0.19
36
- Requires-Dist: typer>=0.12
37
- Provides-Extra: dev
38
- Requires-Dist: pytest>=8.0; extra == 'dev'
39
- Requires-Dist: ruff>=0.6; extra == 'dev'
40
- Provides-Extra: display
41
- Requires-Dist: opencv-python>=4.9; extra == 'display'
42
- Provides-Extra: transformers
43
- Requires-Dist: sentence-transformers<7,>=6.1; extra == 'transformers'
44
- Requires-Dist: torch>=2.6; extra == 'transformers'
45
- Requires-Dist: torchvision>=0.21; extra == 'transformers'
46
- Requires-Dist: transformers<6,>=5.18; extra == 'transformers'
47
- Description-Content-Type: text/markdown
48
-
49
1
  # Trackflow
50
2
 
51
3
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/obendidi/trackflow/blob/main/LICENSE)
52
4
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](https://pypi.org/project/trackflow-python/)
53
5
 
54
- Real-time people and object tracking in Python and in the browser. Trackflow runs current detectors (RF-DETR, RT-DETRv2, D-FINE, DEIMv2, YOLO26) with ByteTrack, BoT-SORT, OC-SORT or BoostTrack, streams or exports track data (Parquet, JSONL, CSV, MOTChallenge, HTML), and includes text-based track search, a local run inspector with 4-point floorplan projection, and anonymization.
6
+ Real-time people and object tracking in Python and in the browser. Trackflow runs current detectors (RF-DETR, RT-DETRv2, D-FINE, DEIMv2, YOLO26) with ByteTrack, BoT-SORT, OC-SORT, BoostTrack or NLTrack, streams or exports track data (Parquet, JSONL, CSV, MOTChallenge, HTML), and includes text-based track search, a local run inspector with 4-point floorplan projection, and anonymization.
55
7
 
56
8
  ![Trackflow tracking people crossing Yonge and Dundas in Toronto, with an ID, box and trail on each person](https://raw.githubusercontent.com/obendidi/trackflow/main/docs/demo.webp)
57
9
 
@@ -61,7 +13,7 @@ Real-time people and object tracking in Python and in the browser. Trackflow run
61
13
 
62
14
  *`trackflow inspect` on the same clip: scrubbing with live video frames, jumping to recovery events, searching Track Cards with natural language, and comparing ByteTrack against BoT-SORT.*
63
15
 
64
- Try it in the browser without installing anything: [obendidi.github.io/trackflow](https://obendidi.github.io/trackflow/).
16
+ Try it in the browser without installing anything: [obendidi.github.io/trackflow](https://obendidi.github.io/trackflow/) · Full docs & API reference: [obendidi.github.io/trackflow/docs](https://obendidi.github.io/trackflow/docs/).
65
17
 
66
18
  ## Quickstart
67
19
 
@@ -112,6 +64,33 @@ Measured on an isolated venv (system CUDA/TRT paths stripped, proving zero-confi
112
64
 
113
65
  </details>
114
66
 
67
+ <details>
68
+ <summary>Native Rust core &amp; version speed comparison (bundled by default in CPU, CUDA, and TensorRT wheels)</summary>
69
+
70
+ All three packages (`trackflow-python`, `trackflow-python-cuda`, and `trackflow-python-tensorrt`) bundle the compiled `trackflow._native` Rust extension (`abi3-py310`, zero extra packages or flags required). Cutting host-side preprocessing, DETR postprocessing, Re-ID crop batching, and multi-object tracking from `~6–10 ms/frame` down to `<1–2 ms/frame` keeps the CPU out of the way on CPU/CoreML runs and removes the host bottleneck on high-FPS CUDA and TensorRT GPUs. Set `TRACKFLOW_BACKEND=python` to force the pure-Python reference path, or check the active backend with `trackflow info`.
71
+
72
+ Measured interleaved on Apple M4 Pro (`OMP_NUM_THREADS=4`, 1080p inputs & 1,203 crowded `MOT20-03` frames, no-CMC pure engine time, `0` ID diffs across all 5 trackers):
73
+
74
+ | Component / Tracker | `v0.6.1` *(NumPy/SciPy)* | Pure-Python + OpenCV (`#148`) | **Rust default (`_native`)** | Speedup vs `v0.6.1` | Parity |
75
+ | :--- | ---: | ---: | ---: | ---: | :--- |
76
+ | `detector.preprocess` (`norm=False`, 1080p) | `0.888 ms/f` | `0.414 ms/f` | **`0.308 ms/f`** | **2.9x** | `0.0` diff |
77
+ | `detector.preprocess` (`norm=True`, 1080p) | `3.425 ms/f` | `0.479 ms/f` | **`0.304 ms/f`** | **11.3x** | `4.77e-7` |
78
+ | `ReidEmbedder` crop prep *(16 crops)* | `4.183 ms/f` | `0.960 ms/f` | **`0.587 ms/f`** | **7.1x** | `0.0` diff |
79
+ | `postprocess_detr_outputs` *(300×80)* | `0.197 ms/f` | `0.167 ms/f` | **`0.040 ms/f`** | **4.9x** | `0.0` box diff |
80
+ | `bytetrack` *(MOT20-03, 1,203f)* | `0.911 ms/f` | `0.878 ms/f` | **`0.079 ms/f`** *(12,671 FPS)* | **11.5x** | `0` ID diffs |
81
+ | `botsort` *(MOT20-03, 1,203f)* | `0.872 ms/f` | `0.841 ms/f` | **`0.092 ms/f`** *(10,906 FPS)* | **9.5x** | `0` ID diffs |
82
+ | `botsort + osnet` *(MOT20-03, 1,203f)* | `1.204 ms/f` | `1.201 ms/f` | **`0.151 ms/f`** *(6,626 FPS)* | **8.0x** | `0` ID diffs |
83
+ | `ocsort` *(MOT20-03, 1,203f)* | `0.949 ms/f` | `0.916 ms/f` | **`0.058 ms/f`** *(17,174 FPS)* | **16.3x** | `0` ID diffs |
84
+ | `boosttrack` *(MOT20-03, 1,203f)* | `1.280 ms/f` | `1.218 ms/f` | **`0.093 ms/f`** *(10,750 FPS)* | **13.8x** | `0` ID diffs |
85
+ | `boosttrack + osnet` *(MOT20-03, 1,203f)* | `1.608 ms/f` | `1.466 ms/f` | **`0.181 ms/f`** *(5,529 FPS)* | **8.9x** | `0` ID diffs |
86
+ | `nltrack` *(MOT20-03, 1,203f)* | — | `1.579 ms/f` | **`0.137 ms/f`** *(7,301 FPS)* | **11.5x** *(vs `#148`)* | `0` ID diffs |
87
+ | `nltrack + osnet` *(MOT20-03, 1,203f)* | — | `2.277 ms/f` | **`0.962 ms/f`** *(1,039 FPS)* | **2.4x** *(vs `#148`)* | `0` ID diffs |
88
+ | `postprocess_records` *(68.9k rows)* | — | `982.3 ms` | **`885.8 ms`** | **1.11x** *(vs `#148`)* | bit-exact |
89
+
90
+ Reproduce Python vs. Rust timings on your own CPU/CUDA/TensorRT machine with `uv run python scripts/bench_rust_vs_python.py`.
91
+
92
+ </details>
93
+
115
94
  ## Usage
116
95
 
117
96
  ### Tracking and exports
@@ -144,8 +123,9 @@ GROUP BY track_id ORDER BY frames DESC;
144
123
  | `botsort` | [BoT-SORT](https://arxiv.org/abs/2206.14651) (2022) | ByteTrack plus camera-motion compensation, and appearance matching with `--reid osnet`. |
145
124
  | `ocsort` | [OC-SORT](https://arxiv.org/abs/2203.14360) (CVPR 2023) | Trusts detections over motion predictions: after an occlusion it re-matches a track to its last observed box and corrects the motion model along the gap. |
146
125
  | `boosttrack` | [BoostTrack++](https://arxiv.org/abs/2408.13003) (2024) | Raises the confidence of weak detections that fit a track or look like a new object, and matches with motion, shape and, with `--reid osnet`, appearance. Compensates for camera motion. |
126
+ | `nltrack` | NLTrack *(pure Apache-2.0, zero extra weights)* | Non-linear motion tracker with damped dual-anchor prediction, observation-centric re-update, scene-calibrated clean-bank Re-ID (`--reid osnet`), and guarded lost-track recovery. Highest accuracy across all four benchmarks. |
147
127
 
148
- All four keep a person and a bag in the same box as separate tracks, and only give out an ID once a track has been seen on more than one frame. OC-SORT and BoostTrack report a track again after a miss once it has matched three frames in a row; in between, the annotated video shows it as a coasting box. The browser playground uses ByteTrack.
128
+ All five keep a person and a bag in the same box as separate tracks, and only give out an ID once a track has been seen on more than one frame. OC-SORT and BoostTrack report a track again after a miss once it has matched three frames in a row; in between, the annotated video shows it as a coasting box. The browser playground uses ByteTrack.
149
129
 
150
130
  #### Benchmarks across 4 official datasets (81 videos, ~59,800 frames)
151
131
 
@@ -155,16 +135,28 @@ Every tracker below receives the exact same detections from Trackflow's default
155
135
 
156
136
  | Tracker | DanceTrack (25) | SportsMOT (45) | MOT17 (7) | MOT20 (4) | Mean HOTA | Total ID switches | Tracker FPS | End-to-End FPS |
157
137
  | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
158
- | **`botsort --reid osnet`** | **39.0** | 45.0 | **46.9** | **24.4** | **38.8** | 6,435 | 205 | 5.5 |
159
- | **`ocsort`** *(no Re-ID)* | 37.9 | **46.0** | 46.3 | 23.3 | **38.4** | **5,501** | 203 | 9.2 |
160
- | **`boosttrack`** *(no Re-ID)* | 37.5 | 44.4 | **46.9** | 24.0 | **38.2** | 5,549 | 201 | 9.2 |
161
- | **`botsort`** *(no Re-ID)* | 36.7 | 44.3 | 46.5 | 24.3 | **37.9** | 6,475 | 221 | 9.3 |
138
+ | **`nltrack --reid osnet --postprocess`** *(offline)* | **47.5** | **52.5** | **50.8** | **27.9** | **44.7** | **4,294** | 131 | 5.4\* |
139
+ | **`nltrack --reid osnet`** | 47.1 | 50.2 | 48.1 | 26.1 | **42.9** | 5,193 | 133 | 5.4 |
140
+ | **`botsort --reid osnet --postprocess`** *(offline)* | 42.4 | 50.3 | 49.7 | 25.7 | **42.0** | 4,748 | 198 | 5.5\* |
141
+ | **`nltrack`** *(no Re-ID)* | 39.0 | 45.6 | 47.3 | 26.3 | **39.6** | 6,209 | 143 | 9.0 |
142
+ | **`botsort --reid osnet`** | 39.0 | 45.0 | 46.9 | 24.4 | 38.8 | 6,435 | 205 | 5.5 |
143
+ | **`ocsort`** *(no Re-ID)* | 37.9 | 46.0 | 46.3 | 23.3 | 38.4 | 5,501 | 203 | 9.2 |
144
+ | **`boosttrack`** *(no Re-ID)* | 37.5 | 44.4 | 46.9 | 24.0 | 38.2 | 5,549 | 201 | 9.2 |
145
+ | **`botsort`** *(no Re-ID)* | 36.7 | 44.3 | 46.5 | 24.3 | 37.9 | 6,475 | 221 | 9.3 |
162
146
  | `bytetrack` *(also in browser)* | 33.1 | 39.8 | 45.1 | 23.5 | 35.4 | 7,038 | **2,900** | **9.7** |
163
147
  | *Roboflow `cbiou` (`0.45/0.50`)* | 36.0 | 43.4 | 46.4 | 24.2 | 37.5 | 7,533 | 2,072 | 9.6 |
164
148
  | *Roboflow `botsort` (`0.45/0.50`)* | 35.9 | 43.6 | 46.3 | 24.0 | 37.4 | 6,922 | 194 | 9.2 |
165
149
  | *Roboflow `ocsort+cmc` (`0.45`)* | 33.4 | 43.8 | 44.2 | 15.9 | 34.3 | 8,057 | 196 | 9.2 |
166
150
  | *Roboflow `botsort` (defaults `0.60/0.70`)* | 39.6 | 50.0 | 42.6 | 13.6 | 36.4 | 4,349 | 207 | 9.2 |
167
151
 
152
+ #### Offline post-processing (`--postprocess`)
153
+
154
+ ```bash
155
+ trackflow run game.mp4 --tracker botsort --reid osnet --postprocess
156
+ ```
157
+
158
+ For recorded video files and image folders, `--postprocess` runs a pure NumPy/SciPy pass after tracking finishes: it splits high-confidence mid-track swaps, stitches broken tracklets globally with camera-motion-compensated kinematics and sequence-calibrated OSNet similarity, fills short supported occlusion gaps, and smooths box jitter on steady tracks. Across all 81 validation videos, it improves every dataset and tracker (`+3.2` mean HOTA and `-1,687` ID switches vs the online table row on `botsort --reid osnet`; `+0.7` to `+1.1` without Re-ID) in `~64–265 ms/video` (max `397 ms`). It is opt-in, rejects live camera/RTSP streams, buffers track records and float16 Re-ID embeddings in memory (`~1 KB/observation` when `--reid osnet` is active — split multi-hour crowded clips or omit `--reid` if RAM is tight), and leaves `stream()` and browser ByteTrack untouched. \*Table End-to-End FPS (`5.5`) measures detection + tracking + postprocess (`--no-video`); saving `annotated.mp4` adds a second decode/render pass. Benchmarks used `frame_stride=1` on 14–30 fps footage; time horizons are expressed in seconds and frame stride. Combine with `--reid-merge` to also link long cross-exit re-entries in the same offline pass.
159
+
168
160
  **How to read this chart and table:**
169
161
  - **HOTA (0–100, higher is better)**: Overall tracking accuracy. It combines two halves equally: finding the right people in each frame and keeping the same ID on each person as they move and cross paths.
170
162
  - **ID switches (lower is better)**: How many times a tracker accidentally swaps or resets a person's ID mid-video.
@@ -288,15 +280,20 @@ trackflow run crowd.mp4 -m rfdetr-large
288
280
  trackflow run crowd.mp4 -m hf:PekingU/rtdetr_v2_r50vd --device mps
289
281
  ```
290
282
 
291
- Re-ID and text-search models:
283
+ Re-ID, text-search, and optional mask fallback models:
292
284
 
293
285
  | Flag | Model | Size | License | Used for |
294
286
  | :--- | :--- | ---: | :--- | :--- |
295
- | `--reid osnet` | OSNet-AIN x1.0 person Re-ID | ~9 MB | MIT code; weights trained on MSMT17 (check dataset terms for commercial use) | BoT-SORT and BoostTrack appearance, and `--reid-merge` |
287
+ | `--reid osnet` | OSNet-AIN x1.0 person Re-ID | ~9 MB | MIT code; weights trained on MSMT17 (check dataset terms for commercial use) | BoT-SORT, BoostTrack, and NLTrack appearance, and `--reid-merge` |
296
288
  | `--vlm clip` | CLIP ViT-B/32 (INT8) | ~153 MB | MIT | Default for `--query` and `search` |
297
289
  | `--vlm siglip` | SigLIP Base (INT8) | ~205 MB | Apache-2.0 | Better on fine clothing/attribute queries |
298
290
  | `--vlm siglip2` | SigLIP 2 Base (INT8) | ~378 MB | Apache-2.0 | Strongest pure-ONNX search (no PyTorch) |
299
291
  | `--vlm embeddinggemma` | EmbeddingGemma 2 (PyTorch, needs `[transformers]`) | ~1.5 GB | Apache-2.0 | Best on clothing and accessory queries |
292
+ | `--mask-fallback sam2.1-tiny` | SAM 2.1 Hiera-Tiny (needs `[sam2]`) | ~156 MB | Apache-2.0 | Default selective occlusion mask fallback |
293
+ | `--mask-fallback edgetam` | EdgeTAM (needs `[sam2]`) | ~56 MB | Apache-2.0 | Fastest / lowest-VRAM selective mask fallback |
294
+ | `--mask-fallback sam2.1-small` | SAM 2.1 Hiera-Small (needs `[sam2]`) | ~184 MB | Apache-2.0 | Optional SAM 2.1 Small mask fallback |
295
+ | `--mask-fallback sam2.1-base-plus` | SAM 2.1 Hiera-Base+ (needs `[sam2]`) | ~324 MB | Apache-2.0 | Higher-capacity SAM 2.1 Base+ mask fallback |
296
+ | `--mask-fallback sam2.1-large` | SAM 2.1 Hiera-Large (needs `[sam2]`) | ~898 MB | Apache-2.0 | Largest SAM 2.1 mask fallback for GPU |
300
297
 
301
298
  ## Python API
302
299
 
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["hatchling>=1.25"]
3
- build-backend = "hatchling.build"
2
+ requires = ["maturin>=1.7,<2.0"]
3
+ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "trackflow-python-tensorrt"
7
- version = "0.6.1"
7
+ version = "0.7.0"
8
8
  description = "Stream or export multi-object tracks with ONNX and optional Transformers detectors, ByteTrack, BoT-SORT, OC-SORT or BoostTrack, text search, floorplan projection, and anonymization. (NVIDIA TensorRT FP16 build with bundled CUDA 13/cuDNN/TensorRT 10 runtimes.)"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -71,6 +71,11 @@ transformers = [
71
71
  "torchvision>=0.21",
72
72
  "sentence-transformers>=6.1,<7",
73
73
  ]
74
+ sam2 = [
75
+ "transformers>=5.18,<6",
76
+ "torch>=2.6",
77
+ "torchvision>=0.21",
78
+ ]
74
79
  display = [
75
80
  "opencv-python>=4.9",
76
81
  ]
@@ -78,6 +83,10 @@ dev = [
78
83
  "pytest>=8.0",
79
84
  "ruff>=0.6",
80
85
  ]
86
+ docs = [
87
+ "mkdocs-material>=9.6",
88
+ "mkdocstrings[python]>=0.29",
89
+ ]
81
90
 
82
91
  [project.scripts]
83
92
  trackflow = "trackflow.cli:app"
@@ -85,11 +94,16 @@ trackflow-python-tensorrt = "trackflow.cli:app_tensorrt"
85
94
 
86
95
  [project.urls]
87
96
  Homepage = "https://obendidi.github.io/trackflow/"
97
+ Documentation = "https://obendidi.github.io/trackflow/docs/"
88
98
  Repository = "https://github.com/obendidi/trackflow"
89
99
  Issues = "https://github.com/obendidi/trackflow/issues"
90
100
 
91
- [tool.hatch.build.targets.wheel]
92
- packages = ["src/trackflow"]
101
+ [tool.maturin]
102
+ python-source = "src"
103
+ module-name = "trackflow._native"
104
+ features = ["pyo3/extension-module"]
105
+ strip = true
106
+ include = ["LICENSE", "README.md", "Cargo.lock"]
93
107
 
94
108
  [tool.ruff]
95
109
  target-version = "py310"