google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.75k stars 5.08k forks source link

The input packet MPImage returned by `onResult` after `detectAsync` call is corrupted #5017

Open definability opened 9 months ago

definability commented 9 months ago

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

No

OS Platform and Distribution

Android 11

Mobile device if the issue happens on mobile device

Redmi Note 8T

Browser and version if the issue happens on browser

No response

Programming Language and version

Kotlin

MediaPipe version

0.10.8

Bazel version

6.1.1

Solution

hand_landmarker

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

Android Studio 2023.1.1, Android SDK 30, Android NDK 21

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

No response

Describe the actual behavior

The resulting input packet contains a horizontally stretched RGBA image with vertical stripes

Describe the expected behaviour

The resulting input packet must contain an identical image to the input one if it was RGBA/RGB

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

Other info / Complete Logs

No response

definability commented 9 months ago

Here is the example image (from the tests from the examples repository) expected-bitmap

Here is the resulting input packet: actual-bitmap

definability commented 9 months ago

Proposed fix: https://github.com/google/mediapipe/pull/5018.

P.S. Does anybody know how to build a jar library like com.google.mediapipe:tasks-vision to test the changes easily? P.P.S. Is there a way to launch the unit tests https://github.com/google/mediapipe/tree/master/mediapipe/tasks/javatests/com/google/mediapipe/tasks?

chiu14578 commented 2 weeks ago

Any follow solutions?