Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Apps with Google ML

Android Apps with Google ML

At Cloud Next organized by GDG Seattle. This talk presents resources on how to make Android apps with Google ML via Google Play Services, pre-trained ML models and TensorFlow.

Margaret Maynard-Reid

April 22, 2017
Tweet

More Decks by Margaret Maynard-Reid

Other Decks in Technology

Transcript

  1. Android Apps with Google ML Cloud Next ‘17 by GDG

    Seattle, 4/22/2017 Margaret Maynard-Reid @margaretmz
  2. @margaretmz #GoogleNext17 #androiddevs #machinelearning About me 2 • Android developer

    • Udacity AI Engineer student • GDG Seattle organizer • Women Techmakers lead • Taught Android @UW
  3. @margaretmz #GoogleNext17 #androiddevs #machinelearning What is Machine Learning? • A

    subset of Artificial Intelligence • Study of algorithms • Learn from examples and experience (instead of hard-coded programming rules) Source: ML Recipes #1 by Google Developers - https://www.youtube.com/watch?v=cKxRvEZd3Mw Use model to predict Train a model Collect training data 4
  4. @margaretmz #GoogleNext17 #androiddevs #machinelearning Topics • Demo - ◦ Google’s

    pre-trained ML APIs ◦ Android apps with ML APIs ◦ Android apps with TensorFlow • How to make apps with intelligence • Understand the importance of ML for app developers 5
  5. @margaretmz #GoogleNext17 #androiddevs #machinelearning Options for using ML in apps

    Complexity Pre-trained ML Services (via REST APIs) Vision Speech Language Text… Train or build your ML models Google Cloud ML Platform Google Play Services Mobile Vision API 6
  6. @margaretmz #GoogleNext17 #androiddevs #machinelearning Google Mobile Vision API • Part

    of the Google Play services • Very easy to get started • Can detect: ◦ Face (FaceDetector) | codelab ◦ Barcode (BarcodeDetector) | codelab ◦ Text (TextRecognizer) | codelab Detailed documentation on Mobile Vision API - https://developers.google.com/vision/ 8
  7. @margaretmz #GoogleNext17 #androiddevs #machinelearning Mobile Vision API - Face Detection

    • Detect one or multiple faces • Facial detection not recognition • Detection from image or live video • Face can be detected from different angles • Detects activities: ◦ winking, blinking and smiling • Detect landmarks on face 9
  8. @margaretmz #GoogleNext17 #androiddevs #machinelearning Slide & video credit: Google 1.

    Create a face detector for facial landmarks (e.g., eyes) 3. For each face, draw the eyes FaceDetector detector = new FaceDetector.Builder() .setLandmarkType(FaceDetector.ALL_LANDMARKS) .build(); SparseArray<Face> faces = detector.detect(image); for (int i = 0; i < faces.size(); ++i) { Face face = faces.valueAt(i); for (Landmark landmark : face.getLandmarks()) { // Draw eyes 2. Detect faces in the image 10 Googly Eyes Android App
  9. @margaretmz #GoogleNext17 #androiddevs #machinelearning Mobile Vision API - Barcode Detection

    • Detects barcodes in real-time, on device, in any orientation. • Detects multiple barcodes at once • Detects and parses barcodes and Qr codes of various formats 11
  10. @margaretmz #GoogleNext17 #androiddevs #machinelearning Mobile Vision API - Text Recognition

    • Detects text in real-time, on device. • Detects text in Latin based languages (French, German, English, etc.) • Recognizes text in images and video streams 12
  11. REST API calls ML REST APIs Vision Speech Language Text

    Translate Search…. HTTP response images text HTTP call audio video 14
  12. @margaretmz #GoogleNext17 #androiddevs #machinelearning Getting started A typical process: •

    Get API key • Include key in Android app • Download SDK or include dependency in build.gradle (if sdk available) • Make your REST API calls 15
  13. @margaretmz #GoogleNext17 #androiddevs #machinelearning Pre trained ML • No need

    for much ML knowledge • Just REST API calls • “Try out the APIs” directly online from the websites • Google Cloud ML APIs 16
  14. @margaretmz #GoogleNext17 #androiddevs #machinelearning Machine Learning API’s by Example Watch

    video Sara Robinson’s talk Machine Learning API’s by Example from Next ‘17 for detailed examples of Google ML API’s 18
  15. @margaretmz #GoogleNext17 #androiddevs #machinelearning TensorFlow on mobile • Android and

    iOS • Android sample app with TensorFlow ◦ TF Classify ◦ TF Detect ◦ TF Stylize • Checkout all TensorFlow Dev Summit videos ◦ Pete Warden’s talk Mobile and Embedded TensorFlow • TensorFlow on Android by Yufeng Guo 20
  16. @margaretmz #GoogleNext17 #androiddevs #machinelearning TensorFlow on Android Android app for

    recognizing handwritten digits by Marianne Linhares https://github.com/mari-linhares/mnist-android-tens orflow 21
  17. @margaretmz #GoogleNext17 #androiddevs #machinelearning What is next? • Try out

    machine learning APIs • Try out TensorFlow tutorials and code labs • Check out the AI experiments • Study machine learning basics • Build an app with intelligence 23
  18. @margaretmz #GoogleNext17 #androiddevs #machinelearning Appendix ML Sessions at Google I/O

    2016 - • Google’s Vision on Machine Learning • Machine Learning for Art • Machine learning is not the future • Breakthroughs in Machine Learning • How to build a smart RasPi Bot with Cloud Vision and Speech API Google AI Experiments • https://aiexperiments.withgoogle.com/ Udacity blog • The What, How, and Why of Artificial Intelligence, Machine Learning, and Self-Driving Cars 25
  19. @margaretmz #GoogleNext17 #androiddevs #machinelearning Appendix - AI & ML learning

    resources Udacity • Intro to Machine Learning • AI Engineer Nanodegree • ML Engineer Nanodegree • Self-driving Car Engineer Nanodegree • Deep Learning (TensorFlow) Stanford • Andrew Ng’s ML course on Coursera Google Developers • Machine Learning Recipes (short Youtube videos) Reading • Python Machine Learning by Sabastian Raschka 26