https://github.com/kwn/recognizeim
Recognize.im PHP client. Allows image recognizing, includes REST and SOAP API
https://github.com/kwn/recognizeim
Last synced: 4 months ago
JSON representation
Recognize.im PHP client. Allows image recognizing, includes REST and SOAP API
- Host: GitHub
- URL: https://github.com/kwn/recognizeim
- Owner: kwn
- Created: 2015-01-08T14:05:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-16T12:46:48.000Z (about 10 years ago)
- Last Synced: 2024-12-18T01:49:30.336Z (6 months ago)
- Language: PHP
- Homepage:
- Size: 355 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Recognize.im API
===============
[](https://codeclimate.com/github/kwn/RecognizeIm)Recognize.im provides API for Image Recognition. Before use you need to visit [http://www.recognize.im/](http://recognize.im/) and create an account. After sign in go to the user profile section and obtain: ```Your Client ID```, ```Your API Key``` and ```Your CLAPI Key```.
Installation
------------Add package to your composer.json
```
"kwn/recognizeim": "~1.0"
```Run update command
```
php composer.phar update kwn/recognizeim
```Done. Now you can use RecognizeIm classes.
Usage
-----```php
use RecognizeIm\Client\RestApi;
use RecognizeIm\Client\SoapApi;
use RecognizeIm\Configuration;
use RecognizeIm\Model\Image;
use RecognizeIm\RecognizeImApi;// [...]
// create a configuration object first
$configuration = new Configuration('CLIENT_ID', 'API_KEY', 'CLAPI_KEY');// depending on your needs you can use soap or rest api
$soapApi = new SoapApi($configuration);
$restApi = new RestApi($configuration, new ImageVerificator());// or you can create an object that includes both apis (useful for dependency injection containers)
$recognizeim = new RecognizeImApi($soapApi, $restApi);// now you can use soap api functions or rest api recognize method
// create an image and call recognize method
$image = new Image('/home/kwn/Pictures/red.jpg');
$result = $recognizeim->getRestApiClient()->recognize($image, 'multi');
```Authorization
-------------You don't need to call method auth by yourself. Module object will authorize you when needed, you just need do provide valid credentials. You can get them from your [account tab](http://recognize.im/user/profile).