Tracking¶
A vendored ByteTrack tracker for DFINE.predict_video(track=True) — per-frame
Results gain a persistent boxes.id across a video. numpy + scipy only.
dfine.track.ByteTrack ¶
ByteTrack(frame_rate: float = 30.0, track_thresh: float = 0.25, match_thresh: float = 0.8, track_buffer: int = 30)
Stateful tracker: feed it one :class:Results per frame, get ids back.
Construct one per video (state persists across :meth:update calls), then call
:meth:update on each frame's detections. The returned :class:Results carries
only the currently active tracks, each with boxes.id set to its track id.
Source code in dfine/track/__init__.py
update ¶
Track result's detections into the running tracks; return tracked boxes.
Source code in dfine/track/__init__.py
dfine.track.byte_tracker.BYTETracker ¶
BYTETracker(track_thresh: float = 0.25, match_thresh: float = 0.8, track_buffer: int = 30, frame_rate: float = 30.0)
ByteTrack: Kalman prediction + two-stage IoU association.
track_thresh splits detections into high/low score; match_thresh is the
max IoU-distance for a valid first-stage match; track_buffer (scaled by
frame_rate) is how many frames a lost track survives before removal.
Source code in dfine/track/byte_tracker.py
update ¶
Advance one frame; return the currently active tracks.
Source code in dfine/track/byte_tracker.py
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 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |