|
@@ -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); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|