1. Go to this page and download the library: Download clarifai/clarifai-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
clarifai / clarifai-php example snippets
use Clarifai\API\ClarifaiClient;
use Clarifai\DTOs\Inputs\ClarifaiURLImage;
use Clarifai\DTOs\Outputs\ClarifaiOutput;
use Clarifai\DTOs\Predictions\Concept;
use Clarifai\DTOs\Searches\SearchBy;
use Clarifai\DTOs\Searches\SearchInputsResult;
use Clarifai\DTOs\Models\ModelType;
// Skip the argument to fetch the key from the CLARIFAI_API_KEY env. variable
$client = new ClarifaiClient('YOUR_API_KEY');
$model = $client->publicModels()->generalModel();
$response = $model->batchPredict([
new ClarifaiURLImage('https://samples.clarifai.com/metro-north.jpg'),
new ClarifaiURLImage('https://samples.clarifai.com/wedding.jpg'),
])->executeSync();