mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

solutions.drawing_utils.draw_landmarks does not work on RGBA images

Open JC3 opened this issue 1 year ago • 3 comments

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

MacOS

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

No response

Programming Language and version

Python

MediaPipe version

0.10.9

Bazel version

No response

Solution

Pose Landmarker

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

If an RGBA image is passed to solutions.drawing_utils.draw_landmarks (such as when using GPU mode, where the image must be RGBA), then solutions.drawing_utils.draw_landmarks fails. As a workaround, the image can be converted back to RGB prior to passing to this function.

Describe the expected behaviour

solutions.drawing_utils.draw_landmarks should work on RGBA images.

Standalone code/steps you may have used to try to get what you need

solutions.drawing_utils.draw_landmarks

Other info / Complete Logs

No response

JC3 avatar Mar 26 '24 18:03 JC3

Hi @JC3,

Could you kindly provide the detailed steps you are following from our documentation, or alternatively, share the standalone code with us? This will help us to reproduce the issue and gain a better understanding of it.

Thank you!!

kuaashish avatar Apr 02 '24 06:04 kuaashish

Can't repro; will investigate further and post back.

JC3 avatar Apr 02 '24 13:04 JC3

Hi @JC3,

Based on our team's investigation indicates that the existing MediaPipe visualization utilities API is not directly compatible with the new Tasks API. This is because the visualization utilities were designed for the legacy solutions.

For correct guidance on using visualization with the new Tasks API, please refer to the Colab example https://github.com/googlesamples/mediapipe/blob/main/examples/pose_landmarker/python/%5BMediaPipe_Python_Tasks%5D_Pose_Landmarker.ipynb.

Thank you!!

kuaashish avatar May 03 '24 06:05 kuaashish

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar May 11 '24 01:05 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar May 18 '24 01:05 github-actions[bot]