Low-level API
Auto-generated reference for the building blocks used by the high-level facade. Use these when you want to compose the detector, ReID runtime, and trackers explicitly.
Detector
Public detector wrapper with overrideable stage hooks and source streaming.
Source code in boxmot/detectors/detector.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
add_callback(event, func)
predict_cli(source, **kwargs)
Consume streaming inference without accumulating outputs in memory.
run_callbacks(event)
setup_source(source, batch=None, vid_stride=None)
Prepare a batched source iterator for predictor-style inference.
Source code in boxmot/detectors/detector.py
stream_inference(source, **kwargs)
Stream detector outputs over any supported BoxMOT source.
Source code in boxmot/detectors/detector.py
warmup()
Warm up the detector backend with a dummy frame once.
Source code in boxmot/detectors/detector.py
ReID
Unified ReID runtime that also exposes overrideable public stage hooks.
Source code in boxmot/reid/core/reid.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
from_backend(backend)
classmethod
Build a ReID runtime around an already-instantiated backend.
Useful when a tracker has already loaded a ReID backend and we want to
reuse it (rather than reloading the weights) while still exposing the
public preprocess / process / postprocess stage hooks.
Source code in boxmot/reid/core/reid.py
postprocess(features, **kwargs)
Move features to numpy and L2-normalize them.
Source code in boxmot/reid/core/reid.py
preprocess(inputs, boxes=None, **kwargs)
Build the model-ready input batch (cropping + standardization).
Source code in boxmot/reid/core/reid.py
process(payload, **kwargs)
Run the ReID model forward pass.
Source code in boxmot/reid/core/reid.py
Tracker factory
Creates and returns an instance of the specified tracker type.
Parameters:
- tracker_type: The type of the tracker (e.g., 'strongsort', 'ocsort').
- tracker_config: Path to the tracker configuration file.
- reid_weights: Weights for ReID (re-identification). Used to build a ReID backend
when reid_model is not supplied.
- device: Device to run the ReID backend on (only used when building from reid_weights).
- half: Whether to use half-precision for the ReID backend (only used when building from reid_weights).
- per_class: Boolean for class-specific tracking (optional).
- evolve_param_dict: A dictionary of parameters for evolving the tracker.
- reid_preprocess: Preprocessing method for the ReID backend (only used when building from reid_weights).
- reid_model: Pre-built ReID backend (e.g., ReID(...).model). Takes
precedence over reid_weights and lets callers share a single backend across trackers.
- tracker_backend: Backend to use for the tracker. "python" (default)
uses the pure-Python implementation under boxmot.trackers. "cpp"
delegates to the registered native (C++) live backend via
:func:boxmot.native.registry.get_native_live_backend. The native
backend is built on demand if it isn't already compiled.
Returns: - An instance of the selected tracker.
- ValueError: If
tracker_typeis not recognized or the requestedtracker_backendis not available for that tracker.
Source code in boxmot/trackers/tracker_zoo.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |