https://github.com/freearhey/laravel-face-detection
A Laravel Package for Face Detection.
https://github.com/freearhey/laravel-face-detection
Last synced: 2 months ago
JSON representation
A Laravel Package for Face Detection.
- Host: GitHub
- URL: https://github.com/freearhey/laravel-face-detection
- Owner: freearhey
- License: mit
- Created: 2019-11-07T19:22:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-07T19:38:31.000Z (over 1 year ago)
- Last Synced: 2025-03-16T09:12:08.820Z (2 months ago)
- Language: PHP
- Size: 597 KB
- Stars: 33
- Watchers: 4
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Face Detection [](https://app.travis-ci.com/freearhey/laravel-face-detection)
A Laravel Package for Face Detection.
## Installation
1. Install the package via composer:
```sh
composer require freearhey/laravel-face-detection
```2. Add the service provider to the `config/app.php` file in Laravel:
```php
'providers' => [
...
Arhey\FaceDetection\FaceDetectionServiceProvider::class,
...
],
```3. Publish the config file by running:
```sh
php artisan vendor:publish
```## Usage
```php
use Arhey\FaceDetection\Facades\FaceDetection;$face = FaceDetection::extract('path/to/image.jpg');
```To detect if face is found in a image:
```php
if($face->found) {
// face found
} else {
// face not found
}
```To get the facial boundaries:
```php
var_dump($face->bounds);/*
array(
'x' => 292.0,
'y' => 167.0,
'w' => 204.8,
'h' => 204.8,
)
*/
```To save the found face image:
```php
$face->save('path/to/output.jpg');
```## Testing
```sh
vendor/bin/phpunit
```## License
[MIT](LICENSE)