Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TensorFlow for Mobile Developers
Search
Enrique López Mañas
February 22, 2018
Programming
0
130
TensorFlow for Mobile Developers
TensorFlow for Mobile Developers @ DroidKaigi
Enrique López Mañas
February 22, 2018
Tweet
Share
More Decks by Enrique López Mañas
See All by Enrique López Mañas
KMP_for_Swift.pdf
kikoso
0
34
Android Benchmarking and other stories
kikoso
0
120
KMP for Mobile Developers
kikoso
0
55
Diving into Coroutines
kikoso
1
57
K/N for mobile developers (including libraries' snippets)
kikoso
0
55
Kotlin/Native for Multiplatform development
kikoso
0
59
TensorFlow for Mobile Developers
kikoso
0
21
Kotlin/Native for Multiplatform development
kikoso
1
170
Digging into authentications and permissions in Firebase
kikoso
2
540
Other Decks in Programming
See All in Programming
What you can do with Ruby on WebAssembly
kateinoigakukun
0
170
GenU導入でCDKに初挑戦し、悪戦苦闘した話
hideg
0
160
AndroidアプリのUIバリエーションをあの手この手で確認する / Check UI variations of Android apps by various means
tkmnzm
1
170
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
170
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
From Idea to IDE: Developing Plugins for Android Studio
thisaay
1
220
Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
satoshi256kbyte
2
260
Kotlin 2.0が与えるAndroid開発の進化
masayukisuda
1
410
Understand the mechanism! Let's do screenshots tests of Compose Previews with various variations / 仕組みから理解する!Composeプレビューを様々なバリエーションでスクリーンショットテストしよう
sumio
3
790
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
430
The Sequel to a Dream of Ruby Parser's Grammar
ydah
1
220
Some more adventure of Happy Eyeballs
coe401_
2
190
Featured
See All Featured
Facilitating Awesome Meetings
lara
49
5.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
1
53
Making Projects Easy
brettharned
113
5.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
41
6.5k
Gamification - CAS2011
davidbonilla
79
5k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
Design by the Numbers
sachag
277
19k
Into the Great Unknown - MozCon
thekraken
29
1.4k
For a Future-Friendly Web
brad_frost
174
9.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
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
Shameless self-promotion www.kotlinweekly.net
Feedback! http://bit.ly/droidkaigi
None