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
160
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
Composifying Your Not-Compose Code
kikoso
0
9
Guardrails and Sanity Checks: Verifying LLM Input and Output for Developers
kikoso
0
49
KMP_for_Swift.pdf
kikoso
0
55
Android Benchmarking and other stories
kikoso
0
310
KMP for Mobile Developers
kikoso
0
71
Diving into Coroutines
kikoso
1
76
K/N for mobile developers (including libraries' snippets)
kikoso
0
99
Kotlin/Native for Multiplatform development
kikoso
0
73
TensorFlow for Mobile Developers
kikoso
0
21
Other Decks in Programming
See All in Programming
Agentに至る道 〜なぜLLMは自動でコードを書けるようになったのか〜
mackee
5
2.2k
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
11
3.5k
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
1
110
Atomics APIを知る / Understanding Atomics API
ssssota
1
220
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
120
開発15年のAIネイティブでない 巨大サービスのAI最適化
rapicro
0
100
All(?) About Point Sets
hole
0
220
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
500
AWS CDKの推しポイントN選
akihisaikeda
1
210
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
14
14k
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
11
6.1k
生成AIを活用したリファクタリング実践 ~コードスメルをなくすためのアプローチ
raedion
0
140
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
11
940
Building Adaptive Systems
keathley
44
2.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Navigating Team Friction
lara
190
16k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Scaling GitHub
holman
464
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Facilitating Awesome Meetings
lara
57
6.6k
Unsuck your backbone
ammeep
671
58k
Documentation Writing (for coders)
carmenintech
76
5.1k
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