百度云接口调整

This commit is contained in:
2025-04-06 17:46:43 +08:00
parent a45929753f
commit d95c16aa01

View File

@ -144,7 +144,7 @@ public class BceFaceBodyAdapter implements IFaceBodyAdapter {
AipFace client = getClient(); AipFace client = getClient();
HashMap<String, String> options = new HashMap<>(); HashMap<String, String> options = new HashMap<>();
options.put("user_info", extData); options.put("user_info", extData);
options.put("quality_control", "LOW"); // options.put("quality_control", "LOW");
options.put("action_type", "REPLACE"); options.put("action_type", "REPLACE");
try { try {
addEntityLimiter.acquire(); addEntityLimiter.acquire();
@ -275,7 +275,12 @@ public class BceFaceBodyAdapter implements IFaceBodyAdapter {
JSONObject response = client.search(faceUrl, "URL", dbName, options); JSONObject response = client.search(faceUrl, "URL", dbName, options);
if (response.getInt("error_code") == 0) { if (response.getInt("error_code") == 0) {
resp.setOriginalFaceScore(100f); resp.setOriginalFaceScore(100f);
JSONArray userList = response.getJSONArray("user_list"); JSONObject resultObj = response.getJSONObject("result");
if (resultObj == null) {
resp.setFirstMatchRate(0f);
return resp;
}
JSONArray userList = resultObj.getJSONArray("user_list");
List<SearchFaceResultItem> result = new ArrayList<>(); List<SearchFaceResultItem> result = new ArrayList<>();
for (int i = 0; i < userList.length(); i++) { for (int i = 0; i < userList.length(); i++) {
JSONObject user = userList.getJSONObject(i); JSONObject user = userList.getJSONObject(i);