https://github.com/softon/laravel-face-detect
A Laravel Package for Face Detection
https://github.com/softon/laravel-face-detect
crop-image face-detection laravel-5-package laravel-package
Last synced: 2 months ago
JSON representation
A Laravel Package for Face Detection
- Host: GitHub
- URL: https://github.com/softon/laravel-face-detect
- Owner: softon
- License: mit
- Created: 2016-04-11T05:48:26.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-15T05:36:54.000Z (about 2 years ago)
- Last Synced: 2025-02-02T02:45:30.312Z (3 months ago)
- Topics: crop-image, face-detection, laravel-5-package, laravel-package
- Language: PHP
- Size: 260 KB
- Stars: 57
- Watchers: 6
- Forks: 23
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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...
```php
use \Softon\LaravelFaceDetect\Facades\FaceDetect;FaceDetect::extract($imagefilepath)->save($savefilepath);
```To extract the Face and return the cropping coordinates without cropping the image...
```php
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...
```php
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.