Reputation: 53
I was about to create a new classifier and train the visual recognition with pictures, but I got this error code which is stated in title when I curl following command
curl -u "0xxxxxxxxxxx":"vxxxxxxxxxxxxxx" \
-X POST \
-F "[email protected]" \
-F "[email protected]" \
-F "name=plasticbottle" \
-k "https://gateway.watsonplatform.net/visual-recognition-beta/api/v2/classifiers?version=2015-12-02"
Upvotes: 2
Views: 806
Reputation: 597
I'm not sure what was the problem using V2 api, but now, using V3 API your CURL should look like this example
curl -X POST
-F "[email protected]"
-F "[email protected]"
-F "orange_positive_example=@pos_ex.zip"
-F "[email protected]"
-F "name=fruit"
"https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers?api_key={api-key}&version=2016-05-20"
So your CURL for bottle should be like
curl -X POST
-F "[email protected]"
-F "[email protected]"
-F "name=plasticbottle"
"https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers?api_key={api-key}&version=2016-05-20"
Note that you now should use an api_key to authenticate and no longer a user/pass
This is documented in the v3 doc: https://www.ibm.com/watson/developercloud/visual-recognition/api/v3/#create_a_classifier
Upvotes: 1
Reputation: 3233
To set the classifiers you want to use you have to send a JSON containing something like:
{"classifier_ids": ["ClassifierName"]}
So your curl should be something like:
curl -u "username":"pwd" \
-X POST \
-F "[email protected]" \
-F "classifier_ids={\"classifier_ids\":[\"ClassifierName\"]}"
"https://gateway.watsonplatform.net/visual-recognition-beta/api/v2/classify?version=2015-12-02"
Upvotes: 1