在使用百度云的人脸识别sdk时遇到了这个错误,网上百度不到解决的方法,当我浏览百度云的时候发现了这个
于是考虑到版本可能更新,出现了新的函数代替旧的函数,于是去查文档,文档链接如下
https://cloud.baidu.com/doc/FACE/Face-Java-SDK.html#.E4.BA.BA.E8.84.B8.E6.90.9C.E7.B4.A2
果然出现了search函数代替identifyUser,
1 public void sample(AipFace client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4 options.put("quality_control", "NORMAL");
5 options.put("liveness_control", "LOW");
6 options.put("user_id", "233451");
7 options.put("max_user_num", "3");
8
9 String image = "取决于image_type参数,传入BASE64字符串或URL字符串或FACE_TOKEN字符串";
10 String imageType = "BASE64";
11 String groupIdList = "3,2";
12
13 // 人脸搜索
14 JSONObject res = client.search(image, imageType, groupIdList, options);
15 System.out.println(res.toString(2));
16
17 }
成功解决问题,果然版本更替真的是我们要关注的东西。
作者:你的雷哥
本文版权归作者所有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。