exordium.video.face.streaming¶
Live face tracking: frames in, per-frame tracks and a provisional protagonist out.
Attributes¶
Module-level logger. |
Classes¶
Detect and track faces on frames as they arrive. |
Module Contents¶
- exordium.video.face.streaming.logger¶
Module-level logger.
- class exordium.video.face.streaming.StreamingFacePipeline(detector: exordium.video.face.detector.base.FaceDetector, tracker: exordium.video.core.streaming.StreamingTracker)¶
Detect and track faces on frames as they arrive.
Chains a
FaceDetectorwith aStreamingTracker; nothing is read ahead, so it works on a live camera, a call, or any frame iterable.- Parameters:
detector – Face detector run on every frame.
tracker – Streaming tracker fed with the detections.
Example:
pipeline = StreamingFacePipeline( YoloFace11Detector(), StreamingTracker(IouTracker()) ) for update in pipeline.process(frames): # frames: (3, H, W) uint8 RGB if update.stable: print("protagonist:", update.protagonist_id)
- push(frame: torch.Tensor | numpy.ndarray, frame_id: int | None = None) exordium.video.core.streaming.StreamUpdate¶
Detect and track faces in the next frame.
- Parameters:
frame –
(3, H, W)tensor or(H, W, 3)array, uint8 RGB.frame_id – Frame index; counts up from 0 when omitted.
- Returns:
The
StreamUpdatefor this frame.
- process(frames: collections.abc.Iterable[torch.Tensor | numpy.ndarray]) collections.abc.Iterator[exordium.video.core.streaming.StreamUpdate]¶
Lazily yield one update per incoming frame.
- Parameters:
frames – Any iterable of frames, such as a camera generator.
- Yields:
One
StreamUpdateper frame.
- reset() None¶
Forget all tracks and restart frame numbering for a new session.