Comments (9)
image_format = mp.ImageFormat.SRGB if numpy_image.shape[-1] == 4: image_format = mp.ImageFormat.SRGBA elif numpy_image.shape[-1] == 3: image_format = mp.ImageFormat.SRGB
If I change this to mp.ImageFormat.SRGB, I get the following error: Traceback (most recent call last):
File "/Users/kangjian/media/mult_test.py", line 115, in
process(inputs)
File "/Users/kangjian/media/mult_test.py", line 61, in process
media_pipe_image = get_mediapipe_image(numpy_image=image)
File "/Users/kangjian/media/mult_test.py", line 53, in get_mediapipe_image
return mp.Image(image_format=image_format, data=numpy_image)
RuntimeError: float image data should be either VEC32F1, VEC32F2, or VEC32F4 MediaPipe image formats.
from mediapipe.
Hi @kinarr,
I can replicate the problem in Colab Gist, as indicated by @tarakang. I encounter the same error message: "failed: Unsupported format: 9". For now, this issue does not appear to be specific to macOS. Could you please have look into this issue? From our standpoint, it appears to be a legitimate bug.
Thank you!!
from mediapipe.
@kuaashish I believe it's caused by the limited Image formats supported by MediaPipe but there should be a way to normalize the inputs so that it can passed to the model. Lemme take a look.
from mediapipe.
Oh and there's no need to preprocess the inputs like this:
inputs = inputs.astype('float32')
inputs.shape = (1,) + inputs.shape
inputs /= 255
Please see the following for the correct usage of the API:
These are C++ API calls but it should be similar for Python.
from mediapipe.
@tarakang @kuaashish Here's the working notebook for your reference: https://colab.research.google.com/drive/1B0mPPfcWCyr07CBwXgraBIkdqri5BGff?usp=sharing
from mediapipe.
The model card for the MediaPipe Selfie Segmentation model provides essential information about the expected input format for the model. So PTAL here for the respective model cards for each segmentation model: https://developers.google.com/mediapipe/solutions/vision/image_segmenter#multiclass-model
As for the input features this should be helpful: https://developers.google.com/mediapipe/solutions/vision/image_segmenter#features
from mediapipe.
@tarakang I've added your image utility (get_mediapipe_image
) in the notebook so you can uncomment it and try it out too and it should work fine.
from mediapipe.
Hi @kinarr,
Thank you, @tarakang. It appears there may be an issue with the limited image format support in Mediapipe. Could you kindly test the provided working notebook and inform us if the issue persists?
Thank you!!
from mediapipe.
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.
from mediapipe.
Related Issues (20)
- Pose model failure reason
- Eyebrow Segmentation with Mediapipe in Python HOT 1
- online web demo and pre 0.10.x api yield better hand detection than their python tasks api equivalent HOT 8
- It is incorrect of using pose_landmark_full.tflite inference HOT 7
- Can't use MediaPipe in VisionOS development HOT 4
- Incorrect callback method argument for ObjectDetector.detect_async HOT 3
- No clear apks for quick testing HOT 1
- how to reduce the wasm and HOT 1
- Xcode: Duplicate Symbols (Conflicts with MLKit dependencies)
- BaseOptions() concatenates model_asset_path with path of venv/libsite-packages HOT 3
- I use python MediaPipe in Linux , How do i use GPU HOT 5
- Build Errro : BUILD.bazel:2613:19: Compiling src/amalgam/gen/avx512amx.c failed: (Exit 1): HOT 4
- When I use RGB data, errors always occur. Can I use RGB formatted images for inference in Java? HOT 1
- Build fails for Coral - Docker gcc too old for XNNPACK? HOT 6
- MediaPipe FaceDetector Module POC Error - Error: StartGraph failed: $Service "kGpuService", required by node HOT 2
- Error when building facemesh example on M1 mac HOT 6
- How to turn off the automatic pop-up gesture in gesture recognition HOT 2
- Missing API declaration Warning from Apple App Store Connect HOT 2
- couldn't use kaggle GPU HOT 2
- Mediapipe lagging with Tkinter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediapipe.