Created
November 28, 2016 10:57
-
-
Save ytakky2014/eb0c5b473cee0e8e63bd51c2ebf827d7 to your computer and use it in GitHub Desktop.
Use Watson Visual Recognition Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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