• Stars
    star
    300
  • Rank 138,870 (Top 3 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for the demos from my Google Next '17 talk: https://youtu.be/w1xNTLH1zlA and I/O '17 talk: https://www.youtube.com/watch?v=ETeeSYMGZn0

This is not an official Google product

ML API next talk demos

This repo includes 4 demos from my Google Next talk and Google I/O talk on the Cloud ML APIs. To run the demos, follow the instructions below.

Vision API + Firebase demo

  1. cd into vision-api-firebase
  2. Create a project in the Firebase console and install the Firebase CLI
  3. Run firebase login via the CLI and then firebase init functions to initialize the Firebase SDK for Cloud Functions. When prompted, don't overwrite functions/package.json or functions/index.js.
  4. In your Cloud console for the same project, enable the Vision API
  5. Generate a service account for your project by navigating to the "Project settings" tab in your Firebase console and then selecting "Service Accouts". Click "Generate New Private Key" and save the file to your functions/ directory in a file called keyfile.json:

Project settings

Service accounts

  1. In functions/index.js replace both instances of your-firebase-project-id with the ID of your Firebase project
  2. Deploy your Cloud Function by running firebase deploy --only functions
  3. From the Authentication tab in your Firebase console, enable Twitter authentication (you can use whichever auth provider you'd like, I chose Twitter).
  4. Run the frontend locally by running firebase serve from the vision-api-firebase/ directory of this project. Navigate to localhost:5000 to try uploading a photo. After uploading a photo check your Functions logs and then your Firebase Database to confirm the function executed correctly.
  5. Deploy the frontend by running firebase deploy --only hosting. For future deploys you can run firebase deploy to deploy Functions and Hosting simultaneously.

Speech API Bash demo

  1. cd into speech/
  2. Make sure you have SoX installed. On a Mac: brew install sox --with-flac
  3. Create a project in the Cloud console and generate a new API key. Add your API key in request.sh
  4. Run the script: bash request.sh

Natural Language API BigQuery demo

  1. cd into natural-language/
  2. Generate Twitter Streaming API credentials and copy them to local.json
  3. Create a Google Cloud project, generate a JSON keyfile, and add the filepath to local.json
  4. Create a BigQuery dataset and table with the below schema, add them to local.json

  1. Generate an API key and add it to local.json
  2. Change line 37 to filter tweets on whichver terms you'd like
  3. Install node modules: npm install
  4. Run the script: node twitter.js

Natural Language API + Firebase realtime Twitter dashboard demo

  1. cd into nl-firebase-twitter/
  2. Create a project in the Firebase console and install the Firebase CLI
  3. cd into the frontend/ directory and run firebase login and firebase init to associate this with the Firebase project you just created. When prompted, don't overwrite existing files. Create a database and hosting project (no Functions).
  4. In your Firebase console, click "Add Firebase to your web app". Copy the credentials to the top of the main.js file
  5. cd into the backend/ directory and run npm install to install dependencies
  6. Generate a service account for your project by navigating to the "Project settings" tab in your Firebase console and then selecting "Service Accouts". Click "Generate New Private Key" and save this in your backend/ directory as keyfile.json
  7. Generate Twitter Streaming API credentials and copy them to backend/local.json
  8. Navigate to the Cloud console for our project. Enabled the Natural Language API and generate an API key. Replace YOUR-API-KEY in backend/local.json with this key.
  9. Replace searchTerms in backend/index.js with the search terms you'd like to filter tweets on
  10. Replace FIREBASE-PROJECT-ID in backend/local.json with the id of your Firebase project
  11. Set up BigQuery: in your Cloud console for the same project, create a BigQuery dataset. Then create a table in that dataset. When creating the table, click Edit as text and paste the following:
id:STRING,text:STRING,user:STRING,user_time_zone:STRING,user_followers_count:INTEGER,hashtags:STRING,tokens:STRING,score:STRING,magnitude:STRING,entities:STRING
  1. Add your BigQuery dataset and table names to backend/local.json.
  2. Run the server: from the backend/ directory run node index.js. You should see tweet data being written to your Firebase database
  3. In a separate terminal process, run the frontend: from the frontend/ directory run firebase serve
  4. Deploy your frontend: from the frontend/ directory run firebase deploy

Multiple API demo

  1. cd into vision-speech-nl-translate
  2. Make sure you've set up your GOOGLE_APPLICATION_CREDENTIALS with a Cloud project that has the Vision, Speech, NL, and Translation APIs enabled
  3. Run the script: python textify.py
  4. Note: if you're running it with image OCR, copy an image file to your local directory

More Repositories

1

video-intelligence-demo

Video Intelligence API keynote demo from Google Next 2017
JavaScript
192
star
2

tswift-detection

Using the TensorFlow Object Detection API and Cloud ML Engine to build a Taylor Swift detector
JavaScript
164
star
3

keras-wine-model

Model built with the Keras Functional API
Jupyter Notebook
83
star
4

angular2base

Demo app from my Angular Connect talk
TypeScript
82
star
5

automl-api-demo

Demo showing how to call the Cloud AutoML API from a web app
JavaScript
50
star
6

ionic-fb-groceries

Demo app for the Ionic + Firebase screencast
JavaScript
32
star
7

crowdsourced-automl-demo

Crowdsource your AutoML training data with the AutoML API
JavaScript
16
star
8

crowdsourced-fog

Crowdsourced weather for SF
JavaScript
15
star
9

harry-potter

Harry Potter demo app for JS Conf EU
JavaScript
13
star
10

adanet-ml-engine

Training an AdaNet AutoEnsembleEstimator on Cloud ML Engine
Python
12
star
11

live-coding

Simple chat example with Firebase
HTML
10
star
12

ember-cli-screencast

Chat app for my screencast on using Ember CLI + EmberFire
JavaScript
9
star
13

emberfire-hn

Hacker News clone built with EmberFire
JavaScript
4
star
14

ionic-firebase-todo

Todo App built with Ionic and Firebase
JavaScript
4
star
15

ionic-firebase-drawing

Demo drawing app using Firebase + Ionic
JavaScript
3
star
16

firebase-presentation

Slides for Firebase presentation from Berlin event
JavaScript
2
star
17

ember-bootstrap

Getting started app for EmberFire presentations
JavaScript
2
star
18

hackertweets

Uses the Twitter API to pull tweets tagged with different programming languages
Ruby
1
star
19

medicare-data

Angular.js app to visualize CMS medicare procedure cost data
JavaScript
1
star
20

realtime-coffee

Demo app for Firebase presos
CSS
1
star
21

ember-firebase

Chat App with EmberFire using the Ember CLI
JavaScript
1
star
22

firebase-google-translate

Chat example using Firebase and the Google Translate API
JavaScript
1
star
23

tic-tac-toe

Tic Tac Toe built with Firebase
JavaScript
1
star
24

personal-site

My personal website
CSS
1
star
25

firebase

Experimenting with Firebase's example applications
1
star