├── images ├── added-node.png ├── node-function.png └── custom-model-watson-studio.png ├── .gitignore └── README.md /images/added-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blumareks/ai-visrec-under-10min/HEAD/images/added-node.png -------------------------------------------------------------------------------- /images/node-function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blumareks/ai-visrec-under-10min/HEAD/images/node-function.png -------------------------------------------------------------------------------- /images/custom-model-watson-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blumareks/ai-visrec-under-10min/HEAD/images/custom-model-watson-studio.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ai visual recognition under 10min 2 | 3 | let's create a custom classifier and run analysis with node.red on images. 4 | 5 | 6 | ## steps 7 | 1. **create custom classifier** [the drone based image classifier with John Walicki's lab](https://github.com/IBM/drones-iot-visual-recognition) 8 | - see the short video on how the custom classifier was done in Watson Studio for [the wild fires : https://youtu.be/kW7cjuWuPS0](https://youtu.be/kW7cjuWuPS0) 9 | 10 | 2. **use the visual recognition in Node Red** [use the watson visual recognition service in node.red](https://github.com/watson-developer-cloud/node-red-labs/tree/master/basic_examples/visual_recognition) 11 | 12 | 3. **add the custom classifier from step one to the above lab in step two** - tweak the lab to use our custom model - the steps are provided below: 13 | 14 | add an additional `function` node - see the pic. 15 | 16 | ![added-node](images/added-node.png) 17 | 18 | ![added-function](images/node-function.png) 19 | 20 | Wire it together with the visual recogniton node. 21 | 22 | add this code: 23 | 24 | ```js 25 | msg.params={"classifier_ids":["CountBurnedHomes_some_id"],"threshold":0}; 26 | return msg; 27 | ``` 28 | 29 | Please mind that you need to replace the classifier_ids' value - ie. `CountBurnedHomes_some_id` with the value from the custom classifier in Watson Studio. You can find it on the asset page. See below picture - in the shown case the classifier_ids' value is `DefaultCustomModel_1017852438` : 30 | 31 | ![watson-studio-custom-classifier](images/custom-model-watson-studio.png) 32 | 33 | And you should be good to test it on image like this one: https://i.dailymail.co.uk/i/newpix/2018/08/10/00/4EF8313400000578-0-image-a-11_1533857657594.jpg (this is such an unhappy picture, that please give a thought to displaced people in Nothern California, and other places affected by disasters. Do [Call for Code!](http://callforcode.org/) ). 34 | 35 | ``` 36 | And one more thing - you can test the new classifier with coreML iOS app - check this recipe: 37 | ``` 38 | https://developer.ibm.com/tutorials/watson-visual-recognition-with-core-ml-single-model/ 39 | 40 | If you like give me a star. Follow me on Twitter: [blumareks](http://twitter.com/blumareks). 41 | BTW. I have a blog. Check it out [my blog on medium](https://medium.com/@blumareks) . 42 | --------------------------------------------------------------------------------