The application demonstrates an IBM Cloud Functions (based on Apache OpenWhisk) that gets an image from the Cloudant database and classifies it through Watson Visual Recognition. The use case demonstrates how actions work with data services and execute logic in response to Cloudant events.
One function, or action, is triggered by changes (in this use case, an upload of a document) in a Cloudant database. These documents are piped to another action that submits the image to Watson Visual recognition and upload a new document in Cloudant with the classifiers produced by Watson.
- User chooses a picture from the gallery.
- The image is stored in the Cloudant database.
- Cloud Function is triggered when there's a new image in the database.
- Cloud Function gets the image and uses Watson Visual Recognition to process the image.
- Cloud Function stores the results (classes with scores) from Visual Recognition in the database.
- The user can see the new tags or classes in the image they uploaded.
- IBM Cloud Functions (powered by Apache OpenWhisk): Execute code on demand in a highly scalable, serverless environment.
- Cloudant: A fully managed data layer designed for modern web and mobile applications that leverages a flexible JSON schema.
- Watson Visual Recognition: Visual Recognition understands the contents of images - visual concepts tag the image, find human faces, approximate age and gender, and find similar images in a collection.
- Serverless: An event-action platform that allows you to execute code in response to an event.
Double-click web/index.html
_
We need to enable CORS - https://cloud.ibm.com/docs/services/Cloudant/api/cors.html#cors
OR,
run npm install
followed by npm start
in the cloned folder to view the running app in electron.
Please go through the jupiter notebook file to understand the specifics of the product we have come up with, and at what stage we have implemented this idea.
- Node.js Cloudant: Official Cloudant library for Node.js.
- Watson APIs Node.js SDK: Node.js client library to use the Watson APIs.
This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.