PHP code example of hybo / face-recognition

1. Go to this page and download the library: Download hybo/face-recognition library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hybo / face-recognition example snippets



aceRecognition\Client;

$config = [
    'baidu' => [
        'app_id' => '',
        'api_key' => '',
        'secret_key' => '',
    ],
    'face++' => [
        'api_key' => '',
        'api_secret' => '',
    ],
    'tencent-youtu' => [
        'app_id' => '',
        'secret_id' => '',
        'secret_key' => '',
        'user_id' => 'QQ号',
    ],
];

$image = '图片URL';

$client = new Client($config);

$client->driver('baidu')->detect($image);
$client->driver('face++')->detect($image);
// ...

PHP >= 7.1