百度的人脸识别api,获取不到右眼的数据 ,请问我这代码写的有问题吗???
返回的是这样的
{
"result": [{
"roll": -0.57837802171707,
"location": {
"top": 263,
"left": 78,
"width": 380,
"height": 343
},
"face_probability": 1,
"rotation_angle": 0,
"pitch": 11.926297187805,
"yaw": -5.9680991172791
}],
"log_id": 3839293773121211,
"result_num": 1
}
代码是这样
AipFace client = new AipFace(APP_ID, API_KEY, SECRET_KEY);
client.setSocketTimeoutInMillis(60000);
// 可选:设置网络连接参数
client.setConnectionTimeoutInMillis(2000);
HashMap options = new HashMap();
options.put("face_fields", "+++left_eye");
options.put("face_fields", "landmark");
options.put("face_fields", "+++right_eye");
// options.put("face_fields", "expression");
// options.put("face_fields", "expression");
// 参数为本地图片路径
String imagePath = "F:/s/2/1 (12).jpg";
JSONObject response = client.detect(imagePath, options);
System.out.println(response.toString());
System.out.println(response.toString(2));
百度ai的左右眼的数据都是0, 怎么回事???
{
"result": [{
"roll": -0.57837802171707,
"qualities": {
"illumination": 123,
"occlusion": {
"right_eye": 0,
"nose": 0,
"mouth": 0,
"chin": 0,
"left_eye": 0,
"left_cheek": 0.012105491012335,
"right_cheek": 0.010928961448371
},
"blur": 4.3142082972736E-7,
"completeness": 1,
"type": {
"cartoon": 0,
"human": 0
}
},
"location": {
"top": 263,
"left": 78,
"width": 380,
"height": 343
},
"face_probability": 1,
"rotation_angle": 0,
"pitch": 11.926297187805,
"yaw": -5.9680991172791
}],
"log_id": 2671941816121319,
"result_num": 1
}
age、beauty、expression、faceshape、gender、glasses、landmark、race、qualities
可以给上头那些。qualities是亮度、明暗、模糊度还有溢出相关的质量,不包含位置信息
landmark是抓取全脸72关键点的参数。这72个点里有你想要的眼部数据
+++right_eye 是右眼数据 你这个是人脸检测API吧
你传入返回参数,不应该这么写呀
右眼数据 是在 +qualities 人脸质量信息里面的。face_fields包含qualities时才会返回