New

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

softon/laravel-face-detect

A Laravel Package for Face Detection and Cropping in Images.
26,572 57
Install
composer require softon/laravel-face-detect
Latest Version:v0.2.2
PHP:>=8.0
Laravel:5 – 9
License:MIT
Last Updated:Mar 15, 2023
Links: GitHub  ·  Packagist
Maintainer: softon

Laravel-Face-Detect

A Laravel Package for Face Detection and Cropping in Images.

Installation

  1. Edit the composer.json add to the require array & run composer update
     "softon/laravel-face-detect": "dev-master" 
     composer update 
  2. Add the service provider to the config/app.php file in Laravel
     'Softon\LaravelFaceDetect\FaceDetectServiceProvider', 
  3. Add an alias for the Facade to the config/app.php file in Laravel
     'FaceDetect' => 'Softon\LaravelFaceDetect\Facades\FaceDetect', 
  4. Publish the config file by running
     php artisan vendor:publish 

Usage

To extract the Face and save the cropped image use...

use \Softon\LaravelFaceDetect\Facades\FaceDetect;


FaceDetect::extract($imagefilepath)->save($savefilepath);

To extract the Face and return the cropping coordinates without cropping the image...

use \Softon\LaravelFaceDetect\Facades\FaceDetect;


$crop_params = FaceDetect::extract($imagefilepath)->face;   // return array with x,y,width

To detect if face is found in a image...

use \Softon\LaravelFaceDetect\Facades\FaceDetect;


$crop_params = FaceDetect::extract($imagefilepath)->face_found;     // returns true/false

You may edit the config file facedetect.php in the config directory to add aditional padding to the cropped Images.

Related Packages

freearhey/laravel-face-detection

A Laravel Package for Face Detection and Cropping in Images.

3,357 43
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
v0.2.2 >=8.0 ~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0 MIT
v0.2.1 >=5.3 ~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0 MIT
v0.2.0 >=5.3 ~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0 MIT
v0.1.0 >=5.3 ~5.0|~6.0 MIT