视频图片儿分析模型。
This commit is contained in:
@@ -96,7 +96,7 @@ public class FaceDetectLogServiceImpl extends ServiceImpl<FaceDetectLogMapper, F
|
||||
Map<String, Object> requestBody = new HashMap<>();
|
||||
requestBody.put("model", modelName);
|
||||
|
||||
if (modelName.equals("emo-detect-v1")){
|
||||
if (modelName.equals("emo-detect-v1") || modelName.equals("emoji-detect-v1")){
|
||||
Map<String, Object> ratioo = new HashMap<>();
|
||||
ratioo.put("ratio", "1:1");
|
||||
requestBody.put("parameters", ratioo);
|
||||
@@ -131,7 +131,7 @@ public class FaceDetectLogServiceImpl extends ServiceImpl<FaceDetectLogMapper, F
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
log.info("发送图像检测请求,请求ID: {}, 图片URL: {}", requestId, imageUrl);
|
||||
log.info("发送图像检测请求,response {}, 图片URL: {}", response, imageUrl);
|
||||
|
||||
// 计算处理时间
|
||||
long endTime = System.currentTimeMillis();
|
||||
@@ -148,6 +148,7 @@ public class FaceDetectLogServiceImpl extends ServiceImpl<FaceDetectLogMapper, F
|
||||
|
||||
// 解析JSON响应
|
||||
if (response.getStatusCode() == HttpStatus.OK) {
|
||||
faceDetectLog.setSuccess( true);
|
||||
JsonNode jsonResponse = objectMapper.readTree(response.getBody());
|
||||
|
||||
// 根据pass字段判断是否成功
|
||||
@@ -165,14 +166,6 @@ public class FaceDetectLogServiceImpl extends ServiceImpl<FaceDetectLogMapper, F
|
||||
|
||||
log.info("图像检测结果 (animate-anyone-detect-gen2 舞动人像 )- check_pass: {}", isSuccess);
|
||||
}
|
||||
|
||||
|
||||
// else {
|
||||
// // 如果没有pass字段,则根据HTTP状态码判断
|
||||
// isSuccess = response.getStatusCode().is2xxSuccessful();
|
||||
// faceDetectLog.setSuccess(isSuccess);
|
||||
// }
|
||||
|
||||
// 检查是否有检测到图像
|
||||
int faceCount = 0;
|
||||
if (jsonResponse.has("output")) {
|
||||
@@ -212,6 +205,17 @@ public class FaceDetectLogServiceImpl extends ServiceImpl<FaceDetectLogMapper, F
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//emoji 开始
|
||||
if (jsonResponse.has("output") && jsonResponse.get("output").has("ext_bbox_face")) {
|
||||
String ext_bbox = jsonResponse.get("output").get("ext_bbox_face").toString();
|
||||
faceDetectLog.setExtBbox(ext_bbox);
|
||||
}
|
||||
if (jsonResponse.has("output") && jsonResponse.get("output").has("bbox_face")) {
|
||||
String bboxFace = jsonResponse.get("output").get("bbox_face").toString();
|
||||
faceDetectLog.setFaceBbox(bboxFace);
|
||||
}
|
||||
//emoji 结束
|
||||
|
||||
// 记录请求ID
|
||||
if (jsonResponse.has("request_id")) {
|
||||
|
||||
Reference in New Issue
Block a user