SlideShare a Scribd company logo
1 of 30
Stephen Wylie
GDG Dallas
@SWebCEO
Fusing AI with AR
NH GDG
DevFest
9/28/2019
NH GDG
DevFest
●GDE in Machine Learning
●Software Engineer @ rewardStyle
●Fix old arcade machines & computers, and pinballs
of all eras
●Love fancy men’s clothing & vintage TV game
shows
●Lots of patents in this area
About Me
AI + AR:
Does anyone do this
themselves?
NH GDG
DevFest
Sports
● Homecourt- Practice
basketball, get coaching
● MLB - ID players, show stats
AI + AR: Does anyone do this themselves?
Yes, of course! But with help...
APIs & Frameworks Are Your Friends!
Retail
● Burberry - Customize items,
detect counterfeits
● Cup Noodles - Turn cups into
musical instruments
● Wayfair, IKEA - Preview items
in your own house
Vehicle Recognition & Auto
Loans
● Blippar - AR/VR company
● Capital One - AR feature of
Auto Navigator
● USAA - Loans & insurance
Key Terms
Key Terms
In AI
● MobileNet, SqueezeNet,
Inception, ResNet
Neural networks optimized for
computer vision tasks
● Tensorflow Lite
Inference engine optimized to run
.tflite models on mobile devices
● MLKit
APIs that enable specific Machine
Learning use cases on devices or
cloud
In AR
● ARCore
Cross-platform augmented reality
SDK using OpenGL for motion
tracking, scene building
● Sceneform
AR SDK for Android saving you
from learning OpenGL
Establish your
Android app
Establish your Android app
Preparation
Install prereqs
Install latest
versions of
APIs, SDKs,
IDEs, and build
tools
Preparation
Clone repo
Get
Tensorflow
source from
Docker, Github,
etc.
Understand &
Build
Open app code
Edit app code
to use
Sceneform
fragment
rather than
Camera-
ConnectionFra
gment
Bust your
head
Build with Bazel
This smooths
object
detection,
improves
tracking on
recognized
entities
Build
More
Add AR code
Hit test the
bounding box
and draw the
3D model
relative to that
point
Finish
Profit!
Or, fix
problems and
build your own
TFLite model
NH GDG
DevFest
●Latest:
●Java JDK 10 (not 11, not 8)
●Building in Windows? You’ll need ~5GB worth of:
○Visual C++ Build Tools - visualcppbuildtools_full.exe
■Windows 10 SDK 10.0.10240
■.NET Framework SDK
○A real shell like MSYS2
●Pick your poison! Download Tensorflow source from GitHub or
Docker
Install Prerequisites
●Android Studio
●Android API level
●Android NDK
●Gradle
●Bazel
Establish your Android app
Preparation
Install prereqs
Install latest
versions of
APIs, SDKs,
IDEs, and build
tools
Preparation
Clone repo
Get
Tensorflow
source from
Docker, Github,
etc.
Understand &
Build
Open app code
Edit app code
to use
Sceneform
fragment
rather than
Camera-
ConnectionFra
gment
Bust your
head
Build with Bazel
This smooths
object
detection,
improves
tracking on
recognized
entities
Build
More
Add AR code
Hit test the
bounding box
and draw the
3D model
relative to that
point
Finish
Profit!
Or, fix
problems and
build your own
TFLite model
NH GDG
DevFest
Code root: tensorflow/tensorflow/lite/examples/android/app
●Consider copying to a different folder
●Add Sceneform dependencies to Gradle build
●Update Gradle build to latest Tools, API >= 26
●Add AR permissions to Android Manifest
●Make new Layout incorporating ArFragment
●Use this Layout in your CameraActivity
○Or make it a separate class
○Update Manifest with new Activity
○Ensure DetectorActivity extends it
Gradle downloads ML model assets
Start Modifying Code
Code
Thus
Far
Establish your Android app
Preparation
Install prereqs
Install latest
versions of
APIs, SDKs,
IDEs, and build
tools
Preparation
Clone repo
Get
Tensorflow
source from
Docker, Github,
etc.
Understand &
Build
Open app code
Edit app code
to use
Sceneform
fragment
rather than
Camera-
ConnectionFra
gment
Bust your
head
Build with Bazel
This smooths
object
detection,
improves
tracking on
recognized
entities
Build
More
Add AR code
Hit test the
bounding box
and draw the
3D model
relative to that
point
Finish
Profit!
Or, fix
problems and
build your own
TFLite model
NH GDG
DevFest
●Define androidsdk and androidndk path in
WORKSPACE
●Omit API level & build tools version
●cd to tensorflow/
●Run bazel build
//tensorflow/lite/examples/android:tflite_demo
●Funky Windows business
●Pray hard!
Build with Bazel
What
Success
Looks
Like
Code
Thus
Far
Establish your Android app
Preparation
Install prereqs
Install latest
versions of
APIs, SDKs,
IDEs, and build
tools
Preparation
Clone repo
Get
Tensorflow
source from
Docker, Github,
etc.
Understand &
Build
Open app code
Edit app code
to use
Sceneform
fragment
rather than
Camera-
ConnectionFra
gment
Bust your
head
Build with Bazel
This smooths
object
detection,
improves
tracking on
recognized
entities
Build
More
Add AR code
Hit test the
bounding box
and draw the
3D model
relative to that
point
Finish
Profit!
Or, fix
problems and
build your own
TFLite model
NH GDG
DevFest
●Can’t use Bazel anymore
○Incorporate object detection model into src/main/jniLibs
○Set parameter for CPU architecture in Gradle
●Sceneform Plugin or Gradle Instruction
○Sceneform codelab calls for 1.4; Android Studio plugin is 1.6
○Best to just use Gradle instructions to create SFB assets
●Add augmented reality code to MultiBoxTracker
Add Augmented Reality Code
Final
Product
Establish your Android app
Preparation
Install prereqs
Install latest
versions of
APIs, SDKs,
IDEs, and build
tools
Preparation
Clone repo
Get
Tensorflow
source from
Docker, Github,
etc.
Understand &
Build
Open app code
Edit app code
to use
Sceneform
fragment
rather than
Camera-
ConnectionFra
gment
Bust your
head
Build with Bazel
This smooths
object
detection,
improves
tracking on
recognized
entities
Build
More
Add AR code
Hit test the
bounding box
and draw the
3D model
relative to that
point
Finish
Profit!
Or, fix
problems and
build your own
TFLite model
Pitfalls of AI + AR
Battery Life
A Pitfall of AI + AR
“Turn your phone
into an incendiary
device!
Run AI & AR at the
same time.”
Throttling AI is key.
NH GDG
DevFest
Depth & size of object
Another Pitfall of AI + AR
Projecting 3D object in AR requires good understanding of 3D space:
●Size of object, in pixels,
proportional to the camera
●Size of object, in real life,
to position 3D object correctly
●Positioning 3D object visible
to user without maneuvering
●Improvement: Correlate bounding box with hit detection
NH GDG
DevFest
Sensor drift
Yet Another Pitfall of AI + AR
Object out of the viewport?
●AR relies on point clouds, hardware sensors
●Hardware sensors likely to drift with lots of motion
●Objects anchored to world space likely to wander off
Solution?
●Ensure scene has good contrast, enough corners to see every
frame
●Attach objects to anchors
●Scan enough of the scene ahead of time before drawing AR
NH GDG
DevFest
Tracking Multiple Objects
And Yet Another Pitfall of AI + AR
●Object detections could be missed, false, or switch IDs
●Discover correlations between objects moving on camera
○Pairwise dependencies
○Uniform or non-uniform hypergraph
●Multiple object tracking is easier with the tensorflowlite_demo library
●No library? Gotta code it yourself!
Mitigating This
●Consumption issues? Minimize anchors as you instantiate objects
●Take the time to set up NDK and/or libraries
Building Your Model
NH GDG
DevFest
●Garbage in, garbage out
● Need at least 100 samples per category
○ Kaggle
○ Record your own videos
● Keras imagedatagenerator
● Label your own bounding boxes
Collecting Data
NH GDG
DevFest
Building Your Model
Tensorflow Cloud AutoML +
Firebase
NH GDG
DevFest
●tflite_convert binary available in Github code
○ Convert a GraphDef
○ Convert a SavedModel
○ Convert a Keras model
● Or, use AutoML Vision Object Detection Beta
○ AutoML Vision Edge in ML Kit - Export to Android using Firebase
○ Models in this form are quantized - i.e. ints, not floats
○ Small, edge device compatible; may lose accuracy
Converting Your Model
Thank You!
ML Summit ‘19
#MLSummit
@SWebCEO
goshtastic.blogspot.com
github.com/mrcity/mlworkshop
Slideshare: StephenWylie3

More Related Content

Similar to Fusing AI With AR for Android - 9/28/2019

TensorFlow - La IA detrás de Google
TensorFlow - La IA detrás de GoogleTensorFlow - La IA detrás de Google
TensorFlow - La IA detrás de GoogleIsrael Blancas
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGLGlobant
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeWaqqas Jabbar
 
The 10 Commandments For The Eager Developer
The 10 Commandments For The Eager DeveloperThe 10 Commandments For The Eager Developer
The 10 Commandments For The Eager DeveloperTsvika Kleinman
 
Nodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNicola Del Gobbo
 
Hack'n Break Android Workshop
Hack'n Break Android WorkshopHack'n Break Android Workshop
Hack'n Break Android WorkshopElif Boncuk
 
Tooling Matters - Development tools
Tooling Matters - Development toolsTooling Matters - Development tools
Tooling Matters - Development toolsSimon Dittlmann
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneursRodrigo Gil
 
sdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicsdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicRick Lau
 
NodeWay in my project & sails.js
NodeWay in my project & sails.jsNodeWay in my project & sails.js
NodeWay in my project & sails.jsDmytro Ovcharenko
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudChris Schalk
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveSebastian Vieira
 
Bdd agile requirements
Bdd agile requirementsBdd agile requirements
Bdd agile requirementsAgile Vietnam
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTWaqqas Jabbar
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Androidnatdefreitas
 
From Cardboard to Daydream - The Evolution of VR on Android
From Cardboard to Daydream - The Evolution of VR on AndroidFrom Cardboard to Daydream - The Evolution of VR on Android
From Cardboard to Daydream - The Evolution of VR on AndroidOscar Salguero
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloudwesley chun
 
Interfaces of the future now available augmented reality - google glass - 3...
Interfaces of the future now available   augmented reality - google glass - 3...Interfaces of the future now available   augmented reality - google glass - 3...
Interfaces of the future now available augmented reality - google glass - 3...CuriousInventor
 

Similar to Fusing AI With AR for Android - 9/28/2019 (20)

TensorFlow - La IA detrás de Google
TensorFlow - La IA detrás de GoogleTensorFlow - La IA detrás de Google
TensorFlow - La IA detrás de Google
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
The 10 Commandments For The Eager Developer
The 10 Commandments For The Eager DeveloperThe 10 Commandments For The Eager Developer
The 10 Commandments For The Eager Developer
 
Nodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to hero
 
Hack'n Break Android Workshop
Hack'n Break Android WorkshopHack'n Break Android Workshop
Hack'n Break Android Workshop
 
Tooling Matters - Development tools
Tooling Matters - Development toolsTooling Matters - Development tools
Tooling Matters - Development tools
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
 
Spark core intro
Spark core introSpark core intro
Spark core intro
 
sdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicsdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_public
 
NodeWay in my project & sails.js
NodeWay in my project & sails.jsNodeWay in my project & sails.js
NodeWay in my project & sails.js
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
 
Android Lollipop: The developer's perspective
Android Lollipop: The developer's perspectiveAndroid Lollipop: The developer's perspective
Android Lollipop: The developer's perspective
 
Bdd agile requirements
Bdd agile requirementsBdd agile requirements
Bdd agile requirements
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUST
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
From Cardboard to Daydream - The Evolution of VR on Android
From Cardboard to Daydream - The Evolution of VR on AndroidFrom Cardboard to Daydream - The Evolution of VR on Android
From Cardboard to Daydream - The Evolution of VR on Android
 
Introduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google CloudIntroduction to Cloud Computing with Google Cloud
Introduction to Cloud Computing with Google Cloud
 
Interfaces of the future now available augmented reality - google glass - 3...
Interfaces of the future now available   augmented reality - google glass - 3...Interfaces of the future now available   augmented reality - google glass - 3...
Interfaces of the future now available augmented reality - google glass - 3...
 

Recently uploaded

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfrs7054576148
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 

Recently uploaded (20)

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

Fusing AI With AR for Android - 9/28/2019

  • 1. Stephen Wylie GDG Dallas @SWebCEO Fusing AI with AR NH GDG DevFest 9/28/2019
  • 2. NH GDG DevFest ●GDE in Machine Learning ●Software Engineer @ rewardStyle ●Fix old arcade machines & computers, and pinballs of all eras ●Love fancy men’s clothing & vintage TV game shows ●Lots of patents in this area About Me
  • 3. AI + AR: Does anyone do this themselves?
  • 4. NH GDG DevFest Sports ● Homecourt- Practice basketball, get coaching ● MLB - ID players, show stats AI + AR: Does anyone do this themselves? Yes, of course! But with help... APIs & Frameworks Are Your Friends! Retail ● Burberry - Customize items, detect counterfeits ● Cup Noodles - Turn cups into musical instruments ● Wayfair, IKEA - Preview items in your own house Vehicle Recognition & Auto Loans ● Blippar - AR/VR company ● Capital One - AR feature of Auto Navigator ● USAA - Loans & insurance
  • 6. Key Terms In AI ● MobileNet, SqueezeNet, Inception, ResNet Neural networks optimized for computer vision tasks ● Tensorflow Lite Inference engine optimized to run .tflite models on mobile devices ● MLKit APIs that enable specific Machine Learning use cases on devices or cloud In AR ● ARCore Cross-platform augmented reality SDK using OpenGL for motion tracking, scene building ● Sceneform AR SDK for Android saving you from learning OpenGL
  • 8. Establish your Android app Preparation Install prereqs Install latest versions of APIs, SDKs, IDEs, and build tools Preparation Clone repo Get Tensorflow source from Docker, Github, etc. Understand & Build Open app code Edit app code to use Sceneform fragment rather than Camera- ConnectionFra gment Bust your head Build with Bazel This smooths object detection, improves tracking on recognized entities Build More Add AR code Hit test the bounding box and draw the 3D model relative to that point Finish Profit! Or, fix problems and build your own TFLite model
  • 9. NH GDG DevFest ●Latest: ●Java JDK 10 (not 11, not 8) ●Building in Windows? You’ll need ~5GB worth of: ○Visual C++ Build Tools - visualcppbuildtools_full.exe ■Windows 10 SDK 10.0.10240 ■.NET Framework SDK ○A real shell like MSYS2 ●Pick your poison! Download Tensorflow source from GitHub or Docker Install Prerequisites ●Android Studio ●Android API level ●Android NDK ●Gradle ●Bazel
  • 10. Establish your Android app Preparation Install prereqs Install latest versions of APIs, SDKs, IDEs, and build tools Preparation Clone repo Get Tensorflow source from Docker, Github, etc. Understand & Build Open app code Edit app code to use Sceneform fragment rather than Camera- ConnectionFra gment Bust your head Build with Bazel This smooths object detection, improves tracking on recognized entities Build More Add AR code Hit test the bounding box and draw the 3D model relative to that point Finish Profit! Or, fix problems and build your own TFLite model
  • 11. NH GDG DevFest Code root: tensorflow/tensorflow/lite/examples/android/app ●Consider copying to a different folder ●Add Sceneform dependencies to Gradle build ●Update Gradle build to latest Tools, API >= 26 ●Add AR permissions to Android Manifest ●Make new Layout incorporating ArFragment ●Use this Layout in your CameraActivity ○Or make it a separate class ○Update Manifest with new Activity ○Ensure DetectorActivity extends it Gradle downloads ML model assets Start Modifying Code
  • 13. Establish your Android app Preparation Install prereqs Install latest versions of APIs, SDKs, IDEs, and build tools Preparation Clone repo Get Tensorflow source from Docker, Github, etc. Understand & Build Open app code Edit app code to use Sceneform fragment rather than Camera- ConnectionFra gment Bust your head Build with Bazel This smooths object detection, improves tracking on recognized entities Build More Add AR code Hit test the bounding box and draw the 3D model relative to that point Finish Profit! Or, fix problems and build your own TFLite model
  • 14. NH GDG DevFest ●Define androidsdk and androidndk path in WORKSPACE ●Omit API level & build tools version ●cd to tensorflow/ ●Run bazel build //tensorflow/lite/examples/android:tflite_demo ●Funky Windows business ●Pray hard! Build with Bazel
  • 17. Establish your Android app Preparation Install prereqs Install latest versions of APIs, SDKs, IDEs, and build tools Preparation Clone repo Get Tensorflow source from Docker, Github, etc. Understand & Build Open app code Edit app code to use Sceneform fragment rather than Camera- ConnectionFra gment Bust your head Build with Bazel This smooths object detection, improves tracking on recognized entities Build More Add AR code Hit test the bounding box and draw the 3D model relative to that point Finish Profit! Or, fix problems and build your own TFLite model
  • 18. NH GDG DevFest ●Can’t use Bazel anymore ○Incorporate object detection model into src/main/jniLibs ○Set parameter for CPU architecture in Gradle ●Sceneform Plugin or Gradle Instruction ○Sceneform codelab calls for 1.4; Android Studio plugin is 1.6 ○Best to just use Gradle instructions to create SFB assets ●Add augmented reality code to MultiBoxTracker Add Augmented Reality Code
  • 20. Establish your Android app Preparation Install prereqs Install latest versions of APIs, SDKs, IDEs, and build tools Preparation Clone repo Get Tensorflow source from Docker, Github, etc. Understand & Build Open app code Edit app code to use Sceneform fragment rather than Camera- ConnectionFra gment Bust your head Build with Bazel This smooths object detection, improves tracking on recognized entities Build More Add AR code Hit test the bounding box and draw the 3D model relative to that point Finish Profit! Or, fix problems and build your own TFLite model
  • 22. Battery Life A Pitfall of AI + AR “Turn your phone into an incendiary device! Run AI & AR at the same time.” Throttling AI is key.
  • 23. NH GDG DevFest Depth & size of object Another Pitfall of AI + AR Projecting 3D object in AR requires good understanding of 3D space: ●Size of object, in pixels, proportional to the camera ●Size of object, in real life, to position 3D object correctly ●Positioning 3D object visible to user without maneuvering ●Improvement: Correlate bounding box with hit detection
  • 24. NH GDG DevFest Sensor drift Yet Another Pitfall of AI + AR Object out of the viewport? ●AR relies on point clouds, hardware sensors ●Hardware sensors likely to drift with lots of motion ●Objects anchored to world space likely to wander off Solution? ●Ensure scene has good contrast, enough corners to see every frame ●Attach objects to anchors ●Scan enough of the scene ahead of time before drawing AR
  • 25. NH GDG DevFest Tracking Multiple Objects And Yet Another Pitfall of AI + AR ●Object detections could be missed, false, or switch IDs ●Discover correlations between objects moving on camera ○Pairwise dependencies ○Uniform or non-uniform hypergraph ●Multiple object tracking is easier with the tensorflowlite_demo library ●No library? Gotta code it yourself! Mitigating This ●Consumption issues? Minimize anchors as you instantiate objects ●Take the time to set up NDK and/or libraries
  • 27. NH GDG DevFest ●Garbage in, garbage out ● Need at least 100 samples per category ○ Kaggle ○ Record your own videos ● Keras imagedatagenerator ● Label your own bounding boxes Collecting Data
  • 28. NH GDG DevFest Building Your Model Tensorflow Cloud AutoML + Firebase
  • 29. NH GDG DevFest ●tflite_convert binary available in Github code ○ Convert a GraphDef ○ Convert a SavedModel ○ Convert a Keras model ● Or, use AutoML Vision Object Detection Beta ○ AutoML Vision Edge in ML Kit - Export to Android using Firebase ○ Models in this form are quantized - i.e. ints, not floats ○ Small, edge device compatible; may lose accuracy Converting Your Model
  • 30. Thank You! ML Summit ‘19 #MLSummit @SWebCEO goshtastic.blogspot.com github.com/mrcity/mlworkshop Slideshare: StephenWylie3