TensorFlow for
Mobile Developers
Enrique López Mañas
Google Developer Expert
Ego Slide
• Freelance Dev
• Google Developer Expert
• @eenriquelopez
Machine Learning / AI
Machine Learning / AI
Machine Learning / AI
Buzzwords classification
Artificial intelligence
Machine Learning
The science of making machines smarts
Building machines that can learn
Neural Networks
One of the many different algorithms in Machine Learning
Buzzwords classification
Neural Network
Machine Learning
Machine Learning
Machine Learning
12%
of all
responses
on mobile
Machine Learning
Machine Learning
Machine Learning
Cloud vs. Mobile
Less Traffic & Faster Response
Motion Sensors
TensorFlow
OpenSource library for Machine Learning
tensorflow.org
Today most popular ML framework
TensorFlow
You can train:
- Mac / Windows
- GPU Server
- GPU/TPU on Cloud
Prediction:
- Android
- iOS
- Raspberry
TensorFlow
CIFAR10
TensorFlow ecosystem
From Training to App (@yufengg)
Data Gathering?
From Training to App (@yufengg)
From Training to App (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
Convolutional Neural Networks (@yufengg)
From Training to App (@yufengg)
Optimizing model for Mobile (@yufengg)
From Training to App (@yufengg)
Other inception versions
(inception v1 quantised is 7 MB)
From Training to App (@yufengg)
TensorFlow increases APK in 12 MB
From Training to App (@yufengg)
From Training to App (@yufengg)
TensorFlow community
1000+ contributors
22.000+ commits
18.000+ repositories with name “TensorFlow”
TensorFlow community
Building with Android Studio
Uses Bazel to build
Set Bazel binary location in /tensorflow/examples/
android/build.gradle
Add project in tensorflor/examples/android folder
to Android Studio
Building with Android Studio
Installing Bazel first:
Download from https://github.com/bazelbuild/bazel/releases
Install instructions in https://docs.bazel.build/versions/master/install.html
Building with Android Studio
Download Android SDK (23)
Download Android NDK (12b)



(recommend it with Android SDK Manager)
Building with Android Studio
WORKSPACE FILE
Building with Android Studio
Run Bazel
bazel build -c opt //tensorflow/examples/
android:tensorflow_demo
Building with Android Studio
Install APK
adb install -r bazel-bin/tensorflow/examples/android/
tensorflow_demo.apk
Building with Android Studio
OR…
TensorFlow AAR from JCenter
YUV -> RGB less efficient
Object tracking not available
Android Samples
TF Classify


TF Detect



TF Stylize
TF Classify
Uses Google Inception (v3) to label images
Model easy to swap
No “person label”
Volume button up for statistics
TF Classify
TF Classify
TF Detect
TF Detect
- Draw bounding boxes around people
- Useful to count objects
- No training yet
TF Style
TF Style
- Real time style transfer algorithm
- Pick/mix different styles
- Can train Magenta models
TF Style
TensorFlow
Written in C++
Android uses Kotlin/Java?



HowTo?
Android inference Library
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/android
Building for iOS
Install requirements:
- Xcode 8
- Command line tools (xcode-select install)
- brew install automake
- brew install lib tool
- tensorflow/contrib/makefile_build_all_ios.sh (takes 20 minutes)
iOS Examples: simple
iOS Examples: camera
iOS Examples: camera
- Run inception each frame
- Models can be replaced
iOS Examples: benchmark
Raspberry Pi
Resources
TensorFlow: https://www.tensorflow.org/
Magenta: https://magenta.tensorflow.org/welcome-to-magenta
TensorFlow for Poets: https://codelabs.developers.google.com/codelabs/
tensorflow-for-poets/index.html#0
Feedback
http://bit.ly/Mobius2017
TensorFlow for Mobile Platforms. UA Mobile 2017

More Related Content

PPTX
Mobile Fest 2018. Enrique López Mañas. TensorFlow for Mobile Poets
ODP
Remote Android Rendering
PDF
ICGIS 2018 - Cloud-powered Machine Learnings on Geospactial Services (Channy ...
PDF
Pivotal CF and Continuous Delivery
PPTX
2019 05 23 Visual Studio 2019 Launch at mississauga - Machine Learning.Net
DOCX
^^ Avatar 2 related big fim camera & big efforts in recording film scenes wit...
PDF
Educating your app – adding ML edge to your apps - Maoz Tamir
PPTX
Build 2019 Recap
Mobile Fest 2018. Enrique López Mañas. TensorFlow for Mobile Poets
Remote Android Rendering
ICGIS 2018 - Cloud-powered Machine Learnings on Geospactial Services (Channy ...
Pivotal CF and Continuous Delivery
2019 05 23 Visual Studio 2019 Launch at mississauga - Machine Learning.Net
^^ Avatar 2 related big fim camera & big efforts in recording film scenes wit...
Educating your app – adding ML edge to your apps - Maoz Tamir
Build 2019 Recap

Similar to TensorFlow for Mobile Platforms. UA Mobile 2017 (20)

PDF
Machine learning, WTF!?
PDF
Kaz Sato, Evangelist, Google at MLconf ATL 2016
PDF
Persian MNIST in 5 Minutes
PDF
[Ultracode Munich #4] Short introduction to the new Android build system incl...
PPTX
object recognition ppt for minor Project
PDF
Austin,TX Meetup presentation tensorflow final oct 26 2017
PPTX
Webinar GLUGNet - Machine Learning.Net and Windows Machine Learning
PDF
Supercharge Your AI Development with Local LLMs
PDF
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
PDF
Track2 02. machine intelligence at google scale google, kaz sato, staff devel...
PDF
TensorFlow - La IA detrás de Google
PPTX
2018 12 18 Tech Valley UserGroup Machine Learning.Net
PPTX
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
PDF
Android Internals (This is not the droid you’re loking for...)
PDF
Tensorflow 2.0 and Coral Edge TPU
PPTX
Android Programming made easy
PDF
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
PDF
Mobile development in 2020
PDF
Aprendizaje automático aplicado utilizando TensorFlow
PPTX
Squeezing Deep Learning Into Mobile Phones
Machine learning, WTF!?
Kaz Sato, Evangelist, Google at MLconf ATL 2016
Persian MNIST in 5 Minutes
[Ultracode Munich #4] Short introduction to the new Android build system incl...
object recognition ppt for minor Project
Austin,TX Meetup presentation tensorflow final oct 26 2017
Webinar GLUGNet - Machine Learning.Net and Windows Machine Learning
Supercharge Your AI Development with Local LLMs
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Track2 02. machine intelligence at google scale google, kaz sato, staff devel...
TensorFlow - La IA detrás de Google
2018 12 18 Tech Valley UserGroup Machine Learning.Net
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
Android Internals (This is not the droid you’re loking for...)
Tensorflow 2.0 and Coral Edge TPU
Android Programming made easy
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
Mobile development in 2020
Aprendizaje automático aplicado utilizando TensorFlow
Squeezing Deep Learning Into Mobile Phones
Ad

More from UA Mobile (20)

PDF
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
PDF
Декларативное программирование клиент-серверных приложений на андроид - UA Mo...
PDF
Leave your Room behind - UA Mobile 2019
PDF
OpenId and OAuth2: Rear, Medium, Well Done - UA Mobile 2019
PDF
Google Wear OS watch faces and applications development - UA Mobile 2019
PDF
Історія декількох проектів та що в них пішло не так - UA Mobile 2019
PDF
Working effectively with ViewModels and TDD - UA Mobile 2019
PDF
Managing State in Reactive applications - UA Mobile 2019
PDF
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
PDF
Актуальні практики дизайну мобільних додатків - UA Mobile 2019
PDF
До чого прикладати Docker в Android? - UA Mobile 2019
PDF
Building your Flutter apps using Redux - UA Mobile 2019
PDF
Optional. Tips and Tricks - UA Mobile 2019
PDF
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
PDF
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
PDF
Flutter: No more boring apps! - UA Mobile 2019
PDF
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
PDF
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
PDF
Sceneform SDK на практиці - UA Mobile 2019
PDF
Coroutines in Kotlin. UA Mobile 2017.
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
Декларативное программирование клиент-серверных приложений на андроид - UA Mo...
Leave your Room behind - UA Mobile 2019
OpenId and OAuth2: Rear, Medium, Well Done - UA Mobile 2019
Google Wear OS watch faces and applications development - UA Mobile 2019
Історія декількох проектів та що в них пішло не так - UA Mobile 2019
Working effectively with ViewModels and TDD - UA Mobile 2019
Managing State in Reactive applications - UA Mobile 2019
Ідіоматична ін'єкція залежностей на Kotlin без фреймворків - UA Mobile2019
Актуальні практики дизайну мобільних додатків - UA Mobile 2019
До чого прикладати Docker в Android? - UA Mobile 2019
Building your Flutter apps using Redux - UA Mobile 2019
Optional. Tips and Tricks - UA Mobile 2019
Designing iOS+Android project without using multiplatform frameworks - UA Mob...
Бібліотеки та Інструменти на сторожі коду - UA Mobile 2019
Flutter: No more boring apps! - UA Mobile 2019
Долаючи прірву між дизайнерами та розробниками - UA Mobile 2019
Multiplatform shared codebase with Kotlin/Native - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019
Coroutines in Kotlin. UA Mobile 2017.
Ad

Recently uploaded (9)

PPTX
Social Media People PowerPoint Templates.pptx
DOC
NIU毕业证学历认证,阿比林基督大学毕业证留学生学历
PDF
Best 4 Sites for Buy Verified Cash App Accounts – BTC Only.pdf
PDF
Date Right Stuff - Invite only, conservative dating app
DOC
EIU毕业证学历认证,贝尔维尤学院毕业证国外毕业证
PDF
Kids, Screens & Emotional Development by Meenakshi Khakat
PDF
2025 Guide to Buy Verified Cash App Accounts You Can Trust.pdf
DOC
SIUE毕业证学历认证,阿祖萨太平洋大学毕业证学位证书复制
PPTX
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx
Social Media People PowerPoint Templates.pptx
NIU毕业证学历认证,阿比林基督大学毕业证留学生学历
Best 4 Sites for Buy Verified Cash App Accounts – BTC Only.pdf
Date Right Stuff - Invite only, conservative dating app
EIU毕业证学历认证,贝尔维尤学院毕业证国外毕业证
Kids, Screens & Emotional Development by Meenakshi Khakat
2025 Guide to Buy Verified Cash App Accounts You Can Trust.pdf
SIUE毕业证学历认证,阿祖萨太平洋大学毕业证学位证书复制
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx

TensorFlow for Mobile Platforms. UA Mobile 2017