husaynhakeem / android-face-detector

A real-time face detection Android library
MIT License
477 stars 79 forks source link

**ML Kit on Device Face detection API is Very Slow** #6

Open charlizesmith opened 5 years ago

charlizesmith commented 5 years ago

ML Kit on Device Face detection API is Very Slow

I want to detect face from gallery Image. I tried with Mobile vision Api and detected face successfully. On website of mobile vision api, they have mentioned about Firebase MLKIT. I also tried firebase ML Kit and detected face.

Issues **1. I noticed that Firebase MLKIT is performing very slow on Gallery Image Bitmap.

  1. Can i still used mobile vision api for detection of face in image.( I want only detect face, dont want eyes,nose,etc)
  2. What should i do to improve performance for detecting face with Firebase MLKIT.
  3. I used Firebase Image Labeling. Firebase Image Labeling is performed fast but Face Detection is very slow comparatively.**

Library Versions: implementation 'com.google.firebase:firebase-core:17.0.1' implementation 'com.google.firebase:firebase-ml-vision:22.0.0' implementation 'com.google.firebase:firebase-ml-vision-face-model:18.0.0' implementation 'com.google.firebase:firebase-ml-vision-image-label-model:18.0.0'

FirebaseVisionFaceDetectorOptions option = new FirebaseVisionFaceDetectorOptions.Builder() .setPerformanceMode(FirebaseVisionFaceDetectorOptions.ACCURATE) .setLandmarkMode(FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS) .setClassificationMode(FirebaseVisionFaceDetectorOptions.ALL_CLASSIFICATIONS) .build();

FirebaseVisionFaceDetector detector = FirebaseVision.getInstance() .getVisionFaceDetector(option);

detector.detectInImage(image).addOnSuccessListener(
        new OnSuccessListener<List<FirebaseVisionFace>>() {
            @Override
            public void onSuccess(List<FirebaseVisionFace> faces) {

}