2017 © Pedro Peláez
 

library face-sdk

PHP SDK for face recognition using faceplusplus.com

image

nguyenvanduocit/face-sdk

PHP SDK for face recognition using faceplusplus.com

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 100 % Grown

The README.md

FaceSDK

This SDK is the wrapper for faceplusplus.com's API. Provides modern ways to use the API in PHP., (*1)

Install

It's very easy to install via composer, (*2)

composer require nguyenvanduocit/face-sdk

Register API

This API is free to use, you can register your application at FacePlusPlus to get apiKey and apiSecretKey., (*3)

Usage

require_once '../vendor/autoload.php';
use FaceSDK\Node\RecognizedImage;
$faceAPI = new \FaceSDK\FaceSDK( 'YOUR_API', 'YOUR_API', 'http://apicn.faceplusplus.com' );
$response  = $faceAPI->post( '/detection/detect', [
    'url' => 'http://2anhdep.vn/wp-content/uploads/2014/11/anh-ngoc-trinh-dep-trong-nhung-bo-noi-y-xuyen-thau-khien-nguoi-xem-do-mat-6.jpg',
    'attribute'=>'glass,gender,age,race,smiling,glass,pose'
] );

/** @var RecognizedImage $detectedImage */
$detectedImage = $response->getRecognizedImage();
var_dump('$detectedImage', $detectedImage);

/** @var \FaceSDK\Node\RecognizedFace[] $faces */
$faces = $detectedImage->getFaces();
var_dump('$faces', $faces);

/** @var \FaceSDK\Node\RecognizedFaceAttribute $attrs */
$attrs =  $faces[0]->getAttributes();
var_dump('$attrs', $attrs);

Example

There are two example in folder example :, (*4)

  • face-hightlight.php : Draw a rectangle around main face, and tell if she/he is smiling
  • face-recognize.php : The demo with the example code below.

TODO

Contribute

Feel free to make PR, (*5)

Development

This SDK was shipped with many implement and lesson from Facebook PHP SDK., (*6)

The Versions

12/10 2015

dev-master

9999999-dev

PHP SDK for face recognition using faceplusplus.com

  Sources   Download

MIT

The Requires

 

The Development Requires

10/10 2015

v0.1-beta.1

0.1.0.0-beta1

PHP SDK for face recognition using faceplusplus.com

  Sources   Download

MIT

The Requires

 

The Development Requires