private static final String AppID = "xx";
private static final String APIKey = "xx";
private static final String SecretKey = "xx";
static AipFace client = null;
static {
client = new AipFace(AppID, APIKey, SecretKey);
// 可选:设置网络连接参数
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
public static void main(String[] args) {
//getAuth();
video();
}
public static void video() {
HashMap<String, String> options = new HashMap<String, String>();
for(int i = 1; i <= 6; i++) {
String video = "C:\\Users\\EDZ\\Downloads\\failed\\6.mp4";
// JSONObject jsonObject = client.videoFaceliveness(null, video, options);
// System.out.println(jsonObject.toString());
long l = System.currentTimeMillis();
System.out.println("==============");
JSONObject json = client.videoFaceliveness("", video, null);
System.out.println(System.currentTimeMillis() - l);
System.out.println(json.toString());
}
}
结果
{
"result": {
"score": 0.99,
"maxspoofing": null,
"thresholds": {
"frr_1e-3": 0.3,
"frr_1e-2": 0.9,
"frr_1e-4": 0.05
},
"pic_list": [{
}]
},
"serverlogid": 2565999415842,
"error_msg": "SUCCESS",
"err_msg": "SUCCESS",
"cached": 0,
"error_code": 0,
"err_no": 0,
"timestamp": 1582624569
}
网友评论