json - Bluemix Visual recognition service working with curl command for custom classifiers but returning result for default classifer with node application -
i trying visual recognition service, trained sample images , created custom classifier. when testing curl command working fine , returning result classifier mentioned in params.json. same not working node application, seems neglecting params.json while processing. params.json
{"classifier_ids": ["<classifierid>"] }
curl command working.
curl -x post -f "images_file=@virt.jpg" -f "parameters=@params.json" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key=<api_key>&version=2016-05-20"
below node application code returns result "default" classifier
var visual_recognition = new watson.visualrecognitionv3({ api_key: 'api_key', version_date: '2016-05-20' }); var params = { images_file: fs.createreadstream('virt.jpg'), parameters: fs.readfilesync('params.json'), };
even tried 1. putting threshold 0.0 params.json 2. using json.stringify on parameters.
it returing resilt default classifer.
any help/suggestion highly appreciated.
thanks, vishwas
this got resolved adding classifier id in params images_file
var params = {images_file: fs.createreadstream('image.jpg'),classifier_ids:[ "classifier_id" ]};
seems documentation misleading or there way pass classifier ids.
Comments
Post a Comment