百度API虽然对个人用户免费但是需要注册一个appid,这里建议去看下百度的文档,我这里就不多说了,最后对接后返回的结果做个检测,isSimle为true则表示用户微笑了:
var isSimle = res.data.result.some(function(item){
if(item.result instanceof Array){
return item.result.some(function(item2){
return item2.expression == '1';
})
}else{
return item.result.expression == '1';
}
});
这篇博客介绍了如何在微信小程序中使用百度API进行人脸识别。通过注册appid并遵循百度文档,实现了人脸识别功能,当返回结果isSimle为true时,系统判断用户已微笑。
&spm=1001.2101.3001.5002&articleId=80491006&d=1&t=3&u=1fd36e2125154f7fa90ad8a697ae67ea)
1567

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



