Skip to content

[EN] Get Started

gujiayang edited this page Feb 26, 2017 · 3 revisions
  1. Download project SDK source code

git clone https://github.com/FacePlusPlus/MegviiFacepp-Android-SDK.git

Note: if you are not using the latest version, please find corresponding version in tags.

  1. Download Face++ Face SDK

Please create an account on Face++ website, and download Android SDK (Online Licensing version) from the console. (For Offline Licensing version, please contact our sales: [email protected])

Note: in the SDK downloaded from Face++ webiste, a compiled static library has already been included. You can skip the steps below, and refer to Deploy a Demo for how to use this SDK to build a simple app with face detection features.

  1. Import .so Library

  • Open Android Studio, choose Open an existing Android Studio project, navigate into the directory that contains SDK source code. (You may wait for seconds, because AS is sometimes slow) Choose MGFaceppSDK folder, click OK;

Face++ Import

  • After this project is imported into Android Studio (Note: if your ndk-build is not installed by AS, you'll have to set the directory of ndk-build. Choose local.properties and add ndk.dir=[your ndk-build dir]), you will see gradle did not run successfully, which is because .so library needs to be imported;

  • Unzip the SDK downloaded from Face++ website, copy .so library to MGFaceppSDK/src/main/jni folder, and copy model files to the folder as follows:

Face++ import so

  • Click 'gradle > refresh all Gradle projects', now you have imported .so library successfully.

Face++ gradle refresh

  1. Export SDK

  • SDK can be exported as aar file for Android Studio, or jar + *.so file for Eclipse;
  • Uncollapse gradle functions on right side, double click MGFaceppSDK > :MGFaceppSDK > Task > other > releaseAll, gradle will start compiling automatically;

releaseAll

  • We will then see release folder in Project view on left side, which contains exported SDK and algorithm models (due to dependency, sometimes you may have to click releaseAll twice to export all the SDK);

Finish exporting

  1. Next Step

  • After compiling a static library, you can refer to Deploy a Demo for how to use this SDK to build a simple app with face detection features.