google-ai-edge / mediapipe

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

Android Image Generation Produces Pure Black #5589

Open probable1333 opened 2 weeks ago

probable1333 commented 2 weeks ago

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

No

OS Platform and Distribution

Android 14

Mobile device if the issue happens on mobile device

Samsung Galaxy S24+ Exynos variant

Browser and version if the issue happens on browser

No response

Programming Language and version

Kotlin

MediaPipe version

0.10.14

Bazel version

No response

Solution

Image Generation

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

Image generator generates a 512x512 black image

Describe the expected behaviour

To an image to be generated

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

Code: mediapipe-samples/examples/image_generation Models tried: runwayml/stable-diffusion-v1-5 and hakurei/waifu-diffusion-v1-4 both converted on Google Colab by following the tutorial. I am unsure if it is relevant, but the conversion script gave the following warning: /content/convert.py:42: RuntimeWarning: overflow encountered in cast v.numpy().astype("float16").tofile(output_bin_file)

I have initially created the issue in the samples repo but from what I have gathered by debugging the demo app, the issue could be caused by Mediapipe Image Generator itself which returns full black image no matter what.

Thank you.

Other info / Complete Logs

logcat.txt img

kuaashish commented 2 weeks ago

Hi @probable1333,

Thank you for bringing this issue to our attention once again. We are already aware of it, as similar issue have been reported https://github.com/google-ai-edge/mediapipe/issues/5071. While we can not commit to a specific resolution at this time, we will definitely highlight the issue with our team.