|
|
@@ -3,7 +3,6 @@ package com.baidu.aip.excep.activity;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Looper;
|
|
|
import android.text.TextUtils;
|
|
|
-import android.util.Log;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
@@ -120,7 +119,7 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
|
|
|
public void callBack(String accessToken) {
|
|
|
LogUtil.i("gong", "accessToken=" + accessToken);
|
|
|
httpClient.Api().send(new HttpClient.Builder()
|
|
|
- .url("rest/2.0/face/v3/search")
|
|
|
+ .url("rest/2.0/face/v3/search")//人脸识别接口,详情请去百度AI开放平台
|
|
|
.add("access_token", accessToken)
|
|
|
.header("Content-Type", "application/json")
|
|
|
.add("image", faceBase64)
|
|
|
@@ -247,7 +246,7 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
|
|
|
FaceVerify mFaceVerify = new FaceVerify();
|
|
|
for (int i = 0; i < user_list.size(); i++) {
|
|
|
JSONObject userObject = user_list.getJSONObject(i);
|
|
|
- float score = JSONUtil.getFloat(userObject, "score");
|
|
|
+ float score = JSONUtil.getFloat(userObject, "score");//用户的匹配得分,推荐阈值80分
|
|
|
if (mFaceVerify.getScore() < score) {
|
|
|
mFaceVerify.setScore(score);
|
|
|
mFaceVerify.setUserId(JSONUtil.getText(userObject, "user_id"));
|