Building a Cognitive Drone for the Enterprise with IBM Watson Visual Recognition and BlueChasm
For a recent Developer Day we put together a demo utilizing a custom made drone running off of a Raspberry Pi with the pi camera module. Using the drone we took a snap shot every several seconds and uploaded the images to IBM Cloud Object Storage, tagged the images using IBM Watson Visual Recognition, and stored the tags in a Cloudant database.
I left the drone camera pointed at me while I worked. It remotely uploaded a few dozen images with tags.
classes": [ { "class": "person", "score": 0.999994, "type_hierarchy": "/people" } ]
All of the images the drone takes are uploaded remotely and tagged in real time. We have a lot of opportunities with this method to then act on what the drone is seeing during the flight. And since the tagging is done using Watson and autonomous flight control software is improving, we have reduced the need for a human operator.
Here is a short example of how we are remotely storing and tagging the images. Note that I just assigned each image a random number for a file name. You can use any other method that works well for your use case.
function storePic(data, cloudant){ console.log('File loaded'); os.createContainer() .then(function(){ return os.setContainerPublicReadable(); }) .then(function(){ return os.uploadFileToContainer(Math.random()+'.jpg', 'image/jpeg', data, data.length); }) .then(function(file){ console.log('url to uploaded file:', file); tagPic(file, cloudant); return os.listContainerFiles(); }) .then(function(files){ console.log('list of files in container:', files); }); } function tagPic(url, cloudant){ console.log("tag called"); var params = {url: url}; visual_recognition.classify(params, function(err, res) { if (err) console.log(err); else{ console.log(JSON.stringify(res, null, 2)); var tagging_demo = cloudant.db.use('tagging_demo'); tagging_demo.insert(res, url, function(err, body, header){ if (err) { return console.log('[tagging_demo.insert] ', err.message); } console.log('You have inserted the doc.'); console.log(body); }) } }); }
We see a lot of uses for this technology in businesses that traditionally use human monitoring. Some examples include inspecting dangerous industrial equipment and managing inventory in large warehouses or shipyards. Due to the instant response generated by the visual classification there are also some potential uses in emergency response.