video_helper.faces.track module
video_helper.faces.track
Lightweight multi-face tracking: greedy IoU association (SORT/ByteTrack-family, pure NumPy, no model weights). Meeting / talking-head video moves slowly, so IoU linking with a short “coast” through missed frames is enough to build coherent face tracks — the unit ASD and recognition actually operate on.
Face-embedding-based stitching of tracks that a person split by leaving and re-entering frame is handled one level up (in the resolver, where embeddings are already computed) — the face analogue of voiceprint re-identification.
- class video_helper.faces.track.FaceTrack(track_id, frame_idx=<factory>, faces=<factory>)[source]
Bases:
objectA temporally coherent sequence of one face’s detections.
- video_helper.faces.track.track_faces(frame_dets, *, iou_threshold=0.3, max_gap=15)[source]
Link per-frame detections into tracks by greedy IoU association.
- Parameters:
frame_dets (list[tuple[int, list[Face]]]) –
(frame_idx, faces)in increasing frame order.iou_threshold (float, optional) – Minimum IoU to attach a detection to an existing track.
max_gap (int, optional) – How many frames a track may coast unmatched before it is retired (lets a track survive a brief miss / occlusion).
- Returns:
All tracks discovered, in creation order.
- Return type: