# Face detector
[![](https://jitpack.io/v/husaynhakeem/android-face-detector.svg)](https://jitpack.io/#husaynhakeem/android-face-detector)
![alt text](https://github.com/husaynhakeem/android-face-detector/blob/master/app/src/main/res/drawable/ic_launcher.png)
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.
## 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:
1. Add a `FaceBoundsOverlay` on top of your camera view.
```xml
<FrameLayout
...>
// Any other views
<CameraView
... />
<husaynhakeem.io.facedetector.FaceBoundsOverlay
... />
// Any other views
</FrameLayout>
```
2. Define a `FaceDetection` instance and connect it to your camera.
```kotlin
private val faceDetector: FaceDetector by lazy {
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))
}
```
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
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
2. Add the dependency
```groovy
implementation 'com.github.husaynhakeem:android-face-detector:v1.1'
```
## Demo
![alt text](https://github.com/husaynhakeem/android-face-detector/blob/master/app/art/demo.jpg)
没有合适的资源?快使用搜索试试~ 我知道了~
Android-Facedetector一个实时人脸检测Android库
共41个文件
xml:15个
kt:8个
gradle:4个
需积分: 50 34 下载量 100 浏览量
2019-08-13
06:24:05
上传
评论 1
收藏 198KB ZIP 举报
温馨提示
一个人脸检测Android库,可以轻松插入任何相机API(因为它提供了一种处理其帧的方法)。人脸检测器建立在Firebase ML Kit的人脸检测API之上。
资源推荐
资源详情
资源评论
收起资源包目录
Android-Facedetector一个实时人脸检测Android库.zip (41个子文件)
husaynhakeem-android-face-detector-57dce30
gradlew 5KB
settings.gradle 32B
facedetector
src
main
AndroidManifest.xml 289B
res
values
strings.xml 75B
java
husaynhakeem
io
facedetector
models
Orientation.kt 347B
models.kt 341B
Facing.kt 217B
FirebaseFaceDetectorWrapper.kt 2KB
FaceBoundsOverlay.kt 6KB
FaceDetector.kt 3KB
FaceBoundsOverlayHandler.kt 2KB
.gitignore 7B
build.gradle 973B
proguard-rules.pro 751B
.idea
kotlinc.xml 216B
runConfigurations.xml 564B
misc.xml 2KB
markdown-navigator
profiles_settings.xml 104B
modules.xml 625B
markdown-navigator.xml 4KB
vcs.xml 180B
LICENSE 1KB
gradle
wrapper
gradle-wrapper.properties 230B
gradle-wrapper.jar 52KB
README.md 2KB
gradlew.bat 2KB
gradle.properties 730B
.gitignore 1001B
app
src
main
AndroidManifest.xml 673B
res
drawable
ic_launcher.png 13KB
ic_switch_camera.xml 470B
layout
activity_main.xml 1019B
values
colors.xml 208B
strings.xml 83B
styles.xml 383B
java
husaynhakeem
io
facedetectorapp
MainActivity.kt 1KB
art
demo.jpg 108KB
.gitignore 7B
build.gradle 999B
proguard-rules.pro 751B
build.gradle 610B
共 41 条
- 1
资源评论
weixin_39840515
- 粉丝: 446
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功