版本
com.baidu.aip
java-sdk
4.12.0
1、调用 :client.imageCensorUserDefined
public static void main(String[] args) {
AipContentCensor client = new AipContentCensor("appId", "key", "token");
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
JSONObject jsonObject = client.imageCensorUserDefined("http://static.hnyequ.cn/idCardPath/a23f6dfe-8daa-4b7a-b7b4-b3571f26eab0.png", EImgType.URL, null);
System.out.println(jsonObject);
// 输出:{"conclusion":"不合规","log_id":15918424152752077,"data":[{"msg":"头像审核未检测到人脸不合规","conclusion":"不合规","subType":0,"conclusionType":2,"type":10}],"conclusionType":2}
}
2、调用:client.imageCensorComb
public static void main(String[] args) {
AipContentCensor client = new AipContentCensor("appId", "key", "token");
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
JSONObject jsonObject = client.imageCensorComb("http://static.hnyequ.cn/idCardPath/13fbd450-bbdf-4d41-949a-bebcd99b325c.jpg", EImgType.URL, Arrays.asList(""), null);
System.out.println(jsonObject);
// 输出:{"log_id":15918428204155506,"error_msg":"service not support","error_code":216102}
}
需求:图片审核,包括色情、暴恐、敏感信息等
问题:方式一看这像是针对头像做审查,不符合我的需求;方式二貌似是自定义审查类目,但是第三个参数怎么传,文档和源码中都看不出来。有没有类似场景的大佬贴下代码。
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
看文档,不要看代码猜文档。。。