livijn/laravel-object-detection

Uses ML to detect objects

3.0.3 2023-03-30 13:57 UTC

This package is auto-updated.

Last update: 2024-03-30 00:37:45 UTC


README

Latest Version on Packagist Total Downloads

This package detects faces in an image using Machine Learning, TensorFlow and the MediaPipe Face Detection model.

Example

Installation

You can install the package via composer:

composer require livijn/laravel-object-detection

You should add this to your composer.json file to ensure that our package is fully installed.

"scripts": {
    "post-install-cmd": [
        "@php artisan object-detection:install"
    ]
}

Installation on Laravel Forge

If you are deploying on Laravel Forge, make sure you have sufficient node & npm versions. You can read this article on how to update nodejs on Forge.

To update npm, just run sudo npm install -g npm@latest on your server.

I have only verified this works with these versions:

  • node >= 16
  • npm >= 7

Usage

LaravelObjectDetection::getObjectsFromImageUrl('https://some-url.com/some-image.jpg');

// Returns an ImageObject
// [{"class":"dog","score":0.973773181438446,"boundingBox":[239.84360694885254,75.59387746453285,505.188524723053,590.4131692349911]}]

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email ouff@live.se instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.