Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redapparat/facedetector
Face detection for your Android app
https://github.com/redapparat/facedetector
android camera face-detection
Last synced: 5 days ago
JSON representation
Face detection for your Android app
- Host: GitHub
- URL: https://github.com/redapparat/facedetector
- Owner: RedApparat
- License: apache-2.0
- Created: 2017-07-03T21:27:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T23:33:57.000Z (over 6 years ago)
- Last Synced: 2024-11-12T22:03:47.394Z (5 days ago)
- Topics: android, camera, face-detection
- Language: Java
- Homepage:
- Size: 41 MB
- Stars: 1,169
- Watchers: 41
- Forks: 197
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FaceDetector
Want to detect human faces on a camera preview stream in real time? Well, you came to the right place.
FaceDetector is a library which:
- detects faces
- works on Android
- very simple to use
- works greatly with [Fotoapparat](https://github.com/Fotoapparat/Fotoapparat)
- you can use it with whichever camera library or source you like
- uses C++ core which can easily be ported to iOS (we have plans for that)Detecting faces with `Fotoapparat` is as simple as:
```java
Fotoapparat
.with(context)
.into(cameraView)
.frameProcessor(
FaceDetectorProcessor
.with(context)
.build()
)
.build()
```## How it works
### Step One (optional)
To display detected faces on top of the camera view, set up your layout as following.
```xml
```
### Step Two
Create `FaceDetectorProcessor`:
Java:
```java
FaceDetectorProcessor processor = FaceDetectorProcessor.with(this)
.listener(faces -> {
rectanglesView.setRectangles(faces); // (Optional) Show detected faces on the view.// ... or do whatever you want with the result
})
.build()
```or Kotlin:
```kotlin
private val processor = FaceDetectorProcessor.with(this)
.listener({ faces ->
rectanglesView.setRectangles(faces) // (Optional) Show detected faces on the view.// ... or do whatever you want with the result
})
.build()
```### Step Three
Attach the processor to `Fotoapparat`
```java
Fotoapparat.with(this)
.into(cameraView)
// the rest of configuration
.frameProcessor(processor)
.build()
```And you are good to go!
## Set up
Add dependency to your `build.gradle`
```groovy
repositories {
maven {
url "http://dl.bintray.com/fotoapparat/fotoapparat"
}
}implementation 'io.fotoapparat:facedetector:1.0.0'
// If you are using Fotoapparat add this one as well
implementation 'io.fotoapparat.fotoapparat:library:1.2.0' // or later version
```## Contact us
Impressed? We are actually open for your projects.
If you want some particular computer vision algorithm (document recognition, photo processing or more), drop us a line at [email protected].
## License
```
Copyright 2017 FotoapparatLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```