php开发人脸识别的api接口.doc

  1. 1、本文档共4页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
php开发人脸识别的api接口

php开发人脸识别的api接口 作者:  来源:互联网  日期:2013-11-14 16:20:25? 收藏  评论:(?0?)  阅读:1982 在网上发现一个PHP编写的人脸识别的API,试了一下还不错,这里推荐给大家,有兴趣的可以研究研究。首先,检测出三张输入图片中的Face。然后,使用这三个Face各自创建1个新的Person。这三个Person将构建一个新的Group以作为候选的识别库。最后,输入一张新Image,并在已构建的Group中识别这个新Image中的Face。 创建新的Person 待识别图片首先需要经过初步检测,找出图片中Face的位置及属性。然后,再使用API中的Person管理创建新的Person。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 // the list of person_name to train and identify for $person_names?=?array(1,?2,?3); // store the face_ids obtained by detection/detect API $face_ids?=?array(); // register new people, detect faces foreach?($person_names?as?$person_name) ????detect($api,?$person_name,?$face_ids); ?????????????????????????????? /* ?*? create new person, detect faces from persons image_url ?*/ function?detect($api,?$person_name, $face_ids) { ????// obtain photo_url to train ????$url?= getTrainingUrl($person_name); ?????????????????????????????????? ????// detect faces in this photo ????$result?=?$api-face_detect($url); ????// skip errors ????if?(empty($result-face)) ????????return?false; ????// skip photo with multiple faces (we are not sure which face to train) ????if?(count($result-face) 1) ????????return?false; ?????????????????????????????????? ????// obtain the face_id ????$face_id?=?$result-face[0]-face_id; ????$face_ids[] =?$face_id; ????// delete the person if exists ????$api-person_delete($person_name); ????// create a new person for this face ????$api-person_create($person_name); ????// add face into new person ????$api-person_add_face($face_id,?$person_name); } 构建新的Group 注册一个新的Group,并将之前创建的Person加入这个Group。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // the name of group for testing $group?=?sample_group; // generate a new group, add people into group create_group($api,?$group,?$person_names); ?????????????????????????? /* ?*? generate a new group with group_name, add all people into group ?*/ function?create_group($api,?$group_name,?$person_names) { ????// delete

文档评论(0)

561190791 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档