All Projects → androidthings → photobooth

androidthings / photobooth

Licence: other
Cloud-connected talking photobooth using TensorFlow

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to photobooth

Sample Tensorflow Imageclassifier
Classify camera images locally using TensorFlow models
Stars: ✭ 623 (+1457.5%)
Mutual labels:  android-things
Surviving With Android
Source code related to the posts in the blog
Stars: ✭ 1,275 (+3087.5%)
Mutual labels:  android-things
Jlibmodbus
JLibModbus is an implementation of the Modbus protocol v1.1b in java language.
Stars: ✭ 149 (+272.5%)
Mutual labels:  android-things
Androidthings rainbowhatdemo
This Android Things project executes all the hardware that is on the Pimoroni Rainbow HAT for Android Things and Raspberry Pi 3
Stars: ✭ 17 (-57.5%)
Mutual labels:  android-things
Android Sitemap
👓 Every link ever to Android Developer site.
Stars: ✭ 61 (+52.5%)
Mutual labels:  android-things
Sample Button
Basic input and output using a button and LED
Stars: ✭ 107 (+167.5%)
Mutual labels:  android-things
Sample Googleassistant
Google Assistant API sample for Android Things
Stars: ✭ 460 (+1050%)
Mutual labels:  android-things
Sample Simplepio
Basic Peripheral I/O examples with Android Things
Stars: ✭ 191 (+377.5%)
Mutual labels:  android-things
Sample Usbenum
Discover connected devices using the Android USB Host APIs
Stars: ✭ 81 (+102.5%)
Mutual labels:  android-things
Sample Bluetooth Audio
Bluetooth A2DP sample using Android Things
Stars: ✭ 146 (+265%)
Mutual labels:  android-things
Awesome Android Things
A curated list of awesome android things tutorials, libraries and much more at one place
Stars: ✭ 883 (+2107.5%)
Mutual labels:  android-things
Androidthings Drivers
Android Things open source peripheral drivers
Stars: ✭ 30 (-25%)
Mutual labels:  android-things
Sample Simpleui
Connect GPIO states with a graphical UI on Android Things
Stars: ✭ 116 (+190%)
Mutual labels:  android-things
Libaums
Open source library to access USB Mass Storage devices on Android without rooting your device
Stars: ✭ 769 (+1822.5%)
Mutual labels:  android-things
Drivers Samples
Peripheral driver samples
Stars: ✭ 153 (+282.5%)
Mutual labels:  android-things
Contrib Drivers
Open source peripheral drivers
Stars: ✭ 539 (+1247.5%)
Mutual labels:  android-things
Android Robocar
Build your own robocar, remote-controlled or autonomous, with Android Things.
Stars: ✭ 95 (+137.5%)
Mutual labels:  android-things
Weatherstation
Sensor-based peripheral sample using Android Things
Stars: ✭ 210 (+425%)
Mutual labels:  android-things
Sample Bluetooth Le Gattserver
Build a Bluetooth GATT server with Android Things
Stars: ✭ 159 (+297.5%)
Mutual labels:  android-things
Android Things Electricity Monitor
Electricity Monitor using Android Things and Firebase Realtime Database
Stars: ✭ 118 (+195%)
Mutual labels:  android-things

Android Things Photobooth

Introduction

This project contains all the code required to build a cloud-connected, talking photobooth powered by Android Things. This is the codebase that was used in the Photobooth demo at Google I/O 2017. It will take your photo, style it with Tensorflow, upload it to the cloud, and print the photo out. Upon request, it can also share your photo to its twitter account.

This demo uses the following Google platforms and APIs:

Note: The Android Things Console will be turned down for non-commercial use on January 5, 2022. For more details, see the FAQ page.

Pre-requisites

  • One Android-Things powered device with a connected camera. This demo ran on a Raspberry Pi 3, but is in no way limited to that device.

  • One Google Assistant device. It's a talking photobooth, so you need something to handle the VUI. You can use a Google Home, or build your own.

(Optional)

  • To print out QR codes, you can use a thermal printer. Modify the code to use the ThermalPrinter class instead of HttpImagePrint.

(Optional)

  • A regular printer to print out photos. This will need to be attached to a print server. Setting up the server is beyond the scope of this document.

Getting Started

Most of the steps here are best described by existing documentation, which is better to link to than to paraphrase. In order, do the following.

  • Set up your Android Things device.

  • Import this project in Android Studio

  • Add Firebase to your Android project

    • Follow the instructions for setting up Google Cloud Storage for Firebase. Be sure to set up storage security rules. You'll want the rules set so that anybody can download the photos, but only authenticated "users" of the application (only the signed APK for your application) can upload photos. Here is the rule to copy/paste:
    service firebase.storage {
        match /b/{bucket}/o {
          match /{allPaths=**} {
            allow read: if true;
            allow write: if request.auth != null;
          }
        }
    }
    
  • Deploy the Google Cloud Functions which are located in project-root/firebase

    • These interact with multiple services you will also need to set up:

      • To share on Twitter, you'll need a Twitter API key.
      • To generate shortened URLs you'll need an API key for Google's URL Shortener.
      • Once you have the keys, add them to your [Environment Configuration] so they'll be retrieved from the server at runtime. Modify firebase/functions/photos.js to point to the correct environment variables. The code block to modify will look like this:
      /**
       * Twitter Info
       */
       var TWTR_CONSUMER_KEY = functions.config().twitter.consumer_key;
       var TWTR_CONSUMER_SECRET = functions.config().twitter.consumer_secret;
       var TWTR_ACCESS_TOKEN_KEY = functions.config().twitter.access_token_key;
       var TWTR_ACCESS_TOKEN_SECRET = functions.config().twitter.access_token_secret;
      
      /**
       * API key for the Google URL shortener API
       * https://developers.google.com/url-shortener/v1/getting_started#APIKey
       */
      var URL_SHORTENER_API_KEY = functions.config().shorturl.key;
      
  • Code for the Google Assistant app (the voice UI) is in the agent/ directory. To deploy it, follow the Getting Started Guide for Actions On Google.

  • Printing strategies will vary - For the photobooth demo we set up CUPS on a second Raspberry Pi and attached it to a Photobooth printer (the setup of CUPS and various printer models is wildly beyond the scope of this document). It's also possible (and likely easier) to get a printer that supports Google Cloud Print, and use the sendJobs API call to activate a print job over the internet.

Support and Discussion

If you've found an error in this sample, please file an issue: https://github.com/androidthings/photobooth/issues

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.

Enable auto-launch behavior

This Android Things app is currently configured to launch only when deployed from your development machine. To enable the main activity to launch automatically on boot, add the following intent-filter to the app's manifest file:

<activity ...>

    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.HOME"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>

</activity>

License

Copyright 2017 Google, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].