Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mediapipe error: com.google.mediapipe.framework.MediaPipeException: internal: Graph has errors: Calculator::Process() for node "mediapipe_tasks_vision_face_detector_facedetectorgraph__TensorsToDetectionsCalculator" failed #5844

Open
poonamilekar opened this issue Jan 30, 2025 · 2 comments
Assignees
Labels
os:windows MediaPipe issues on Windows platform::android Android Solutions task:face detection Issues related to Face Detection: Identify faces in images and video type:bug Bug in the Source Code of MediaPipe Solution

Comments

@poonamilekar
Copy link

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

None

OS Platform and Distribution

Windows 11, Android 14

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

Android Kotlin

MediaPipe version

com.google.mediapipe:tasks-vision:0.10.14

Bazel version

No response

Solution

Face detection

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

Sample code provided in github works well for the face_detection_short_range.tflite model but not working for face_detection_full_range_sparse.tflite model.

Describe the expected behaviour

Expected behavior is , it should work with face_detection_full_range_sparse.tflite model also, which provides range over 5m for the face detection.

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

Steps to Reproduce 1. Change the model name to 'val modelName = "face_detection_full_range_sparse.tflite" ' 2. Download model from the https://github.com/google-ai-edge/mediapipe/blob/master/docs/solutions/models.md and copy it to assets folder. 3. Comment //apply from:'download_models.gradle' from an app buid.gradle file. 4. Clean the build and run the application 5. Select Camera tab from the application. 6. In logs it give below error and face not get detected. Mediapipe error: com.google.mediapipe.framework.MediaPipeException: internal: Graph has errors: Calculator::Process() for node "mediapipe_tasks_vision_face_detector_facedetectorgraph__TensorsToDetectionsCalculator" failed: ; RET_CHECK failure (mediapipe/calculators/tensor/tensors_to_detections_calculator.cc:365) (raw_box_tensor->shape().dims[1])==(num_boxes_)

Other info / Complete Logs

E  Mediapipe error: 
                 com.google.mediapipe.framework.MediaPipeException: internal: Graph has errors: 
                 Calculator::Process() for node "mediapipe_tasks_vision_face_detector_facedetectorgraph__TensorsToDetectionsCalculator" failed: ; RET_CHECK failure (mediapipe/calculators/tensor/tensors_to_detections_calculator.cc:365) (raw_box_tensor->shape().dims[1])==(num_boxes_)
                 	at com.google.mediapipe.framework.Graph.nativeMovePacketToInputStream(Native Method)
                 	at com.google.mediapipe.framework.Graph.addConsumablePacketToInputStream(Graph.java:414)
                 	at com.google.mediapipe.tasks.core.TaskRunner.addPackets(TaskRunner.java:221)
                 	at com.google.mediapipe.tasks.core.TaskRunner.send(TaskRunner.java:149)
                 	at com.google.mediapipe.tasks.vision.core.BaseVisionTaskApi.sendLiveStreamData(BaseVisionTaskApi.java:181)
                 	at com.google.mediapipe.tasks.vision.core.BaseVisionTaskApi.sendLiveStreamData(BaseVisionTaskApi.java:163)
                 	at com.google.mediapipe.tasks.vision.facedetector.FaceDetector.detectAsync(FaceDetector.java:344)
                 	at com.google.mediapipe.tasks.vision.facedetector.FaceDetector.detectAsync(FaceDetector.java:314)
                 	at com.google.mediapipe.examples.facedetection.FaceDetectorHelper.detectAsync(FaceDetectorHelper.kt:294)
                 	at com.google.mediapipe.examples.facedetection.FaceDetectorHelper.detectLivestreamFrame(FaceDetectorHelper.kt:286)
                 	at com.google.mediapipe.examples.facedetection.fragments.CameraFragment$$ExternalSyntheticLambda3.analyze(Unknown Source:2)
                 	at androidx.camera.core.ImageAnalysis.lambda$setAnalyzer$2(ImageAnalysis.java:476)
                 	at androidx.camera.core.ImageAnalysis$$ExternalSyntheticLambda0.analyze(Unknown Source:2)
                 	at androidx.camera.core.ImageAnalysisAbstractAnalyzer.lambda$analyzeImage$0$androidx-camera-core-ImageAnalysisAbstractAnalyzer(ImageAnalysisAbstractAnalyzer.java:285)
                 	at androidx.camera.core.ImageAnalysisAbstractAnalyzer$$ExternalSyntheticLambda1.run(Unknown Source:14)
                 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                 	at java.lang.Thread.run(Thread.java:1012)
@poonamilekar poonamilekar added the type:bug Bug in the Source Code of MediaPipe Solution label Jan 30, 2025
@kuaashish kuaashish assigned kuaashish and unassigned kalyan2789g Jan 30, 2025
@kuaashish kuaashish added os:windows MediaPipe issues on Windows platform::android Android Solutions legacy:face detection Issues related to Face Detection labels Jan 30, 2025
@kuaashish
Copy link
Collaborator

Hi @poonamilekar,

We have a newer version available (0.10.20). Please try it and let us know if the issue persists. Also, confirm whether you are testing on an emulator or a physical device.

Thank you!!

@kuaashish kuaashish added stat:awaiting response Waiting for user response task:face detection Issues related to Face Detection: Identify faces in images and video and removed legacy:face detection Issues related to Face Detection labels Jan 30, 2025
@poonamilekar
Copy link
Author

Thank you @kuaashish for the reply.
However newer version is also giving same error and testing is on physical device only.

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:windows MediaPipe issues on Windows platform::android Android Solutions task:face detection Issues related to Face Detection: Identify faces in images and video type:bug Bug in the Source Code of MediaPipe Solution
Projects
None yet
Development

No branches or pull requests

3 participants