trackflow-python-cuda 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_cuda-0.7.0/Cargo.lock +132 -0
  2. trackflow_python_cuda-0.7.0/Cargo.toml +22 -0
  3. trackflow_python_cuda-0.6.1/README.md → trackflow_python_cuda-0.7.0/PKG-INFO +110 -9
  4. trackflow_python_cuda-0.6.1/PKG-INFO → trackflow_python_cuda-0.7.0/README.md +54 -56
  5. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/pyproject.toml +19 -5
  6. trackflow_python_cuda-0.7.0/rust/src/detr.rs +369 -0
  7. trackflow_python_cuda-0.7.0/rust/src/image.rs +192 -0
  8. trackflow_python_cuda-0.7.0/rust/src/interop.rs +217 -0
  9. trackflow_python_cuda-0.7.0/rust/src/iou.rs +307 -0
  10. trackflow_python_cuda-0.7.0/rust/src/kalman.rs +705 -0
  11. trackflow_python_cuda-0.7.0/rust/src/lap.rs +265 -0
  12. trackflow_python_cuda-0.7.0/rust/src/lib.rs +31 -0
  13. trackflow_python_cuda-0.7.0/rust/src/nltrack.rs +1672 -0
  14. trackflow_python_cuda-0.7.0/rust/src/postproc.rs +175 -0
  15. trackflow_python_cuda-0.7.0/rust/src/trackers.rs +2103 -0
  16. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/__init__.py +33 -2
  17. trackflow_python_cuda-0.7.0/src/trackflow/_accel.py +36 -0
  18. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/boosttrack.py +36 -0
  19. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/cli.py +79 -5
  20. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/detector.py +75 -13
  21. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/lines.py +5 -0
  22. trackflow_python_cuda-0.7.0/src/trackflow/mask_fallback.py +1025 -0
  23. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/models.py +70 -0
  24. trackflow_python_cuda-0.7.0/src/trackflow/nltrack.py +1107 -0
  25. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/ocsort.py +38 -0
  26. trackflow_python_cuda-0.7.0/src/trackflow/pipeline.py +1473 -0
  27. trackflow_python_cuda-0.7.0/src/trackflow/postprocess.py +2068 -0
  28. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/privacy.py +122 -23
  29. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/reid.py +178 -12
  30. trackflow_python_cuda-0.7.0/src/trackflow/sam2_adapter.py +222 -0
  31. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/tracker.py +124 -12
  32. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/types.py +7 -1
  33. trackflow_python_cuda-0.6.1/src/trackflow/pipeline.py +0 -910
  34. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/LICENSE +0 -0
  35. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/benchmark.py +0 -0
  36. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/homography.py +0 -0
  37. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/inspector.py +0 -0
  38. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/inspector_ui.html +0 -0
  39. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-0.7.0}/src/trackflow/py.typed +0 -0
  40. {trackflow_python_cuda-0.6.1 → trackflow_python_cuda-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,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: trackflow-python-cuda
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.22
21
+ Requires-Dist: opencv-python-headless>=4.9
22
+ Requires-Dist: pyarrow>=15.0
23
+ Requires-Dist: rich>=13.7
24
+ Requires-Dist: scipy>=1.11
25
+ Requires-Dist: tokenizers>=0.19
26
+ Requires-Dist: typer>=0.12
27
+ Requires-Dist: pytest>=8.0 ; extra == 'dev'
28
+ Requires-Dist: ruff>=0.6 ; extra == 'dev'
29
+ Requires-Dist: opencv-python>=4.9 ; extra == 'display'
30
+ Requires-Dist: mkdocs-material>=9.6 ; extra == 'docs'
31
+ Requires-Dist: mkdocstrings[python]>=0.29 ; extra == 'docs'
32
+ Requires-Dist: transformers>=5.18,<6 ; extra == 'sam2'
33
+ Requires-Dist: torch>=2.6 ; extra == 'sam2'
34
+ Requires-Dist: torchvision>=0.21 ; extra == 'sam2'
35
+ Requires-Dist: transformers>=5.18,<6 ; extra == 'transformers'
36
+ Requires-Dist: torch>=2.6 ; extra == 'transformers'
37
+ Requires-Dist: torchvision>=0.21 ; extra == 'transformers'
38
+ Requires-Dist: sentence-transformers>=6.1,<7 ; extra == 'transformers'
39
+ Provides-Extra: dev
40
+ Provides-Extra: display
41
+ Provides-Extra: docs
42
+ Provides-Extra: sam2
43
+ Provides-Extra: transformers
44
+ License-File: LICENSE
45
+ 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 CUDA build with bundled CUDA/cuDNN runtimes.)
46
+ 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
47
+ Author: Ouail Bendidi
48
+ License-Expression: Apache-2.0
49
+ Requires-Python: >=3.10
50
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
51
+ Project-URL: Documentation, https://obendidi.github.io/trackflow/docs/
52
+ Project-URL: Homepage, https://obendidi.github.io/trackflow/
53
+ Project-URL: Issues, https://github.com/obendidi/trackflow/issues
54
+ Project-URL: Repository, https://github.com/obendidi/trackflow
55
+
1
56
  # Trackflow
2
57
 
3
58
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/obendidi/trackflow/blob/main/LICENSE)
4
59
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](https://pypi.org/project/trackflow-python/)
5
60
 
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.
61
+ 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
62
 
8
63
  ![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
64
 
@@ -13,7 +68,7 @@ Real-time people and object tracking in Python and in the browser. Trackflow run
13
68
 
14
69
  *`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
70
 
16
- Try it in the browser without installing anything: [obendidi.github.io/trackflow](https://obendidi.github.io/trackflow/).
71
+ 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
72
 
18
73
  ## Quickstart
19
74
 
@@ -64,6 +119,33 @@ Measured on an isolated venv (system CUDA/TRT paths stripped, proving zero-confi
64
119
 
65
120
  </details>
66
121
 
122
+ <details>
123
+ <summary>Native Rust core &amp; version speed comparison (bundled by default in CPU, CUDA, and TensorRT wheels)</summary>
124
+
125
+ 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`.
126
+
127
+ 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):
128
+
129
+ | Component / Tracker | `v0.6.1` *(NumPy/SciPy)* | Pure-Python + OpenCV (`#148`) | **Rust default (`_native`)** | Speedup vs `v0.6.1` | Parity |
130
+ | :--- | ---: | ---: | ---: | ---: | :--- |
131
+ | `detector.preprocess` (`norm=False`, 1080p) | `0.888 ms/f` | `0.414 ms/f` | **`0.308 ms/f`** | **2.9x** | `0.0` diff |
132
+ | `detector.preprocess` (`norm=True`, 1080p) | `3.425 ms/f` | `0.479 ms/f` | **`0.304 ms/f`** | **11.3x** | `4.77e-7` |
133
+ | `ReidEmbedder` crop prep *(16 crops)* | `4.183 ms/f` | `0.960 ms/f` | **`0.587 ms/f`** | **7.1x** | `0.0` diff |
134
+ | `postprocess_detr_outputs` *(300×80)* | `0.197 ms/f` | `0.167 ms/f` | **`0.040 ms/f`** | **4.9x** | `0.0` box diff |
135
+ | `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 |
136
+ | `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 |
137
+ | `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 |
138
+ | `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 |
139
+ | `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 |
140
+ | `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 |
141
+ | `nltrack` *(MOT20-03, 1,203f)* | — | `1.579 ms/f` | **`0.137 ms/f`** *(7,301 FPS)* | **11.5x** *(vs `#148`)* | `0` ID diffs |
142
+ | `nltrack + osnet` *(MOT20-03, 1,203f)* | — | `2.277 ms/f` | **`0.962 ms/f`** *(1,039 FPS)* | **2.4x** *(vs `#148`)* | `0` ID diffs |
143
+ | `postprocess_records` *(68.9k rows)* | — | `982.3 ms` | **`885.8 ms`** | **1.11x** *(vs `#148`)* | bit-exact |
144
+
145
+ Reproduce Python vs. Rust timings on your own CPU/CUDA/TensorRT machine with `uv run python scripts/bench_rust_vs_python.py`.
146
+
147
+ </details>
148
+
67
149
  ## Usage
68
150
 
69
151
  ### Tracking and exports
@@ -96,8 +178,9 @@ GROUP BY track_id ORDER BY frames DESC;
96
178
  | `botsort` | [BoT-SORT](https://arxiv.org/abs/2206.14651) (2022) | ByteTrack plus camera-motion compensation, and appearance matching with `--reid osnet`. |
97
179
  | `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
180
  | `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. |
181
+ | `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
182
 
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.
183
+ 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
184
 
102
185
  #### Benchmarks across 4 official datasets (81 videos, ~59,800 frames)
103
186
 
@@ -107,16 +190,28 @@ Every tracker below receives the exact same detections from Trackflow's default
107
190
 
108
191
  | Tracker | DanceTrack (25) | SportsMOT (45) | MOT17 (7) | MOT20 (4) | Mean HOTA | Total ID switches | Tracker FPS | End-to-End FPS |
109
192
  | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
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 |
193
+ | **`nltrack --reid osnet --postprocess`** *(offline)* | **47.5** | **52.5** | **50.8** | **27.9** | **44.7** | **4,294** | 131 | 5.4\* |
194
+ | **`nltrack --reid osnet`** | 47.1 | 50.2 | 48.1 | 26.1 | **42.9** | 5,193 | 133 | 5.4 |
195
+ | **`botsort --reid osnet --postprocess`** *(offline)* | 42.4 | 50.3 | 49.7 | 25.7 | **42.0** | 4,748 | 198 | 5.5\* |
196
+ | **`nltrack`** *(no Re-ID)* | 39.0 | 45.6 | 47.3 | 26.3 | **39.6** | 6,209 | 143 | 9.0 |
197
+ | **`botsort --reid osnet`** | 39.0 | 45.0 | 46.9 | 24.4 | 38.8 | 6,435 | 205 | 5.5 |
198
+ | **`ocsort`** *(no Re-ID)* | 37.9 | 46.0 | 46.3 | 23.3 | 38.4 | 5,501 | 203 | 9.2 |
199
+ | **`boosttrack`** *(no Re-ID)* | 37.5 | 44.4 | 46.9 | 24.0 | 38.2 | 5,549 | 201 | 9.2 |
200
+ | **`botsort`** *(no Re-ID)* | 36.7 | 44.3 | 46.5 | 24.3 | 37.9 | 6,475 | 221 | 9.3 |
114
201
  | `bytetrack` *(also in browser)* | 33.1 | 39.8 | 45.1 | 23.5 | 35.4 | 7,038 | **2,900** | **9.7** |
115
202
  | *Roboflow `cbiou` (`0.45/0.50`)* | 36.0 | 43.4 | 46.4 | 24.2 | 37.5 | 7,533 | 2,072 | 9.6 |
116
203
  | *Roboflow `botsort` (`0.45/0.50`)* | 35.9 | 43.6 | 46.3 | 24.0 | 37.4 | 6,922 | 194 | 9.2 |
117
204
  | *Roboflow `ocsort+cmc` (`0.45`)* | 33.4 | 43.8 | 44.2 | 15.9 | 34.3 | 8,057 | 196 | 9.2 |
118
205
  | *Roboflow `botsort` (defaults `0.60/0.70`)* | 39.6 | 50.0 | 42.6 | 13.6 | 36.4 | 4,349 | 207 | 9.2 |
119
206
 
207
+ #### Offline post-processing (`--postprocess`)
208
+
209
+ ```bash
210
+ trackflow run game.mp4 --tracker botsort --reid osnet --postprocess
211
+ ```
212
+
213
+ 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.
214
+
120
215
  **How to read this chart and table:**
121
216
  - **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
217
  - **ID switches (lower is better)**: How many times a tracker accidentally swaps or resets a person's ID mid-video.
@@ -240,15 +335,20 @@ trackflow run crowd.mp4 -m rfdetr-large
240
335
  trackflow run crowd.mp4 -m hf:PekingU/rtdetr_v2_r50vd --device mps
241
336
  ```
242
337
 
243
- Re-ID and text-search models:
338
+ Re-ID, text-search, and optional mask fallback models:
244
339
 
245
340
  | Flag | Model | Size | License | Used for |
246
341
  | :--- | :--- | ---: | :--- | :--- |
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` |
342
+ | `--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
343
  | `--vlm clip` | CLIP ViT-B/32 (INT8) | ~153 MB | MIT | Default for `--query` and `search` |
249
344
  | `--vlm siglip` | SigLIP Base (INT8) | ~205 MB | Apache-2.0 | Better on fine clothing/attribute queries |
250
345
  | `--vlm siglip2` | SigLIP 2 Base (INT8) | ~378 MB | Apache-2.0 | Strongest pure-ONNX search (no PyTorch) |
251
346
  | `--vlm embeddinggemma` | EmbeddingGemma 2 (PyTorch, needs `[transformers]`) | ~1.5 GB | Apache-2.0 | Best on clothing and accessory queries |
347
+ | `--mask-fallback sam2.1-tiny` | SAM 2.1 Hiera-Tiny (needs `[sam2]`) | ~156 MB | Apache-2.0 | Default selective occlusion mask fallback |
348
+ | `--mask-fallback edgetam` | EdgeTAM (needs `[sam2]`) | ~56 MB | Apache-2.0 | Fastest / lowest-VRAM selective mask fallback |
349
+ | `--mask-fallback sam2.1-small` | SAM 2.1 Hiera-Small (needs `[sam2]`) | ~184 MB | Apache-2.0 | Optional SAM 2.1 Small mask fallback |
350
+ | `--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 |
351
+ | `--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
352
 
253
353
  ## Python API
254
354
 
@@ -317,3 +417,4 @@ What changed in each version is in [CHANGELOG.md](https://github.com/obendidi/tr
317
417
  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
418
 
319
419
  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.
420
+
@@ -1,56 +1,9 @@
1
- Metadata-Version: 2.5
2
- Name: trackflow-python-cuda
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 CUDA build with bundled CUDA/cuDNN 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.10
27
- Requires-Dist: huggingface-hub>=0.24
28
- Requires-Dist: numpy>=1.26
29
- Requires-Dist: onnxruntime-gpu[cuda,cudnn]>=1.22
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: tokenizers>=0.19
35
- Requires-Dist: typer>=0.12
36
- Provides-Extra: dev
37
- Requires-Dist: pytest>=8.0; extra == 'dev'
38
- Requires-Dist: ruff>=0.6; extra == 'dev'
39
- Provides-Extra: display
40
- Requires-Dist: opencv-python>=4.9; extra == 'display'
41
- Provides-Extra: transformers
42
- Requires-Dist: sentence-transformers<7,>=6.1; extra == 'transformers'
43
- Requires-Dist: torch>=2.6; extra == 'transformers'
44
- Requires-Dist: torchvision>=0.21; extra == 'transformers'
45
- Requires-Dist: transformers<6,>=5.18; extra == 'transformers'
46
- Description-Content-Type: text/markdown
47
-
48
1
  # Trackflow
49
2
 
50
3
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/obendidi/trackflow/blob/main/LICENSE)
51
4
  [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](https://pypi.org/project/trackflow-python/)
52
5
 
53
- 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.
54
7
 
55
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)
56
9
 
@@ -60,7 +13,7 @@ Real-time people and object tracking in Python and in the browser. Trackflow run
60
13
 
61
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.*
62
15
 
63
- 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/).
64
17
 
65
18
  ## Quickstart
66
19
 
@@ -111,6 +64,33 @@ Measured on an isolated venv (system CUDA/TRT paths stripped, proving zero-confi
111
64
 
112
65
  </details>
113
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
+
114
94
  ## Usage
115
95
 
116
96
  ### Tracking and exports
@@ -143,8 +123,9 @@ GROUP BY track_id ORDER BY frames DESC;
143
123
  | `botsort` | [BoT-SORT](https://arxiv.org/abs/2206.14651) (2022) | ByteTrack plus camera-motion compensation, and appearance matching with `--reid osnet`. |
144
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. |
145
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. |
146
127
 
147
- 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.
148
129
 
149
130
  #### Benchmarks across 4 official datasets (81 videos, ~59,800 frames)
150
131
 
@@ -154,16 +135,28 @@ Every tracker below receives the exact same detections from Trackflow's default
154
135
 
155
136
  | Tracker | DanceTrack (25) | SportsMOT (45) | MOT17 (7) | MOT20 (4) | Mean HOTA | Total ID switches | Tracker FPS | End-to-End FPS |
156
137
  | :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
157
- | **`botsort --reid osnet`** | **39.0** | 45.0 | **46.9** | **24.4** | **38.8** | 6,435 | 205 | 5.5 |
158
- | **`ocsort`** *(no Re-ID)* | 37.9 | **46.0** | 46.3 | 23.3 | **38.4** | **5,501** | 203 | 9.2 |
159
- | **`boosttrack`** *(no Re-ID)* | 37.5 | 44.4 | **46.9** | 24.0 | **38.2** | 5,549 | 201 | 9.2 |
160
- | **`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 |
161
146
  | `bytetrack` *(also in browser)* | 33.1 | 39.8 | 45.1 | 23.5 | 35.4 | 7,038 | **2,900** | **9.7** |
162
147
  | *Roboflow `cbiou` (`0.45/0.50`)* | 36.0 | 43.4 | 46.4 | 24.2 | 37.5 | 7,533 | 2,072 | 9.6 |
163
148
  | *Roboflow `botsort` (`0.45/0.50`)* | 35.9 | 43.6 | 46.3 | 24.0 | 37.4 | 6,922 | 194 | 9.2 |
164
149
  | *Roboflow `ocsort+cmc` (`0.45`)* | 33.4 | 43.8 | 44.2 | 15.9 | 34.3 | 8,057 | 196 | 9.2 |
165
150
  | *Roboflow `botsort` (defaults `0.60/0.70`)* | 39.6 | 50.0 | 42.6 | 13.6 | 36.4 | 4,349 | 207 | 9.2 |
166
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
+
167
160
  **How to read this chart and table:**
168
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.
169
162
  - **ID switches (lower is better)**: How many times a tracker accidentally swaps or resets a person's ID mid-video.
@@ -287,15 +280,20 @@ trackflow run crowd.mp4 -m rfdetr-large
287
280
  trackflow run crowd.mp4 -m hf:PekingU/rtdetr_v2_r50vd --device mps
288
281
  ```
289
282
 
290
- Re-ID and text-search models:
283
+ Re-ID, text-search, and optional mask fallback models:
291
284
 
292
285
  | Flag | Model | Size | License | Used for |
293
286
  | :--- | :--- | ---: | :--- | :--- |
294
- | `--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` |
295
288
  | `--vlm clip` | CLIP ViT-B/32 (INT8) | ~153 MB | MIT | Default for `--query` and `search` |
296
289
  | `--vlm siglip` | SigLIP Base (INT8) | ~205 MB | Apache-2.0 | Better on fine clothing/attribute queries |
297
290
  | `--vlm siglip2` | SigLIP 2 Base (INT8) | ~378 MB | Apache-2.0 | Strongest pure-ONNX search (no PyTorch) |
298
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 |
299
297
 
300
298
  ## Python API
301
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-cuda"
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 CUDA build with bundled CUDA/cuDNN runtimes.)"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -70,6 +70,11 @@ transformers = [
70
70
  "torchvision>=0.21",
71
71
  "sentence-transformers>=6.1,<7",
72
72
  ]
73
+ sam2 = [
74
+ "transformers>=5.18,<6",
75
+ "torch>=2.6",
76
+ "torchvision>=0.21",
77
+ ]
73
78
  display = [
74
79
  "opencv-python>=4.9",
75
80
  ]
@@ -77,6 +82,10 @@ dev = [
77
82
  "pytest>=8.0",
78
83
  "ruff>=0.6",
79
84
  ]
85
+ docs = [
86
+ "mkdocs-material>=9.6",
87
+ "mkdocstrings[python]>=0.29",
88
+ ]
80
89
 
81
90
  [project.scripts]
82
91
  trackflow = "trackflow.cli:app"
@@ -84,11 +93,16 @@ trackflow-python-cuda = "trackflow.cli:app"
84
93
 
85
94
  [project.urls]
86
95
  Homepage = "https://obendidi.github.io/trackflow/"
96
+ Documentation = "https://obendidi.github.io/trackflow/docs/"
87
97
  Repository = "https://github.com/obendidi/trackflow"
88
98
  Issues = "https://github.com/obendidi/trackflow/issues"
89
99
 
90
- [tool.hatch.build.targets.wheel]
91
- packages = ["src/trackflow"]
100
+ [tool.maturin]
101
+ python-source = "src"
102
+ module-name = "trackflow._native"
103
+ features = ["pyo3/extension-module"]
104
+ strip = true
105
+ include = ["LICENSE", "README.md", "Cargo.lock"]
92
106
 
93
107
  [tool.ruff]
94
108
  target-version = "py310"