天天看點

人臉識别全志T509工業級Android晶片商湯算法sdk說明

雙目活體接口調用流程

1. 初始化

首先,需要提前将model檔案和license檔案拷貝到裝置上。

可以參考sample,調用FileUtil.copyAssetsToFile或者采用其他方式實作。
調用**BinocularEngine.getInstance().init**接口進行初始化
           

注意:由于模型大小和裝置性能,建議異步初始化

2. 配置

在初始化時進行傳入可以進行雙目活體相關的參數配置

執行個體化**IdentifyConfig**并配置對應Config
1.設定初始化配置**setInitConfig(InitConfig initConfig)**
2.設定識别圖像配置**setImageConfig(ImageConfig var1)**
3.設定識别閥值配置**setThresholdConfig(ThresholdConfig var1)**
           

3. 輸入資料

'調取雙目幀資料輸入'調用**BinocularEngine.getInstance().input**接口
           

4.識别控制

'開始識别'調用**BinocularEngine.getInstance().start**接口
'停止識别'調用**BinocularEngine.getInstance().stop**接口
           

5.結果回調

'添加回調'調用**BinocularEngine.getInstance().addIdentifyCallback**接口
'移出回調'調用**BinocularEngine.getInstance().removeIdentifyCallback**接口
           

6.進行提取特征和人臉比對

`提取特征`調用**BinocularEngine.getInstance().extractFeature**接口
`人臉比對`調用**BinocularEngine.getInstance().compareFeature**接口
`人臉品質`調用**BinocularEngine.getInstance().quality**接口
           

7.釋放資源

調用**BinocularEngine.getInstance().release**接口