Php soultion for https://github.com/OlafenwaMoses/ImageAI . try AI features in Php with help of python libraries
First you need to install https://github.com/OlafenwaMoses/ImageAI with all requirements
Via Composer
composer require awssat/imageai
$imageAi = imageAi::image($img)->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();
$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
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)
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)
You can only detect custom objects
$imageAi = imageAi::image($img)->customObjects(['car'])->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();
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();
You are very welcome to contribute and improve this package.
The MIT License (MIT). Please see License File for more information.