Skip to content

Instantly share code, notes, and snippets.

@chughts
Created May 30, 2017 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chughts/9ae3bfc636cb397c031cdea19fe62316 to your computer and use it in GitHub Desktop.
Save chughts/9ae3bfc636cb397c031cdea19fe62316 to your computer and use it in GitHub Desktop.
Create Visual Recognition Custom Classifier

Makes use of, and synchronises two file injects before invoking the create classifier on Watson Visual Recognition.

You will need the Watson Visual Recognition and the File Inject Nodes.

[{"id":"7f5d173c.bb0578","type":"fileinject","z":"e0fbf5d6.9419a8","name":"Positive","x":102.5,"y":466,"wires":[["957c8509.801f88"]]},{"id":"36f7176.ff02ce8","type":"fileinject","z":"e0fbf5d6.9419a8","name":"Negative","x":99.5,"y":519,"wires":[["d5b00ebb.7cff2"]]},{"id":"957c8509.801f88","type":"function","z":"e0fbf5d6.9419a8","name":"","func":"global.set('positive_images', msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":249.5,"y":468,"wires":[["8de0b25e.6d294"]]},{"id":"d5b00ebb.7cff2","type":"function","z":"e0fbf5d6.9419a8","name":"","func":"global.set('negative_images', msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":248.5,"y":523,"wires":[["8de0b25e.6d294"]]},{"id":"8de0b25e.6d294","type":"function","z":"e0fbf5d6.9419a8","name":"","func":"var received = global.get('received') || 0;\nvar p = global.get('positive_images') || null;\nvar n = global.get('negative_images') || null;\n\nnode.error('checking images in global');\n\nif (p && n) {\n msg.params = {};\n msg.params.name = 'IDs';\n msg.params.negative_examples = n;\n msg.params.license_positive_examples = p;\n return msg; \n}\n\n\n","outputs":1,"noerr":0,"x":390.5,"y":490,"wires":[["6ebf459c.e5718c"]]},{"id":"6ebf459c.e5718c","type":"visual-recognition-util-v3","z":"e0fbf5d6.9419a8","name":"Create Classifier","apikey":"","image-feature":"createClassifier","x":570.5,"y":484,"wires":[["5dd02238.cd423c"]]},{"id":"5dd02238.cd423c","type":"debug","z":"e0fbf5d6.9419a8","name":"","active":true,"console":"false","complete":"true","x":706,"y":439,"wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment