meilunzhi/ai
Composer 安装命令:
composer require meilunzhi/ai
包简介
php
关键字:
README 文档
README
v1.30支持腾讯云人脸识别(2018-12-7)v1.20支持百度图片搜索(2018-8-13)v1.10支持百度人体分析(2018-8-7)
Recent Test
- 所有API在2018-01-11通过测试
Develop documents
Feature
- 统一AI平台SDK调用方法;
- 像查询数据库一样优雅调用API;
- 所传参数和原平台开发文档保持一致,节约开发者学习成本
Support platform(支持的平台)
1.百度AI开放平台
4.腾讯云人脸识别
SimpleTest
-
下载zip包 或者clone本项目
-
进入本项目根目录,执行
composer install,(包管理工具composer) -
在项目目录
tests->config下面添加配置文件ai.php(需要自己到各平台注册获取试用账号),内容如:return [ 'debug' => true, 'log' => [ 'level' => 'debug', 'file' => './tests/logs/ai.log',//日志相对路径 'template' => "<<<<<<<<\n{response}\n--------\n{error}",//日志模版 ], 'baidu' => [ 'app_id' => '***', 'app_key' => '***', 'secret_key' => '***', ], 'youtu' => [ 'app_id' => '***', 'secret_id' => '***', 'secret_key' => '***', 'user_id' => '*' ], 'face_plus' => [ 'api_key' => '***', 'api_secret' => '***', ], 'qcloud' => [//腾讯云 'app_id' => '***', 'secret_id' => '***', 'secret_key' => '***', ] ];
-
在命令行下进入根目录,执行命令,比如测试腾讯优图人脸识别:
vendor/phpunit/phpunit/phpunit --testdox tests/Youtu/Face/FaceTest.php
Installation
composer require hahaxixi/ai
Usage
1.一般使用
$config = [ 'log' => [...],//如,laravel:'file' => storage_path('logs/ai.log'), 'baidu' => [...], 'youtu' => [...], 'face_plus' => [...], ]; //百度 $result = Entry::Baidu($config)->face->select('detect')->where(['image' => file_get_contents(__DIR__ . '/file/face_detect.jpeg'), 'id_card_side' => 'front'])->get(); //腾讯优图 $result = Entry::Youtu($config)->face->select('detectface')->where(['url' => 'http://open.youtu.qq.com/app/img/experience/face_img/face_06.jpg', 'mode' => 1])->get(); //face++ $result = Entry::FacePlus($config)->face->select('detect')->where(['image_file' =>__DIR__ . '/../../file/face_01.jpg' , 'return_attributes' => 'skinstatus'])->get(); //腾讯云 $result = Entry::Qcloud($config)->face->select('identify')->where(['image' => __DIR__ . '/../../file/face_01.jpg', 'appid' => $config['qcloud']['app_id'], 'group_ids' => ["tencent"]])->get();
2.Laravel使用
- 项目目录
config下面添加配置文件ai.php,配置内容和上文SimpleTest一致 - 一行代码调用人脸检测示例
$result = Entry::Baidu(config('ai'))->face->select('detect')->where(['image' => file_get_contents(__DIR__ . '/file/face_detect.jpeg'), 'id_card_side' => 'front'])->get();
3.Yii2使用
- 在配置文件
params-local.php添加
'ai'=>[ 'log' => [...], 'face_plus' => [...], 'baidu' => [...], 'youtu' => [...], ],
- 一行代码调用人脸检测示例
$result = Entry::Baidu(Yii::$app->params['ai'])->face->select('detect')->where(['image' => file_get_contents(__DIR__ . '/file/face_detect.jpeg'), 'id_card_side' => 'front'])->get();
License
Apache License Version 2.0 see Apache License
meilunzhi/ai 适用场景与选型建议
meilunzhi/ai 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「ai」 「recognize」 「intelligent」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 meilunzhi/ai 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 meilunzhi/ai 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 meilunzhi/ai 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP library to generate linear and bidimensional barcodes
Parser and formatter for human-friendly memory or file sizes based on standards
php
Service to scrape a web page easily without knowing their HTML structure.
Alfabank REST API integration
Rinvex Attributes is a robust, intelligent, and integrated Entity-Attribute-Value model (EAV) implementation for Laravel Eloquent, with powerful underlying for managing entity attributes implicitly as relations with ease. It utilizes the power of Laravel Eloquent, with smooth and seamless integratio
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-14