Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freearhey/laravel-face-detection
A Laravel Package for Face Detection.
https://github.com/freearhey/laravel-face-detection
Last synced: 17 days 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-07T19:38:31.000Z (11 months ago)
- Last Synced: 2024-10-14T17:19:02.599Z (30 days ago)
- Language: PHP
- Size: 597 KB
- Stars: 31
- Watchers: 5
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Face Detection [![Build Status](https://app.travis-ci.com/freearhey/laravel-face-detection.svg?branch=master)](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)