Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Visual Recognition V3): Fixed example to not send null _classifierID. Revised service to send a proper filename #523

Merged
merged 1 commit into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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