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

Face Detection is not working in Android with google_ml_kit: ^0.19.0 Dependency #705

Closed
santhoshAndroid opened this issue Oct 19, 2024 · 8 comments
Labels
close-inactivity Face Detection Issues corresponding to Face Detection API stale

Comments

@santhoshAndroid
Copy link

santhoshAndroid commented Oct 19, 2024

Describe your issue. If applicable, add screenshots to help explain your problem.

This requirement addresses the issue where face detection is not functioning properly on Android when using the google_ml_kit: ^0.19.0 dependency. The solution aims to identify and resolve compatibility problems, bugs, or missing configurations that prevent the face detection feature from working as expected. The goal is to ensure seamless integration of Google ML Kit's face detection capabilities in Android applications, allowing for accurate and efficient face tracking and recognition.

Steps to reproduce.

Steps to Reproduce the Face Detection Issue in Android with google_ml_kit: ^0.19.0 Dependency

  1. Set Up the Project:

    • Create a new Flutter project or open an existing one.
    • Add the google_ml_kit: ^0.19.0 dependency in your pubspec.yaml file.
    • Run flutter pub get to install the dependency.
  2. Initialize Camera for Face Detection:

    • Implement the camera initialization using Flutter’s camera plugin or native camera integration.
    • Add necessary permissions (camera, storage) in AndroidManifest.xml:
      <uses-permission android:name="android.permission.CAMERA"/>
  3. Implement Face Detection Code:

    • Set up the face detection code using google_ml_kit. For instance, create a FaceDetector instance and start the camera preview.
  4. Build and Run the Application on an Android Device:

    • Build the app and run it on a physical Android device (not emulator).
    • Make sure you grant all permissions when prompted.
  5. Test Face Detection:

    • Open the app and ensure the camera is functioning.
    • Point the camera at a face to see if face detection works.
  6. Observe the Issue:

    • Notice that the camera feed displays, but no faces are detected in real-time.
    • The live camera preview fails to detect any faces, despite the face being visible and in clear lighting.
    • Face landmarks and liveness detection do not work or trigger any events.
  7. Verify Logs (Optional):

    • Check Android Studio logs for any relevant error messages or warnings related to the ML Kit's face detection, camera initialization, or missing dependencies.

This reproduces the face detection failure using google_ml_kit: ^0.19.0 on Android.

What is the expected result?

Expected Result:

  • When the camera is opened, the face detector should automatically start detecting faces in the camera feed.
  • The camera should detect and highlight faces in real-time, showing facial landmarks (such as eyes, nose, and mouth) and tracking movements.
  • If implemented, liveness detection should accurately detect whether the face in view is real and not a static image.

Actual Result:

  • The camera opens, but face detection does not trigger, and no faces are detected.
  • There is no visual indication of facial landmarks or liveness detection, even though the camera feed is visible.

Did you try our example app?

Yes

Is it reproducible in the example app?

Yes

Reproducible in which OS?

Android

Flutter/Dart Version?

[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4317], locale en-US)
• Flutter version 3.24.3 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3

Plugin Version?

dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.8
image: ^4.2.0
file_picker: ^8.1.2
path_provider: ^2.1.4
camera: ^0.10.6
camera_android_camerax: ^0.6.10
google_ml_kit: ^0.19.0
google_mlkit_face_detection: ^0.12.0
fluttertoast: ^8.2.8
flutter_pdfview: ^1.3.3
image_picker: ^1.1.2
tflite_flutter: ^0.11.0

@bensonarafat bensonarafat added the Face Detection Issues corresponding to Face Detection API label Oct 20, 2024
@santhoshAndroid
Copy link
Author

The face is not detected in android device camera

@santhoshAndroid
Copy link
Author

santhoshAndroid commented Oct 23, 2024

Has anyone faced this issue and solved it? If yes, can you explain how to solve it?

@santhoshAndroid
Copy link
Author

@bensonarafat can you help me

@bensonarafat
Copy link
Collaborator

Do you try the example app ? @santhoshAndroid

@santhoshAndroid
Copy link
Author

Yes, I tried, but the camera turns on, and no face is detected @bensonarafat

@santhoshAndroid
Copy link
Author

If any configuration for android gradle files

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 23, 2024
Copy link

github-actions bot commented Dec 8, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
close-inactivity Face Detection Issues corresponding to Face Detection API stale
Projects
None yet
Development

No branches or pull requests

2 participants