Git Product home page Git Product logo

video-intelligence-demo's Introduction

This is not an official Google product.

Video Intelligence API Demo

This is the code for the Video Intelligence API demo presented at Google Cloud Next 2017. See a video of the presentation here. Big thank you to Alex Wolfe for his contributions to this app.

The code for the app is split into frontend and backend repos. Here's what it looks like:

Architecture diagram

FRONTEND

  • Frontend: App Engine app that displays videos and their Video API annotations, and lets you search videos by annotation

TECH STACK

BACKEND

  • Google Cloud Function that calls the Video API everytime a new video is added to a bucket
  • It stores the JSON response output a separate GCS bucket.

TECH STACK

RUNNING THE APP

Setting up the frontend

  1. Clone this repo and cd into the frontend directory.
  2. Run npm install to install dependencies.
  3. Run npm start in one tab on your terminal and gulp dev on another. Make sure these are running at the same time.
  4. Navigate to localhost:8080. You should see the UI without any videos - that part is next!

Setting up the backend (Cloud Functions + Video Intelligence API)

  1. Create a Cloud project and enable the Video Intelligence API (requires being part of the private beta) and Cloud Functions. Generate an API key and a JSON keyfile.
  2. In your project, create three Cloud Storage buckets: one for your videos, one for the video JSON output, and one as a staging bucket for your Cloud Function.
  3. Put all of the info from steps 5 & 6 into frontend/local.json and backend/local.json. Copy your keyfile into a file called keyfile.json and place it in the frontend AND backend directories (you'll deploy these separately, one to App Engine and one to Cloud Functions).
  4. (Optional step) If you want to see the UI with some sample video content before deploying your function and adding your own videos, copy the google-home-superbowl.mp4 file in the root directory to your video storage bucket and copy the google-home-superbowlmp4.json file to your video JSON annotation storage bucket. Run the frontend and you'll see the video with the annotations visualized.
  5. cd into backend. Deploy the Cloud Function with the following command (replace with the name of your buckets): gcloud beta functions deploy analyzeVideo --stage-bucket your-stage-bucket-name --trigger-bucket your-video-bucket
  6. With your function deployed, try uploading a video to your video storage bucket. When the Video API finishes processing it, you should see the annotation JSON file in your annotation bucket. To see the video in your UI: navigate to localhost:8080/profile, then click 'clear local storage' and 'get videos'.

Deploy the frontend

  1. To deploy your App Engine app, cd into frontend. Install the gcloud CLI if you haven't already. Make sure it's set to the correct project by running: gcloud config set project your-project-id. Then deploy your app with gcloud app deploy.

video-intelligence-demo's People

Contributors

aaditya025 avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.