测试百度人脸比对的例子-18/04/08(参考网上)
程序员文章站
2022-03-16 20:07:04
...
1 添加图片组(5个人,每人2张图)
for(int i=1;i<=2;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"1");
}
for(int i=3;i<=4;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"2");
}
for(int i=5;i<=6;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"3");
}
for(int i=7;i<=8;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"4");
}
for(int i=9;i<=10;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"5");
}
2 找一个人的其他神态的图(不同于步骤1中的图)
image = basePath + "/test/2.jpg";
FaceManage.identifyUser(client, image);
结果
{
"uid": "2",
"scores": [94.447341918945],
"group_id": "group2",
"user_info": "3"
},
{
"uid": "3",
"scores": [50.965473175049],
"group_id": "group2",
"user_info": "5"
},
同 第二个人类似
图片样本和表情少,待有空进一步测试
for(int i=1;i<=2;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"1");
}
for(int i=3;i<=4;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"2");
}
for(int i=5;i<=6;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"3");
}
for(int i=7;i<=8;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"4");
}
for(int i=9;i<=10;i++){
image = basePath + "/train/"+i+".jpg";
FaceManage.addUser(client,image,"5");
}
2 找一个人的其他神态的图(不同于步骤1中的图)
image = basePath + "/test/2.jpg";
FaceManage.identifyUser(client, image);
结果
{
"uid": "2",
"scores": [94.447341918945],
"group_id": "group2",
"user_info": "3"
},
{
"uid": "3",
"scores": [50.965473175049],
"group_id": "group2",
"user_info": "5"
},
同 第二个人类似
图片样本和表情少,待有空进一步测试
上一篇: 图文详解matlab原始处理图像几何变换