-
Notifications
You must be signed in to change notification settings - Fork 1
/
NodeRED-CustomClassifier.txt
1 lines (1 loc) · 2.3 KB
/
NodeRED-CustomClassifier.txt
1
[{"id":"6f70ebbf.e25e44","type":"visual-recognition-v3","z":"90e8742a.b5056","name":"","apikey":"cf8a05116f81f318cfbaba88cc4245bd8cf8d77f","image-feature":"classifyImage","lang":"en","x":464,"y":503,"wires":[["ab4c8a83.ed9598","448683e8.1ec7c4"]]},{"id":"fd9c977c.125f4","type":"debug","z":"90e8742a.b5056","name":"","active":true,"console":"false","complete":"payload","x":1064,"y":483,"wires":[]},{"id":"ad363eb1.8fe22","type":"inject","z":"90e8742a.b5056","name":"Positive","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":124,"y":443,"wires":[["6ff19387.7d7294"]]},{"id":"6ff19387.7d7294","type":"function","z":"90e8742a.b5056","name":"Define the classifier ID","func":" msg.params = []; \n msg.params[\"classifier_ids\"] = \"YOUR_CLASSIFIER_ID\"; \n msg.params[\"owners\"] = \"me\"; \n\nreturn msg;","outputs":1,"noerr":0,"x":354,"y":443,"wires":[["6f70ebbf.e25e44"]]},{"id":"8aa7e242.c0d648","type":"comment","z":"90e8742a.b5056","name":"Test your own classifier","info":"","x":149.5,"y":387,"wires":[]},{"id":"58f7dbd0.3af40c","type":"function","z":"90e8742a.b5056","name":"Found a match","func":"\nmsg.payload=\"Watson using your customized classifier sees: \\n \";\n\nmsg.payload += msg.result.images[0].classifiers[0].classes[0].class + \" with a score of \" + msg.result.images[0].classifiers[0].classes[0].score + \"\\n\" ;\n\nreturn msg;","outputs":1,"noerr":0,"x":874,"y":443,"wires":[["fd9c977c.125f4"]]},{"id":"ef1ca89b.f6285","type":"inject","z":"90e8742a.b5056","name":"Negative","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":114,"y":503,"wires":[["6ff19387.7d7294"]]},{"id":"ab4c8a83.ed9598","type":"debug","z":"90e8742a.b5056","name":"","active":true,"console":"false","complete":"result","x":524,"y":563,"wires":[]},{"id":"448683e8.1ec7c4","type":"switch","z":"90e8742a.b5056","name":"","property":"result.images[0].classifiers[0]","propertyType":"msg","rules":[{"t":"nnull"},{"t":"else"}],"checkall":"true","outputs":2,"x":704,"y":503,"wires":[["58f7dbd0.3af40c"],["d958e012.5766f"]]},{"id":"d958e012.5766f","type":"function","z":"90e8742a.b5056","name":"No match","func":"\nmsg.payload=\"Watson didn't find a macth for your classifier.\";\n\nreturn msg;","outputs":1,"noerr":0,"x":874,"y":523,"wires":[["fd9c977c.125f4"]]}]