awssat/imageai

Wrapper for imageAi in PHP

v1.2 2020-10-24 15:21 UTC

This package is auto-updated.

Last update: 2024-12-25 00:50:32 UTC


README

Php soultion for https://github.com/OlafenwaMoses/ImageAI . try AI features in Php with help of python libraries

Requirements

First you need to install https://github.com/OlafenwaMoses/ImageAI with all requirements

Install

Via Composer

composer require awssat/imageai

Usage

$imageAi = imageAi::image($img)->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();
Result
$imageAi->results = 
        [
            [
                "name": "car"
                "percentage": 97.267699241638
                "box_points": [
                                1392
                                116
                                3541
                                1276
                            ]
                "image": Intervention\Image\Image //object iamge
            ]
      ]

you should always define a model that supported in OlafenwaMoses/ImageAI

Model types

RetinaNet
YOLOv3
TinyYOLOv3

you must download the RetinaNet, YOLOv3 or TinyYOLOv3 object detection model via the links below:

- RetinaNet (Size = 145 mb, high performance and accuracy, with longer detection time)

- YOLOv3 (Size = 237 mb, moderate performance and accuracy, with a moderate detection time)

- TinyYOLOv3 (Size = 34 mb, optimized for speed and moderate performance, with fast detection time)

Other use cases

Speed

You can define speed of detection (affect accuracy) by simply calling

$imageAi = imageAi::image($img)->speed('fast')->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();

supported speeds (fast, faster, fastest, flash)

Specfic objects

You can only detect custom objects

$imageAi = imageAi::image($img)->customObjects(['car'])->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();

Percentage

Define a minimum percentage of detection proccess

$imageAi = imageAi::image($img)->customObjects(['car'])->percentage(90)->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();

Contributing

You are very welcome to contribute and improve this package.

Credits

License

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