android-face-detector
android-face-detector copied to clipboard
how to listen if face is detected ?
i have implemented lib in my project and followed docs ,
i want to listen if face is detected , i know that there is a on faied result listenter , where i need to pass result listenere which gives me onSuccess and onFailed callback methods , but i am not getting any response , neither success nor failure . i even tried to impalement interface but results are same .
please let me know why does its happening , and thank you if you can help me
Dear Sir
-
open app build.gradle // implementation "com.github.husaynhakeem:android-face-detector:2.0" // Remote <---close implementation(project(":facedetector")) // Local <---opne
-
modify FaceDetector.kt at line 94 & 95 https://github.com/husaynhakeem/android-face-detector/blob/a8162ac724d1a439b9e2040c33cd2a1e69ae657a/facedetector/src/main/java/husaynhakeem/io/facedetector/FaceDetector.kt#L94
add "onFaceDetectionResultListener?.onSuccess(faceBounds)"
-
modify demo MainActivity.kt line 44 & 45
https://github.com/husaynhakeem/android-face-detector/blob/a8162ac724d1a439b9e2040c33cd2a1e69ae657a/app/src/main/java/husaynhakeem/io/facedetectorapp/MainActivity.kt#L44
add
faceDetector.setonFaceDetectionFailureListener(object : FaceDetector.OnFaceDetectionResultListener { override fun onSuccess(faceBounds: List<FaceBounds>) { Log.e("YOOOOO","Get face $faceBounds ") } override fun onFailure(exception: Exception) {
}
})