本次人脸识别主要采用的是百度云人脸识别接口
精准定位图中人脸,获得眼、口、鼻等72个关键点位置,分析性别、年龄、表情等多种人脸属性
获取Access——token
function access_token(){
$file = __DIR__ . '\access_token';
if(file_exists($file)){
$str = file_get_contents($file);
try{
$arr = json_decode($str,true);
if(is_array($arr)){
$totime = $arr['totime'];
if($totime>time()){
return $arr['access_token'];
exit;
}
}
}catch(Exception $e){
}
}
$apikey = "******";
$secretkey = "*****";
$url = 'https://aip.baidubce.com/oauth/2.0/token';
$post_data['grant_type'] = 'client_credentials';

这篇博客介绍了如何在微信小程序中利用百度云人脸识别接口进行人脸检测,包括72个关键点定位、性别年龄分析及表情识别。首先,需要获取Access-token,然后进行人脸检测操作。
最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



