softon/laravel-face-detect
Laravel-Face-Detect
A Laravel Package for Face Detection and Cropping in Images.
Installation
- Edit the composer.json add to the require array & run composer update
"softon/laravel-face-detect": "dev-master"composer update - Add the service provider to the config/app.php file in Laravel
'Softon\LaravelFaceDetect\FaceDetectServiceProvider', - Add an alias for the Facade to the config/app.php file in Laravel
'FaceDetect' => 'Softon\LaravelFaceDetect\Facades\FaceDetect', - 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/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| | MIT | |
| v0.2.1 | >=5.3 | ~5.6.0| | MIT | |
| v0.2.0 | >=5.3 | ~5.6.0| | MIT | |
| v0.1.0 | >=5.3 | ~5.0| | MIT |