hymns/microsoft-cognitive-face

PHP client library for Face module in Microsoft Cognitive Services

v1.2 2018-12-29 17:30 UTC

This package is not auto-updated.

Last update: 2024-06-01 14:26:25 UTC


README

Latest Stable Version Total Downloads License

The cloud-based Face API provides developers with access to advanced face algorithms. Microsoft Cognitive Face algorithms analyze specificed face attribute detection such as age, gender, smile, hair and much more.

Requirements

Installation

You can use Composer or simply Download the Release

Composer

The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

composer require hymns/microsoft-cognitive-face

Finally, be sure to include the autoloader:

require_once '/path/to/your-project/vendor/autoload.php';

Download the Release

If you abhor using composer, you can download the package in its entirety. The Releases page lists all stable versions. Download any file with the name microsoft-cognitive-face-[RELEASE_NAME].zip for a package including this library and its dependencies.

Uncompress the zip file you download, and include the autoloader in your project:

require_once '/path/to/microsoft-cognitive-face/vendor/autoload.php';

Examples

Detect Faces from Image

// include your composer dependencies
require_once 'vendor/autoload.php';

$client = new \Hymns\MicrosoftCognitiveFace\Client('YOUR_APP_KEY', 'YOUR_REGION');
$faces = $client->face()->detectFacesFromImage('URL_IMAGE');

print_r($faces);

Verify Two Faces

// include your composer dependencies
require_once 'vendor/autoload.php';

$client = new \Hymns\MicrosoftCognitiveFace\Client('YOUR_APP_KEY', 'YOUR_REGION');
$result = $client->face()->verifyTwoFaces('FACE_ID_1', 'FACE_ID_2');

print_r($result);

Milestone Plan for Development

  • Detect Faces from Image
  • Verify Two Faces
  • Find Similar form FaceList
  • Identify Face from PersonGroup