Skip to content

Commit

Permalink
Change a face detection model to BlazeFace
Browse files Browse the repository at this point in the history
  • Loading branch information
pillarpond committed Dec 29, 2019
1 parent 7707894 commit 383acef
Show file tree
Hide file tree
Showing 34 changed files with 762 additions and 562 deletions.
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/caches/build_file_checksums.ser
/.idea/dictionaries
/.idea/libraries
/.idea/assetWizardSettings.xml
/.idea/gradle.xml
/.idea/modules.xml
/.idea/tasks.xml
/.idea/workspace.xml
.idea/
.DS_Store
/build
/captures
.externalNativeBuild
**/.cxx
Binary file removed .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file removed .idea/caches/gradle_models.ser
Binary file not shown.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/compiler.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/gradle.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/misc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android:
- tools
- platform-tools
- tools
- build-tools-28.0.3
- android-28
- build-tools-29.0.2
- android-29
- extra-android-m2repository
- extra-google-m2repository
install:
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This sample demonstrates realtime face recognition on Android. The project is ba
## Inspiration
The project is heavily inspired by
* [FaceNet](https://github.com/davidsandberg/facenet)
* [MTCNN](https://github.com/blaueck/tf-mtcnn)
* [MediaPipe](https://github.com/google/mediapipe)
* [Android LibSVM](https://github.com/yctung/AndroidLibSVM)
* [Tensorflow Android Camera Demo](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android)

Expand All @@ -25,5 +25,9 @@ from davidsandberg's facenet
|-----------------|--------------|------------------|-------------|
| [20180402-114759](https://drive.google.com/open?id=1EXPBSXwTaqrSC0OhUdXNmKSh9qJUQ55-) | 0.9965 | VGGFace2 | [Inception ResNet v1](https://github.com/davidsandberg/facenet/blob/master/src/models/inception_resnet_v1.py) |

from MediaPipe
* [TFLite model](https://github.com/google/mediapipe/tree/master/mediapipe/models/face_detection_front.tflite)
* Paper: ["BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs"](https://sites.google.com/corp/view/perception-cv4arvr/blazeface)

## License
[Apache License 2.0](./LICENSE)
21 changes: 12 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "pp.facerecognizer"
minSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
targetSdkVersion 29
versionCode 2
versionName "1.0.1"
ndk {
abiFilters "armeabi-v7a"
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
buildTypes {
Expand All @@ -23,15 +23,18 @@ android {
path 'src/main/jni/CMakeLists.txt'
}
}
aaptOptions {
noCompress "tflite"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation 'androidx.annotation:annotation:1.0.1'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.1.0-alpha03'
implementation 'org.tensorflow:tensorflow-android:1.13.0-rc0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true">

<activity android:name=".MainActivity"
android:screenOrientation="portrait">
Expand Down
Binary file added app/src/main/assets/face_detection_front.tflite
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/assets/mtcnn.pb
Binary file not shown.
Loading

0 comments on commit 383acef

Please sign in to comment.