A PHP Library built for the Microsoft's Face API.

v1.1 2017-02-10 12:03 UTC

This package is auto-updated.

Last update: 2021-02-12 12:02:37 UTC


A PHP Library built for the Microsoft's Cognitive Services.

Cognitive Services: Face API

Actively Maintained Latest Stable Version Total Downloads Scrutinizer Code Quality Build Status Codacy Badge License

Table of contents


Kindly subscribe for an API key to Microsoft's Cognitive Services API page.


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


composer update


Add your subscription key in src/Ridvanbaluyos/Face/config.json file

	"url" : "https://westus.api.cognitive.microsoft.com/face/v1.0/detect",
	"subscriptionKey" : "zWwPD7BGWYEArX6u6QxvS25TTsNge2Qw"


// 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


Analyzing Face Landmarks


Analyzing Face Attributes


Chaining options


Alternatively, you can analyze all possible options