Skip to content

Add MediaPipe library integration#136

Merged
openminddev merged 3 commits into
mainfrom
add-mediapipe
Jul 13, 2026
Merged

Add MediaPipe library integration#136
openminddev merged 3 commits into
mainfrom
add-mediapipe

Conversation

@openminddev

Copy link
Copy Markdown
Contributor

This pull request introduces several important updates to the face recognition streaming system, focusing on adapting the configuration for higher-resolution cameras, improving mouth feature extraction, and refactoring the codebase for clarity and extensibility. The main themes are configuration updates for 1920×1080 resolution, the addition of mouth features and MediaPipe integration, and code cleanup.

Configuration updates for 1920×1080 camera:

  • Updated CAMERA_WIDTH and CAMERA_HEIGHT in config.py to 1920×1080, and adjusted related parameters such as CAMERA_FPS (now 30), TRACK_BUFFER (now 60), SELFIE_MIN_FACE_PX (now 75), AUTO_ENROLL_MIN_FACE_PX (now 65), and SELFIE_MIN_ENGAGEMENT (now 0.0023) to maintain consistent behavior with the new resolution. All documentation and scaling examples have been revised accordingly. [1] [2] [3] [4] [5]

Mouth feature extraction and MediaPipe integration:

  • Added a new module, mouth_features.py, that defines data structures and extraction logic for scale-normalized mouth measurements from face landmarks, supporting future voice activity detection and expression analysis.
  • Introduced mediapipe_mesh.py, which wraps MediaPipe FaceMesh for extracting facial landmarks from frames, making it easy to obtain per-face landmark arrays for downstream analysis.

Face tracker improvements and refactoring:

  • Refactored face_tracker.py to remove unnecessary section comments, streamline imports, and update the speaking detector (VVAD) integration: now collects track bounding boxes and pushes them in batch to the VVAD module for each frame, improving modularity and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Minor and auxiliary updates:

  • Updated argument help text in run.py to reflect the new default camera resolution, and removed an unused variable. [1] [2] [3] [4]

These changes collectively modernize the system for higher-resolution input, lay groundwork for advanced mouth/voice features, and enhance maintainability.

openminddev and others added 3 commits July 13, 2026 16:02
Add explanatory docstrings and small style cleanups across the face_recog_stream package. Changes include: adding class/method docstrings and a close() docstring in mediapipe_mesh.py, documenting DetectorConfig/DetectorState and SpeakingDetector.reset/update in speaking_vad.py, finishing a docstring in vvad_speaker.py, and removing stray blank lines in face_tracker.py. Also reflow a long if condition in run.py for readability. These are non-functional, readability and maintenance improvements.
Change vvad track box typing and values from ints to floats to match vvad expectations: vvad_track_boxes now holds Tuple[int, Tuple[float, float, float, float]] and appended box coords are cast with float(...). Also add a "# type: ignore" to the MediaPipe FaceMesh instantiation to silence typing errors from the mediapipe package. These are small type/annotation fixes and do not change runtime behavior beyond ensuring correct types for downstream consumers and the type checker.
@openminddev openminddev merged commit 9c34494 into main Jul 13, 2026
7 checks passed
@openminddev openminddev deleted the add-mediapipe branch July 13, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant