Skip to content

Commit

Permalink
Update README to version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
husaynhakeem committed Jul 6, 2020
1 parent d47113d commit a8162ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
23 changes: 6 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Binary file removed app/art/demo.jpg
Binary file not shown.
Binary file added app/art/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a8162ac

Please sign in to comment.