Add MediaPipe Pose backend to MGT-python#334
Merged
Conversation
Closed
Agent-Logs-Url: https://github.com/fourMs/MGT-python/sessions/c1349a53-c4ab-47c3-ac30-c5f12a10e4f9 Co-authored-by: alexarje <114316+alexarje@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Mediapipe integration to MGT
Add MediaPipe Pose backend to MGT-python
Apr 13, 2026
alexarje
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MediaPipe offers modern, CPU-friendly pose estimation with 33 landmarks and no manual model management. This PR wires it into MGT-python as a first-class
pose()backend alongside the existing OpenPose/Caffe path.Core changes
_pose_estimator.py— RewritesMediaPipePoseEstimatorto use the mediapipe Tasks API (mp.tasks.vision.PoseLandmarker), required since mediapipe 0.10 removed the oldmp.solutions.pose.Pose. Model files (lite/full/heavy.task, ~8–28 MB) are auto-downloaded on first use and cached inmusicalgestures/models/. Drops deprecatedstatic_image_modeparameter._pose.py— Connects MediaPipe to the existingpose()workflow:model='mediapipe'to a new_pose_mediapipe()helper (frame-by-frame FFmpeg pipe →MediaPipePoseEstimator→ overlay skeleton → write video)MEDIAPIPE_POSE_CONNECTIONS(35 pairs covering all 33 landmarks) for skeleton rendering (cyan lines + red circles)_save_pose_txt()for exporting 33-landmark data to CSV/TSV/TXT with human-readable headerstests/test_new_features.py— AddsTestMediaPipePoseIntegration(10 tests covering connections, data export, model URLs, routing); fixestest_mediapipe_no_mediapipe_raisesfor the new attribute name.Usage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_full/float16/1/pose_landmarker_full.task/usr/bin/python python -m pytest tests/test_new_features.py::TestPoseEstimator -v get --global t pull.rebase(http block)/usr/bin/python python -m pytest tests/test_new_features.py -v --global ame git(http block)/usr/bin/python python -m pytest tests/ -v unset --global k/_temp/copilot-developer-action-main/dist/gh-gpgsign/gh-gpgsign-linux-x86_64 credential.usernld(http block)https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_lite/float16/1/pose_landmarker_lite.task/usr/bin/curl curl -s -o /home/REDACTED/work/MGT-python/MGT-python/musicalgestures/models/pose_landmarker_lite.task REDACTED -w %{http_code} nfig/composer/vendor/bin/git r(http block)/usr/bin/curl curl -I REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either: