输入一个或者一组图片接口,即可返回图片中面部的坐标、性别、面部表情等信息。
服务由 Face.com 提供的标准REST API 接口; 所以使用前需要先到 face.com注册一个账户,创建一个应用,获取api key 和 api secret 。
face.com 接口识别的很准确,可以准确识别出李宇春的性别! :)
演示地址: http://sms.wanyi.im/?m=main&a=face
【使用方法】
$url = "http://weiping-face.stor.sinaapp.com/test.jpeg";
$api = new apibus();
$face = $api->load("face");
$obj = $face->detect("face.com api_key", "face.com api_secret", $url );
print_r( $obj );
【方法说明】
detect:
检查图片中面部信息;成功返回面部信息数组及状态信息,失败返回 APIBusError。
mix detect ( $api_key, $api_secret, $urls, $callback_url=null, $detector=null, $attributes=null )
参数表
$api_key
Face.com api_key。 在 face.com 免费注册即可获得。注册地址: http://developers.face.com/signup/
示例:"919661221a5aa0d98aad20646dda8d30"
$api_secret
Face.com api_secret。 在 face.com 免费注册即可获得。注册地址:http://developers.face.com/signup/
"3bc95c51122d0f5d839e2a42db92efd8"
$urls
照片地址。多个用 "," 分割。
示例:"http://image.xinmin.cn/2010/03/04/20100304095723420502.png"
$callback_url
回调地址;如果填写此参数,则采用异步方式检测图片,检测结果以POST方式发送到此地址。
推荐采用异步方式。
示例: "http://yoursitename.com/yourphp.php"
$detector
Set the face detector work mode: Normal (default) or Aggressive. Aggressive mode may find a bit more faces, and is also slower. Usage of this detector counts as two Normal detections.
$attributes
Can be all, none or a list of specific comma-separated attributes (see list of available attributes on the return values page. Unless specified, it returns the default 3 attributes of gender, glasses and smiling. The face attribute, marking whether there's a face present is always returned.
返回值
面部信息数组及状态信息。若异步调用,返回回调地址及状态信息。
示例参考: http://sms.wanyi.im/?m=main&a=face
【资源下载】
SAE外部调用扩展服务SDK下载:点击下载 ( 内测中,请谨慎使用 )
面部识别服务 Java SDK下载: 点击下载 ( 内测中,请谨慎使用 )
面部识别服务 Objective-C SDK下载: 点击下载 ( 内测中,请谨慎使用 )
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述