Giter VIP home page Giter VIP logo

sbhacksgithubio's Introduction

ml-camera

Contents

What is ml-camera?
How does this app work?
Requirements

What is ml-camera?

This is a demo flask app where you can take a picture in a mobile browser and send the pic to Google's ML Vision API for label and text extraction.


How does this app work?

At a high level, this app does the following:

  1. Asks the user for access to their phone's camera (Front or Back)
  2. Once the user grants access, video starts streaming.
  3. The user can choose whether they want to detect what an image is or extract text from an image by clicking on the appropriate link.
  4. The image is then sent server side along with the image service to be used (text extraction or label).
  5. After sending the image to the Vision API, it returns either a label or text that was extracted from the image and then sends this information back to the client.

What does this app look like?

Example of the Google ML Vision API successfully labeling a laptop. In addition to the label, a confidence score is also returned. In the case below, Google is 95% confident that the image is a laptop.



Example of the Google ML Vision API extracting text off of a keyboard.

Requirements

This app uses the following python libraries, which you will need to install:

  • numpy
  • google.cloud.vision
  • io
  • datetime
  • flask
  • flask_socketio
  • requests

On the client side:

  • jquery

Main files to review how it works

Essentially, main functionality of the app is contained within the following files:

  1. app.py - this is the main script
  2. vision.py - this is a helper script which sends the image to either the label detection or text extraction service.
  3. /static/js/camera.js - this is the main javascript file which sends the data to python and renders results from the Vision API.

Useful Reference Links

Here are some links that I found very useful with code examples.

sbhacksgithubio's People

Contributors

garethcull avatar

Watchers

Isaac-Neil Zanoria avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.