Lately I am spending time experimenting with scikit-learn and TensorFlow (Google) open source library for Machine Learning.
Using image recognition library from TensorFlow, I hacked together a web service with an end point where I can send an image and get back with prediction for the content of the image.
To consume the API, initially I thought of making an Android app, later it made sense to follow up on my previous post and use a chat bot. My experimental project was simple, I should be able to send an image to my chat-bot in WhatsApp, and get back the prediction.
Tensorflow is easy to learn and use and it has decent documentation. I trained the model using sample image database downloaded from google example. To create the web endpoint, I used flask, a python web framework.
Now I can test, my web service by uploading my test image
_string: "dock, dockage, docking facility"
_string: "liner, ocean liner"
Prediction engine is 62% sure that the image is of a catamaran. Close enough.
Now, I could hook this up to my WhatsApp bot. I used yowsup python library to get this up and running. I just had to register my spare mobile number with WhatsApp server. With a bit of fiddling around, the bot was ready to talk to the prediction API.
Now I can send a picture, and get back the prediction in JSON format.