dev-master
9999999-devPhpKairos is a nice client for the Kairos Face Recognition API
MIT
The Requires
- php >=5.5
- guzzlehttp/guzzle ~5.3|~6.0.1|~6.1
The Development Requires
sdk kairos phpkairos
Wallogit.com
2017 © Pedro Peláez
PhpKairos is a nice client for the Kairos Face Recognition API
PhpKairos is a nice client for the Kairos Face Recognition API, (*1)
status: Stable Please report any bugs you find so that we can improve the library for everyone., (*2)
Main public repository of PhpKairos is hosted at https://github.com/ympons/PhpKairos.git., (*3)
To install most recent version of library, just type, (*4)
git clone https://github.com/ympons/PhpKairos.git
where you want its file to be located., (*5)
If you have not already installed globally, you have to download composer. Just run this command inside your PhpKairos directory., (*6)
php -r "readfile('https://getcomposer.org/installer');" | php
Now get the required libraries to work with PhpKairos:, (*7)
php composer.phar --no-dev install
If you already have a composer installed or your existing project use it, you can install/add PhpKairos via Composer https://packagist.org/packages/ympons/phpkairos, it is linked to this GitHub repository ( so it is everytime updated ), and add it as dependecy to your project., (*8)
php composer.phar require "ympons/phpkairos:dev-master" --update-no-dev
PhpKairos specify autoload information, Composer generates a vendor/autoload.php file. You can simply include this file and you will get autoloading for free and declare the use of PhpKairos Client with fully qualified name., (*9)
require "vendor/autoload.php"; use PhpKairos\PhpKairos;
$api = 'http://api.kairos.com/'; $app_id = 'your_app_id'; $app_key = 'your_app_key'; $client = new PhpKairos( $api, $app_id, $app_key );
The image parameter must be a publicly accessible URL or Base64 encoded photo, (*10)
$image = 'http://media.kairos.com/kairos-elizabeth.jpg'; $subject_id = 'subject1'; $gallery_name = 'gallerytest1'; $options = [ 'selector' => 'SETPOSE', 'symmetricFill' => true ]; $response = $client->enroll($image, $subject_id, $gallery_name, $options); $result = $response->getBody()->getContents();
The image parameter must be a publicly accessible URL or Base64 encoded photo, (*11)
$image = 'http://media.kairos.com/kairos-elizabeth.jpg'; $gallery_name = 'gallerytest1'; $response = $client->recognize($image, $gallery_name); $result = $response->getBody()->getContents();
The image parameter must be a publicly accessible URL or Base64 encoded photo, (*12)
$encodedImage = 'iVBORw0KGgoAAA ... ABJRU5ErkJggg==\r\n'; $response = $client->detect($encodedImage); $result = $response->getBody()->getContents();
Lists out all the galleries you have created, (*13)
$response = $client->listGalleries(); $result = $response->getBody()->getContents();
Lists out all the subjects you have enrolled in a gallery, (*14)
$gallery_name = 'gallerytest1'; $response = $client->viewGallery($gallery_name); $result = $response->getBody()->getContents();
$gallery_name = 'gallerytest1'; $response = $client->removeGallery($gallery_name); $result = $response->getBody()->getContents();
Removes a subject you have enrolled within a gallery, (*15)
$subject_id = 'subject1'; $gallery_name = 'gallerytest1'; $response = $client->removeSubject($subject_id, $gallery_name); $result = $response->getBody()->getContents();
MIT License, see LICENSE.md., (*16)
PhpKairos is a nice client for the Kairos Face Recognition API
MIT
sdk kairos phpkairos