PHP code example of freearhey / laravel-face-detection

1. Go to this page and download the library: Download freearhey/laravel-face-detection 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/ */

    

freearhey / laravel-face-detection example snippets


'providers' => [
  ...
  Arhey\FaceDetection\FaceDetectionServiceProvider::class,
  ...
],

use Arhey\FaceDetection\Facades\FaceDetection;

$face = FaceDetection::extract('path/to/image.jpg');

if($face->found) {
  // face found
} else {
  // face not found
}

var_dump($face->bounds);

/*
  array(
    'x' => 292.0,
    'y' => 167.0,
    'w' => 204.8,
    'h' => 204.8,
  )
*/

$face->save('path/to/output.jpg');
sh
php artisan vendor:publish