New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

freearhey/laravel-face-detection

A Laravel Package for Face Detection and Cropping in Images.
3,357 43
Install
composer require freearhey/laravel-face-detection
Latest Version:v1.4.0
PHP:^8.1
Laravel:9
Older releases:5 – 8
License:MIT
Last Updated:Dec 7, 2023
Links: GitHub  ·  Packagist
Maintainer: Arhey

Face Detection Build Status

A Laravel Package for Face Detection.

Installation

  1. Install the package via composer:
composer require freearhey/laravel-face-detection
  1. Add the service provider to the config/app.php file in Laravel:
'providers' => [
  ...
  Arhey\FaceDetection\FaceDetectionServiceProvider::class,
  ...
],
  1. Publish the config file by running:
php artisan vendor:publish

Usage

use Arhey\FaceDetection\Facades\FaceDetection;

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

To detect if face is found in a image:

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

To get the facial boundaries:

var_dump($face->bounds);

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

To save the found face image:

$face->save('path/to/output.jpg');

Testing

vendor/bin/phpunit

License

MIT

Related Packages

softon/laravel-face-detect

A Laravel Package for Face Detection and Cropping in Images.

26,572 57
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607

Version History

Version Released PHP Laravel License
v1.4.0 ^8.1 ^9.0 MIT
1.3.0 ^7.3| ^8.0 ^8.0 MIT
1.2.0 ^7.3 ^8.0 MIT
1.1.0 ^7.0 ^7.0 MIT
1.0.5 ^7.0 ~5.0|~6.0 MIT