Skip to content

Commit

Permalink
Merge pull request #523 from watson-developer-cloud/522-vis-rec-example
Browse files Browse the repository at this point in the history
fix(Visual Recognition V3): Fixed example to not send null _classifierID. Revised service to send a proper filename
  • Loading branch information
mediumTaj committed Feb 26, 2019
2 parents 40a7950 + aad0da2 commit 9e7ede7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private IEnumerator Examples()
Log.Debug("ExampleVisualRecognition.Examples()", "Attempting to classify via image on file system");
string imagesPath = Application.dataPath + "/Watson/Examples/ServiceExamples/TestData/visual-recognition-classifiers/giraffe_to_classify.jpg";
string[] owners = { "IBM", "me" };
string[] classifierIDs = { "default", _classifierID };
string[] classifierIDs = { "default" };
if (!_visualRecognition.Classify(OnClassifyPost, OnFail, imagesPath, owners, classifierIDs, 0.5f))
Log.Debug("ExampleVisualRecognition.Classify()", "Classify image failed!");

Expand Down
2 changes: 1 addition & 1 deletion Scripts/Services/VisualRecognition/v3/VisualRecognition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public bool Classify(SuccessCallback<ClassifiedImages> successCallback, FailCall
if (imageData != null)
{
req.Forms = new Dictionary<string, RESTConnector.Form>();
req.Forms.Add("images_file", new RESTConnector.Form(imageData, imageMimeType));
req.Forms.Add("images_file", new RESTConnector.Form(imageData, "image" + Utility.GetExtension(imageMimeType), imageMimeType));
}

return connector.Send(req);
Expand Down

0 comments on commit 9e7ede7

Please sign in to comment.