hymns / microsoft-cognitive-vision
PHP client library for Vision module in Microsoft Cognitive Services
Requires
- php: >=7.1
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2024-12-19 19:02:45 UTC
README
The cloud-based Vision API provides developers with access to advanced image algorithms. Microsoft Vision algorithms enable OCR attribute detection.
Requirements
Installation
You can use Composer or simply Download the Release
Composer
The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.
Once composer is installed, execute the following command in your project root to install this library:
composer require hymns/microsoft-cognitive-vision
Finally, be sure to include the autoloader:
require_once '/path/to/your-project/vendor/autoload.php';
Download the Release
If you abhor using composer, you can download the package in its entirety. The Releases page lists all stable versions. Download any file
with the name microsoft-cognitive-vision-[RELEASE_NAME].zip
for a package including this library and its dependencies.
Uncompress the zip file you download, and include the autoloader in your project:
require_once '/path/to/microsoft-cognitive-vision/vendor/autoload.php';
Examples
Analyze Image
// include your composer dependencies require_once 'vendor/autoload.php'; $client = new \Hymns\MicrosoftCognitiveVision\Client('YOUR_APP_KEY', 'YOUR_REGION'); $vision = $client->vision()->analyze('URL_IMAGE'); print_r($vision);
Describe Image
require_once 'vendor/autoload.php'; $client = new \Hymns\MicrosoftCognitiveVision\Client('YOUR_APP_KEY', 'YOUR_REGION'); $vision = $client->vision()->describe('URL_IMAGE'); print_r($vision);
Optical Character Recognition (OCR)
require_once 'vendor/autoload.php'; $client = new \Hymns\MicrosoftCognitiveVision\Client('YOUR_APP_KEY', 'YOUR_REGION'); $vision = $client->vision()->ocr('URL_IMAGE'); print_r($vision);