awssat / imageai
PHP中imageAi的包装器
v1.2
2020-10-24 15:21 UTC
Requires
- php: ^7.1
- intervention/image: ^2.4
- symfony/filesystem: ^4.3
- symfony/process: ^4.0
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-09-25 00:19:34 UTC
README
针对https://github.com/OlafenwaMoses/ImageAI 的PHP解决方案。借助Python库在PHP中尝试AI功能
需求
首先,您需要安装具有所有需求的https://github.com/OlafenwaMoses/ImageAI
安装
通过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 ] ]
您应该始终定义一个OlafenwaMoses/ImageAI支持的模型
模型类型
RetinaNet
YOLOv3
TinyYOLOv3
您必须通过以下链接下载RetinaNet、YOLOv3或TinyYOLOv3目标检测模型
- RetinaNet (大小 = 145 mb,高性能和高精度,检测时间较长)
- YOLOv3 (大小 = 237 mb,性能和精度适中,检测时间适中)
- TinyYOLOv3 (大小 = 34 mb,针对速度和性能优化,检测时间快)
其他用例
速度
您可以通过简单调用来定义检测速度(影响精度)
$imageAi = imageAi::image($img)->speed('fast')->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();
支持的速度(快速、更快、最快、闪光)
特定对象
您只能检测自定义对象
$imageAi = imageAi::image($img)->customObjects(['car'])->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();
百分比
定义检测过程的最低百分比
$imageAi = imageAi::image($img)->customObjects(['car'])->percentage(90)->model('RetinaNet', '/path/to/resnet50_coco_best_v2.0.1.h5')->detect();
贡献
非常欢迎您对此包做出贡献并改进。
致谢
许可
MIT许可证(MIT)。有关更多信息,请参阅许可证文件