library clarifai-php
A PHP client for the Clarifai API.
fabriceclementz/clarifai-php
A PHP client for the Clarifai API.
- Sunday, February 19, 2017
- by fabriceclementz
- Repository
- 1 Watchers
- 1 Stars
- 885 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 14 % Grown
Clarifai API Client
, (*1)
A PHP client for the Clarifai API., (*2)
Work in progress., (*3)
Installation
Via composer
composer require fabriceclementz/clarifai-php
Usage
Fetch an access token
use GuzzleHttp\Client as HttpClient;
use Fab\Clarifai\Client;
// Instantiate a new client.
$client = new Client(new HttpClient(), 'CLIENT_ID', 'CLIENT_SECRET');
// Fetch an access token.
$response = $client->accessToken();
Predict the content of an image
$response = $client
->withAccessToken($response['access_token'])
->predict(['https://samples.clarifai.com/metro-north.jpg']);
Testing
composer test