Closed devanshah2 closed 6 years ago
@devanshah2 Thanks for reporting the issue. The reason why the classify
method is using the default
classifier is because you're not passing classifier_ids
as a top level parameter.
In the current version of the SDK, The classify
operation expects classifier_ids
as a top level parameter.
Try the following, and it should resolve your issue:
var vizParams = {
images_file: fs.createReadStream(path.join(__dirname, "image1.png")),
classifier_ids: ["<custom ID>"]
};
I am closing the issue, but please feel free to reopen if you're still having problems.
Description
Issues that was found was with in, https://github.com/watson-developer-cloud/node-sdk where it did not work when custom classifier IDs were provided. The specific issue in the code was at: https://github.com/watson-developer-cloud/node-sdk/blob/master/visual-recognition/v3.js#L271 There was a change in the extend that causes an merge to not work anymore and it would always default to
default
classifier so it would never use the custom one provided.Steps to reproduce
Following is an example NodeJS script that can he used to testing things, once an APIKey and custom classifier is created and the ID(s) are provided.
Expected Behaviour
Takes the custom classifier_ids provided and applies this classifier instead of default.
Actual Behaviour
When custom classifier_ids are provided it only does the classification with
default
Node version: 8.9.1
SDK Version: 2.42.0