分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

Thinkphp 匹配人脸

发布时间:2023-09-06 02:08责任编辑:蔡小小关键词:暂无标签

1.首先去百度申请人脸 APPID、 Apikey、 SecretKey

2.下载官方demo修改整合改名face文件夹或者加我私人qq 229435572 备注 人脸匹配,找我要face扩展类

3.把face 放在vendor下面

下面是一个简单的人脸年龄测试,具体可见官方文档,

public function faceCheck() {

Vendor(‘face.AipFace‘);

#后台申请的A K 和 ?S
$APPID ????= ‘去申请‘;
$Apikey ???= ‘去申请‘;
$SecretKey = ‘去申请‘;


$client = new \AipFace($APPID, $Apikey, $SecretKey);

$image = "http://www.vikily.com:8765/statics/Admin/img/test.jpg";

$imageType = "URL";

// 调用人脸检测
$client->detect($image, $imageType);

// 如果有可选参数
$options = array();
$options["face_field"] = "age";
$options["max_face_num"] = 2;
$options["face_type"] = "LIVE";

// 带参数调用人脸检测
$result = $client -> detect($image, $imageType, $options);

pf($result);
}

返回信息:

 Array( ???[error_code] => 0 ???[error_msg] => SUCCESS ???[log_id] => 5510199948905 ???[timestamp] => 1533286267 ???[cached] => 0 ???[result] => Array ???????( ???????????[face_num] => 1 ???????????[face_list] => Array ???????????????( ???????????????????[0] => Array ???????????????????????( ???????????????????????????[face_token] => 908ad0f2bcf04f27e0b41652d805af91 ???????????????????????????[location] => Array ???????????????????????????????( ???????????????????????????????????[left] => 212.8435516 ???????????????????????????????????[top] => 160.4919739 ???????????????????????????????????[width] => 304 ???????????????????????????????????[height] => 286 ???????????????????????????????????[rotation] => 4 ???????????????????????????????) ???????????????????????????[face_probability] => 1 ???????????????????????????[angle] => Array ???????????????????????????????( ???????????????????????????????????[yaw] => 1.442859173 ???????????????????????????????????[pitch] => 17.65565109 ???????????????????????????????????[roll] => 4.590346813 ???????????????????????????????) ???????????????????????????[age] => 23 ???????????????????????) ???????????????) ???????))

Thinkphp 匹配人脸

原文地址:https://www.cnblogs.com/leaf-cq/p/9415179.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved