andaris / computer-vision-client
Microsoft Computer Vision API 的简单 PHP 客户端
0.2.0
2018-02-07 08:06 UTC
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: ~6.2
Requires (Dev)
- phpunit/phpunit: ~5.7
- squizlabs/php_codesniffer: ~2.6
This package is not auto-updated.
Last update: 2024-09-20 21:57:46 UTC
README
计算机视觉 API 客户端
此库提供了一个简单客户端,用于使用 Microsoft Computer Vision API 和 Guzzle PHP HTTP 客户端。
要求
- PHP 5.5 或更高版本
- PHP CURL 扩展
安装(Composer)
此库作为一个 Composer 包 发布,因此推荐使用 Composer 安装。
将 computer-vision-client
添加到您的应用的 composer.json
文件中
{ "require": { "andaris/computer-vision-client": "0.1.0" } }
导航到您的项目根目录并运行
$ composer install
确保 Composer 自动加载器在您的项目引导文件中。
使用方法
use Andaris\ComputerVision\Client; $imageData = file_get_contents('/path/to/image.jpg'); $client = new Client('14758f1afd44c09b7992073ccf00b43d'); // Insert your API key $result = $client->analyze($imageData, [Client::FEATURE_CATEGORIES, Client::FEATURE_TAGS]);
测试
可以通过 vendor/bin/phpunit
运行 PHPUnit 测试套件。