2017 © Pedro Peláez
 

library faceplusplus

Face ++ Library for PHP

image

amitkkhanchandani/faceplusplus

Face ++ Library for PHP

  • Monday, May 7, 2018
  • by AmitKKhanchandani
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Face++

Uses Face++ v3 US Server., (*1)

Installation

composer require amitkkhanchandani/faceplusplus:dev-master

Examples:

Namespace

use Amitk\Faceplusplus\Facepp;

Get Face Token

$api_key = env('FACEPP_API_KEY',null);
$api_secret = env('FACEPP_API_SECRET',null);
$facepp = new Facepp($api_key, $api_secret);
$params = array(
    'image_url'    =>   '<--Image Absolute URL-->'
);
$response = $facepp->execute('/detect',$params);

$response = json_decode(json_encode($response));
if($response->http_code == 200){
    $data = json_decode($response->body);
    //Token Data is in the $data variable
}
else{
    //Handle if response is not 200.
}

Face Compare

$api_key = env('FACEPP_API_KEY',null);
$api_secret = env('FACEPP_API_SECRET',null);
$facepp = new Facepp($api_key, $api_secret);
$params = array(
    'face_token1'   =>  '<Face Token 1>',
    'face_token2'   =>  '<Face Token 2>'
);
$response = $facepp->execute('/compare',$params);

$response = json_decode(json_encode($response));
if($response->http_code == 200){
    $data = json_decode($response->body);
    /** Data Available
     *  confidence
        request_id
        time_used
        thresholds  */
    $confidence = $data->confidence;
    // Handle Confidence Level.
    return $confidence;
}
else{
    //Handle if response is not 200.
}

More APIS Details on Face++ Doc Center, (*2)

Copyright (c) 2018, Amit K Khanchandani and Contributors. All Rights Reserved., (*3)

This project is licenced under the MIT License., (*4)

The Versions

07/05 2018

dev-master

9999999-dev

Face ++ Library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Amit K Khanchandani

faceplusplus