PHPackages                             bobbyshaw/ibm-watson-visual-recognition - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bobbyshaw/ibm-watson-visual-recognition

ActiveLibrary[API Development](/categories/api)

bobbyshaw/ibm-watson-visual-recognition
=======================================

A PHP library to provide API calls &amp; handle authentication with the IBM Watson Visual Recognition

1.0.0(10y ago)7252Apache-2.0PHPPHP &gt;=5.5.0

Since Apr 6Pushed 10y ago3 watchersCompare

[ Source](https://github.com/bobbyshaw/ibm-watson-visual-recognition-php)[ Packagist](https://packagist.org/packages/bobbyshaw/ibm-watson-visual-recognition)[ Docs](https://github.com/bobbyshaw/watson-visual-recognition-php)[ RSS](/packages/bobbyshaw-ibm-watson-visual-recognition/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependencies (10)Versions (3)Used By (0)

IBM Watson Visual Recognition API
=================================

[](#ibm-watson-visual-recognition-api)

This PHP library provides integration with the [IBM Watson Visual Recognition](http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/visual-recognition.html)service.

See [API documentation](https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/visual-recognition/api/v2/).

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/de6b9cf2c84ef8f0815e9b3a76dbe9947273bea904948f00eff42ba7b152370b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626f626279736861772f776174736f6e2d76697375616c2d7265636f676e6974696f6e2d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/bobbyshaw/watson-visual-recognition-php/?branch=develop)[![Code Coverage](https://camo.githubusercontent.com/674628a8875a801cefe27bf145ccb5345c82139ea2ea20bc260120c68dd3aa70/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626f626279736861772f776174736f6e2d76697375616c2d7265636f676e6974696f6e2d7068702f6261646765732f636f7665726167652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/bobbyshaw/watson-visual-recognition-php/?branch=develop)[![Build Status](https://camo.githubusercontent.com/c5332588b915e8a895f85e7bbaabaa3cabb733ccd98f46737ac4aea7f4b90ec5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626f626279736861772f776174736f6e2d76697375616c2d7265636f676e6974696f6e2d7068702f6261646765732f6275696c642e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/bobbyshaw/watson-visual-recognition-php/build-status/develop)

Usage
-----

[](#usage)

The structure of this library was inspired by the [Omnipay](https://github.com/thephpleague/omnipay) suite of packages.

One of the things that this means is the library doesn't hide away that fact that API requests are being made. For each API request, the request should be created with parameters passed in, sent and then response reviewed.

All requests are available via the Client.

```
use Bobbyshaw\WatsonVisualRecognition\Client;
use Bobbyshaw\WatsonVisualRecognition\Classifier;

$client = new Client();

```

The client should then be initialized with parameters, e.g. username and password (your IBM Watson Service credentials).

```
$client->initialize(['username' => 'abcdef', 'password' => '12356])

```

The following can be used find default parameters

```
$client->getDefaultParameters();

```

Each method matches an API request and returns a request object ready to be sent. Most of the time you'll want to send the request straight away.

```
$request = $client->getClassifiers();
$response = $request->send();

```

Each response has a class which helps to manage the response, e.g with the Classifier and Image classes.

```
/** @var Classifier[] $classifiers */
$classifiers = $response->getClassifiers();

```

Commands
--------

[](#commands)

The library also comes with a set of commands to use on the command line

### Get Classifiers

[](#get-classifiers)

```
php app/console classifiers:get [-d|--version-date="..."] username password

```

### Classify Image(s)

[](#classify-images)

```
php app/console classifiers:classify [-c|--classifiers="..."] [-d|--version-date="..."] username password images

```

### Get Classifier Info

[](#get-classifier-info)

```
php app/console classifier:get [-d|--version-date="..."] username password classifier_id

```

### Create/Train Classifier

[](#createtrain-classifier)

```
php app/console classifier:create [-d|--version-date="..."] username password positive_examples negative_examples name

```

### Delete Classifier

[](#delete-classifier)

```
php app/console classifier:delete [-d|--version-date="..."] username password classifier_id

```

Testing
-------

[](#testing)

Run phpunit tests with:

```
vendor/bin/phpunit

```

This is also using grumphp to automatically check for PSR style formatting as well.

Test images are provided by [Pixabay](https://pixabay.com/).

Documentation
-------------

[](#documentation)

PHPDocumentor is being used for creating library documentation. So make sure to add function comments

```
vendor/bin/

```

You may need to install graphViz on your machine if you don't already have it. This can be done on mac with homebrew

```
brew install graphviz

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3688d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c5e630d2672ca47ff11a019429406169a9c5881bb7fb17c4a76662c48a18a077?d=identicon)[bobbyshaw](/maintainers/bobbyshaw)

---

Top Contributors

[![bobbyshaw](https://avatars.githubusercontent.com/u/553566?v=4)](https://github.com/bobbyshaw "bobbyshaw (61 commits)")

---

Tags

ibmphp-librarywatsonibmbluemixwatsonvisual recognition

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bobbyshaw-ibm-watson-visual-recognition/health.svg)

```
[![Health](https://phpackages.com/badges/bobbyshaw-ibm-watson-visual-recognition/health.svg)](https://phpackages.com/packages/bobbyshaw-ibm-watson-visual-recognition)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[spatie/laravel-export

Create a static site bundle from a Laravel app

646127.9k5](/packages/spatie-laravel-export)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
