ridvanbaluyos/face
最新稳定版本:v1.1
Composer 安装命令:
composer require ridvanbaluyos/face
包简介
A PHP Library built for the Microsoft's Face API.
README 文档
README
A PHP Library built for the Microsoft's Cognitive Services.
Cognitive Services: Face API
Table of contents
Requirements
Kindly subscribe for an API key to Microsoft's Cognitive Services API page.
Installation
Open your composer.json file and add the following to the require key:
"ridvanbaluyos/face": "v1.1"
After adding the key, run composer update from the command line to install the package
composer install
or
composer update
Configuration
Add your subscription key in src/Ridvanbaluyos/Face/config.json file
{
"url" : "https://westus.api.cognitive.microsoft.com/face/v1.0/detect",
"subscriptionKey" : "zWwPD7BGWYEArX6u6QxvS25TTsNge2Qw"
}
Usage
<?php // namespace and autoloaders use Ridvanbaluyos\Face\FaceDetection as FaceDetection; require_once __DIR__ . '/vendor/autoload.php'; // let's use Justin Bieber's photo $image = array( 'url' => 'http://img2.timeinc.net/people/i/2014/database/140831/justin-bieber-300.jpg', ); // instantiate face detection object $face = new FaceDetection($image); ?>
Detecting a face
$face->getFaces();
Analyzing Face Landmarks
$face->analyzeFaceLandmarks()->getFaces();
Analyzing Face Attributes
$face->analyzeFaceAttributes()->getFaces();
Chaining options
$face->analyzeFaceLandmarks()->analyzeFaceAttributes()->getFaces();
Alternatively, you can analyze all possible options
$face->analyzeAll()->getFaces();
References
统计信息
- 总下载量: 322
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-05