fabriceclementz / clarifai-php
A PHP client for the Clarifai API.
Installs: 2 686
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 1
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- mockery/mockery: ^0.9.8
- phpunit/phpunit: ^6.0
This package is not auto-updated.
Last update: 2025-04-13 05:03:36 UTC
README
A PHP client for the Clarifai API.
Work in progress.
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