fabriceclementz/clarifai-php

A PHP client for the Clarifai API.

v0.1.0 2017-02-19 15:46 UTC

This package is not auto-updated.

Last update: 2024-05-12 00:53:17 UTC


README

Latest Stable Version Total Downloads License Build Status Build Status Scrutinizer Code Quality

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