Browse Source

图片质量审核接口修改

private_deployment
lrh 1 year ago
parent
commit
1ed11f1c68
3 changed files with 22 additions and 9 deletions
  1. +4
    -1
      suimangService/src/main/java/com/iformall/service/sm/impl/PersonPhotoServiceImpl.java
  2. +10
    -0
      suimangService/src/main/java/com/iformall/sm/AiCheckPhotoParam.java
  3. +8
    -8
      suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java

+ 4
- 1
suimangService/src/main/java/com/iformall/service/sm/impl/PersonPhotoServiceImpl.java View File

@@ -17,6 +17,7 @@ import com.iformall.mapper.PersonPhotoMapper;
import com.iformall.service.sm.MaterialMouldService; import com.iformall.service.sm.MaterialMouldService;
import com.iformall.service.sm.MouldPatchSignService; import com.iformall.service.sm.MouldPatchSignService;
import com.iformall.service.sm.PersonPhotoService; import com.iformall.service.sm.PersonPhotoService;
import com.iformall.sm.AiCheckPhotoParam;
import com.iformall.sm.AiCheckPhotoResult; import com.iformall.sm.AiCheckPhotoResult;
import com.iformall.sm.AiVideoHelper; import com.iformall.sm.AiVideoHelper;
import com.iformall.utils.Base64Util; import com.iformall.utils.Base64Util;
@@ -134,7 +135,9 @@ public class PersonPhotoServiceImpl implements PersonPhotoService {


@Override @Override
public ResultData checkPhoto(String material) { public ResultData checkPhoto(String material) {
AiCheckPhotoResult result = AiVideoHelper.checkPhoto(Base64Util.imageUrlToBase64(material));
AiCheckPhotoParam param = new AiCheckPhotoParam();
param.setImg(Base64Util.imageUrlToBase64(material));
AiCheckPhotoResult result = AiVideoHelper.checkPhoto(param);
return new ResultData(result.getCode(), result.getMsg()); return new ResultData(result.getCode(), result.getMsg());
} }
} }

+ 10
- 0
suimangService/src/main/java/com/iformall/sm/AiCheckPhotoParam.java View File

@@ -0,0 +1,10 @@
package com.iformall.sm;

import lombok.Data;

@Data
public class AiCheckPhotoParam {

private String img;

}

+ 8
- 8
suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java View File

@@ -33,7 +33,7 @@ public class AiVideoHelper {


public static String url = "http://nas.pucao.cn:2002"; public static String url = "http://nas.pucao.cn:2002";
public static String photo_speak_suffix = "/img_talking"; public static String photo_speak_suffix = "/img_talking";
public static String image_quality_suffix = "/img_talking";
public static String image_quality_suffix = "/image_qualit";


public static String doPost(String url, String params) { public static String doPost(String url, String params) {
return HttpUtil.doAiVideoPost(url,params); return HttpUtil.doAiVideoPost(url,params);
@@ -100,7 +100,6 @@ public class AiVideoHelper {
// } // }
} }
public static AiPhotoSpeakResult createPhotoSpeakVideo(AiPhotoSpeakParam videoParam) { public static AiPhotoSpeakResult createPhotoSpeakVideo(AiPhotoSpeakParam videoParam) {
log.info("生成视频start request:" + videoParam.neglectImgString());
String response = doPost(url + photo_speak_suffix, JSONObject.toJSONString(videoParam)); String response = doPost(url + photo_speak_suffix, JSONObject.toJSONString(videoParam));
log.info("生成视频end response:" + response); log.info("生成视频end response:" + response);
AiPhotoSpeakResult result = new AiPhotoSpeakResult(); AiPhotoSpeakResult result = new AiPhotoSpeakResult();
@@ -133,10 +132,9 @@ public class AiVideoHelper {
return result; return result;
} }


public static AiCheckPhotoResult checkPhoto(String str) {
log.info("生成视频start request:" + str);
String response = doPost(url + image_quality_suffix, JSONObject.toJSONString(str));
log.info("生成视频end response:" + response);
public static AiCheckPhotoResult checkPhoto(AiCheckPhotoParam param) {
String response = doPost(url + image_quality_suffix, JSONObject.toJSONString(param));
log.info("图片质量审核 end response:" + response);
AiCheckPhotoResult result = new AiCheckPhotoResult(); AiCheckPhotoResult result = new AiCheckPhotoResult();


if (StringUtils.isBlank(response)) { if (StringUtils.isBlank(response)) {
@@ -196,8 +194,10 @@ public class AiVideoHelper {
// param.setUrl("None"); // param.setUrl("None");
// AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); // AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param);


String s = Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/digitalperson/16760216806604820_cSHoijDX_matting.png");
AiVideoHelper.checkPhoto(s);
AiCheckPhotoParam param = new AiCheckPhotoParam();
String img = Base64Util.imageUrlToBase64("https://suimang.oss-accelerate.aliyuncs.com/builtin/personmould/16760216806604820_cSHoijDX_grace_1080.jpg");
param.setImg(img);
AiVideoHelper.checkPhoto(param);


} }




Loading…
Cancel
Save