diff --git a/README.md b/README.md index c6941f1..b3d7e37 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,15 @@ Face detector is a face detection Android library which can be easily plugged into any camera API (given it provides a way to process its frames). -Face detector is built on top of Firebase ML Kit's face detection API. - +Face detector is built on top of MLKit's face detection API. ## Related article I wrote [the following article](https://heartbeat.fritz.ai/building-a-real-time-face-detector-in-android-with-ml-kit-f930eb7b36d9) in order to explain why this project was built, how it's designed and how one can use it in a real-world Android application. - ## Usage -Three easy steps: +Only 2 easy steps: 1. Add a `FaceBoundsOverlay` on top of your camera view. ```xml @@ -38,25 +36,17 @@ Three easy steps: 2. Define a `FaceDetection` instance and connect it to your camera. ```kotlin -private val faceDetector: FaceDetector by lazy { - FaceDetector(facesBoundsOverlay) -} - -... - +val faceDetector = FaceDetector(facesBoundsOverlay) cameraView.addFrameProcessor { faceDetector.process(Frame( data = it.data, rotation = it.rotation, size = Size(it.size.width, it.size.height), format = it.format, - isCameraFacingBack = cameraView.facing)) + lensFacing = cameraView.facing)) } ``` -3. [Setup firebase](https://firebase.google.com/docs/android/setup) in your Android project - - ## Download 1. Add the code below in your root build.gradle at the end of repositories ```groovy @@ -69,10 +59,9 @@ allprojects { ``` 2. Add the dependency ```groovy -implementation 'com.github.husaynhakeem:android-face-detector:v1.2' +implementation 'com.github.husaynhakeem:android-face-detector:2.0' ``` - ## Demo -![alt text](https://github.com/husaynhakeem/android-face-detector/blob/master/app/art/demo.jpg) +![alt text](https://github.com/husaynhakeem/android-face-detector/blob/master/app/art/demo.png) diff --git a/app/art/demo.jpg b/app/art/demo.jpg deleted file mode 100644 index 2e1a92d..0000000 Binary files a/app/art/demo.jpg and /dev/null differ diff --git a/app/art/demo.png b/app/art/demo.png new file mode 100644 index 0000000..5dc3ce0 Binary files /dev/null and b/app/art/demo.png differ diff --git a/app/build.gradle b/app/build.gradle index 7a1215f..642244a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,5 +21,6 @@ dependencies { implementation "com.otaliastudios:cameraview:1.5.1" // Android face detector - implementation(project(":facedetector")) + implementation "com.github.husaynhakeem:android-face-detector:2.0" // Remote +// implementation(project(":facedetector")) // Local }