Skip to content

Instantly share code, notes, and snippets.

@ytakky2014
Created November 28, 2016 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ytakky2014/eb0c5b473cee0e8e63bd51c2ebf827d7 to your computer and use it in GitHub Desktop.
Save ytakky2014/eb0c5b473cee0e8e63bd51c2ebf827d7 to your computer and use it in GitHub Desktop.
Use Watson Visual Recognition Sample
<?php
$api_url = env('WATSON_RECOGNITION_API_URL');
$api_key = env('WATSON_RECOGNITION_API_KEY');
$api_mode = "v3/classify";
$curl = new Curl();
$curl_url = $api_url . $api_mode;
$image_path = 'image_path';
$curl->get($curl_url, array(
'url' => $image_path,
'classifier_ids' => 'default',
'api_key' => $api_key,
'owners' => 'me',
'threshold' => 0.25,
'version' => '2016-05-20'
));
var_dump(json_decode($curl->response));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment