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

Unable to detect all the faces in the given image, when the image contains more faces. #5814

Open
henry14311 opened this issue Jan 9, 2025 · 5 comments
Assignees
Labels
os:macOS Issues on MacOS platform:javascript MediaPipe Javascript issues stat:awaiting response Waiting for user response type:bug Bug in the Source Code of MediaPipe Solution

Comments

@henry14311
Copy link

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

Yes

OS Platform and Distribution

MacOS 14.5

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

JS

MediaPipe version

"@tensorflow-models/face-detection": "^1.0.3",

Bazel version

No response

Solution

"@tensorflow-models/face-detection": "^1.0.3",

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

It detects only 2 faces when there are 13 faces in the image.

Describe the expected behaviour

it should detect all the 13 faces in the image

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

I have used the setup as mentioned in the documentation.

Other info / Complete Logs

No response

@henry14311 henry14311 added the type:bug Bug in the Source Code of MediaPipe Solution label Jan 9, 2025
@henry14311
Copy link
Author

Screenshot 2025-01-09 at 11 03 31 AM

@henry14311
Copy link
Author

example code as per the documentation
const model = faceDetection.SupportedModels.MediaPipeFaceDetector;
const detectorConfig = {
runtime: 'tfjs',
modelType:'full',
maxFaces:13,
minDetectionConfidence:0.2
}
faceDetection.createDetector(model, detectorConfig);

       function detectFaces(img: HTMLImageElement) {
        const estimationConfig = {flipHorizontal: false,maxNumFaces: 33};
        const faces = await detector!.estimateFaces(img, estimationConfig);

}

@kuaashish kuaashish added os:macOS Issues on MacOS platform:javascript MediaPipe Javascript issues labels Jan 10, 2025
@kuaashish
Copy link
Collaborator

Hi @henry14311,

There appears to be an issue with TensorFlow.js, not with the Mediapipe Face Detection API. We recommend raising the issue in the relevant repository here: https://github.com/tensorflow/tfjs-models for further resolution.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Jan 10, 2025
@henry14311
Copy link
Author

henry14311 commented Jan 10, 2025

Thank you for the clarification, MediaPipeFaceDetector-MediaPipe wraps the MediaPipe JS Solution within the familiar TFJS API mediapipe.dev. isn't this uses the mediapipe api ? i used these as well import '@mediapipe/face_detection';
import '@tensorflow/tfjs-core';
import '@tensorflow/tfjs-backend-webgl';
import * as faceDetection from '@tensorflow-models/face-detection';

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Jan 10, 2025
@kuaashish kuaashish added stat:awaiting response Waiting for user response and removed stat:awaiting response Waiting for user response labels Jan 16, 2025
@kuaashish
Copy link
Collaborator

Hi @henry14311,

Apologies for the delayed response. The library @mediapipe/face_detection belongs to the legacy MediaPipe Face Detection, which has been upgraded to the Face Detection Task API. You can find more details on the overview page and documentation.

Please note that we no longer provide support for the legacy @mediapipe/face_detection and may not be able to assist further with it. We recommend using the upgraded Face Detection Task API and letting us know if you encounter similar issues with the new API. Additionally, we suggest raising a new issue in the TFJS repository to request integration with the updated Face Detection Task API, as further action from MediaPipe's side is not feasible.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:macOS Issues on MacOS platform:javascript MediaPipe Javascript issues stat:awaiting response Waiting for user response type:bug Bug in the Source Code of MediaPipe Solution
Projects
None yet
Development

No branches or pull requests

2 participants