Skip to content

Release: MediaPipe segfault fix, RTMPose optimization, UI improvements#80

Merged
yingliu-data merged 28 commits into
mainfrom
staging
Apr 5, 2026
Merged

Release: MediaPipe segfault fix, RTMPose optimization, UI improvements#80
yingliu-data merged 28 commits into
mainfrom
staging

Conversation

@yingliu-data

Copy link
Copy Markdown
Owner

Summary

  • MediaPipe segfault fix: Switch all MediaPipe processors from LIVE_STREAM to synchronous VIDEO mode
  • RTMPose optimization: Detection frame skipping (det_frequency=7), stable skeleton coordinates
  • RTMPose GPU fix: Ensure onnxruntime-gpu in deploy pipelines (uninstall CPU variant conflict)
  • Camera mirror: Flip camera frames before backend processing
  • Bounding box colors: Darken object detection + hand gesture colors for readability
  • View2D sizing: Unified 4:3 aspect ratio across all 2D functions
  • 3D camera: Zoom out to show full avatar + video
  • Deploy fixes: sudo for staging directory, onnxruntime-gpu reinstall, frontend staging workflow restored
  • Supervisord: Added to staging container for auto-restart on crash

Test plan

  • All 5 functions work without crashes
  • RTMPose skeleton stable size during movement
  • Camera feed mirrored in all modes
  • Bounding box labels readable
  • 2D video same size across functions

Generated with Claude Code

Ying and others added 28 commits April 4, 2026 22:33
… box colors

Mirror camera frames horizontally (selfie-style) before sending to the
backend so the streaming video matches what the user sees. Only applies
to camera source, not video file uploads. Also darken the object detection
bounding box color palette so white label text is readable on screen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: mirror camera feed and darken bounding box colors
The SSH user does not have write permission to /var/www. Use sudo mkdir
and chown to match the ownership pattern of the production directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…O mode

Eliminates segfaults in libmediapipe.so caused by async detect_async()
race conditions in the native C++ layer (google-ai-edge/mediapipe#6085, #5466).

- mediapipe_processor.py: remove ObjectDetector (now separate processor),
  switch PoseLandmarker to synchronous detect_for_video()
- mediapipe_object_detector_processor.py: switch to detect_for_video()
- mediapipe_hand_gesture_processor.py: switch to recognize_for_video()
- View2D: lock container to 4:3 aspect ratio for consistent sizing
- Skeleton3DViewer: zoom out camera to show full avatar + video

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: MediaPipe segfault, camera mirror, UI improvements
Lock container to 4:3 aspect ratio with margin auto centering. Remove
objectFit: contain which caused variable black bar sizing across functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…scale

Apply fixed 0.25 scale factor to RTMPose world landmark coordinates so
the 3D skeleton matches MediaPipe's normalized coordinate space.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: RTMPose coordinate normalization, View2D sizing
perf: RTMPose detection frame skipping (det_frequency=7)
Change hand gesture colors from bright cyan/magenta to dark teal/magenta
so white label text is readable against the bounding box backgrounds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…colors

Add step to uninstall CPU onnxruntime and reinstall onnxruntime-gpu after
pip install requirements.txt, which pulls in the CPU variant via rtmlib
dependency. Fixes RTMPose running on CPU instead of GPU after deploys.
Also darken hand gesture bounding box colors for readability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: onnxruntime GPU in deploy pipelines, darken hand gesture colors
…U variant

Uninstalling only the CPU onnxruntime removes shared module files that
onnxruntime-gpu also uses, breaking the installation. Now uninstall both
packages and force-reinstall onnxruntime-gpu to ensure a clean state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: onnxruntime-gpu deploy pipeline broken installation
Replace perspective unprojection (which caused skeleton to shrink/grow
with arm movement due to body_height_px dependency) with direct use of
RTMPose3D's root-relative keypoints_3d. Perspective unprojection now
only computes root_position for scene placement. Removes scale hack.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: stable RTMPose skeleton scale using root-relative 3D coords
Model keypoints_3d x,y are in model-input-space (~288x384 pixels) while
z is already in meters. Apply _XY_SCALE (z_range/z_input_half ≈ 0.015)
to convert x,y to meters, matching the z coordinate space.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: scale RTMPose skeleton x,y to meters
…inates

Previously only z was decoded from simcc while x,y came from keypoints_3d
which depends on the bbox affine crop — causing skeleton size to change
when the detection bbox shifts. Now all three axes are decoded from the
raw simcc codec space (input_size 288x384x288), making coordinates
consistent regardless of bbox changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: bbox-independent RTMPose skeleton via full simcc decoding
…only

Simcc x,y are bbox-crop-dependent — they scale when the detection bbox
changes size. Instead, use keypoints_2d (stable image-space pixels) for
x,y via perspective unprojection with a shared z_root for all joints.
Skeleton proportions now come from stable 2D pixel ratios. Z depth
still from corrected simcc (root-relative, bbox-independent).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: stable RTMPose skeleton using 2D pixels + simcc z
@yingliu-data yingliu-data merged commit cf30e27 into main Apr 5, 2026
1 check passed
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