资源简介
使用百度AI接口用java实现的人脸图像比对功能示例,jdk请用1.8以上版本
代码片段和文件信息
import com.baidu.aip.face.AipFace;
/**
* 百度AI接口人脸比对
* jdk1.8+
* @author try
*/
public class FaceCompare{
public static void main(String[] args) throws InterruptedException{
String img = “face.jpg“;
String APP_ID = “9802974“;
String API_KEY = “OVYw5Ok0y9U8n6CfVPYt0wfZ“;
String SECRET_KEY = “aCN3lupCarq3rC9G8Rylqz1d36Towp8G“;
AipFace client = new AipFace(APP_ID API_KEY SECRET_KEY);
System.out.println(client.addUser(“uid“ “description““group_id“ img null));
Thread.sleep(1600);
System.out.println(client.verifyUser(“uid““group_id“img null));
System.out.println(client.deleteGroupUser(“group_id“ “uid“ null));
System.out.println(client.getGroupUsers(“group_id“ null));
}
}
评论
共有 条评论