Skip to content

This is the code which when integrated with the LostAndFound web application will help us analyze pictures submitted by the claimants.

License

Notifications You must be signed in to change notification settings

lostandfoundry/Lost-And-Found-ML-IBM-Watson-Cloudant

Repository files navigation

Build Status

Serverless Image Recognition with Cloud Functions

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.

Flow

  1. User chooses a picture from the gallery.
  2. The image is stored in the Cloudant database.
  3. Cloud Function is triggered when there's a new image in the database.
  4. Cloud Function gets the image and uses Watson Visual Recognition to process the image.
  5. Cloud Function stores the results (classes with scores) from Visual Recognition in the database.
  6. The user can see the new tags or classes in the image they uploaded.

Included components

  • 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.

Featured technologies

  • 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.

Usage

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.

Links

License

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.

Apache Software License (ASL) FAQ