Kotlin 百度離線人臉採集SDK

語言: CN / TW / HK

之前接過百度實名認證,特簡單,相比之下百度的離線人臉採集要麻煩的多。

說一下步驟吧

1.去官網下載SDK和認證檔案,專案中位置如下 assets 下為認證檔案

2.settings.gradle 中新增兩行程式碼:

include ':app'
include ':faceplatform-release'
include ':faceplatform-ui'

3.自己專案名\app\build.gradle 中新增一行程式碼

dependencies {
    ---------
    ---------------
    ------------

    compile project(path: ':faceplatform-ui')



}

4.首頁初始化 MainActivity:

private fun initFaceSDK() {

        FaceSDKManager.getInstance().initialize(this,mUtils.licenseID, mUtils.licenseFileName,
            object : IInitCallback {
                override fun initFailure(p0: Int, p1: String?) {
                }

                override fun initSuccess() {
                }

            });



    }