SlideShare uma empresa Scribd logo
1 de 19
Fusing AI with AR
By Stephen Wylie
Windy City DevFest - Chicago
Feb. 1, 2019
About Me
● Google Developer Expert in Machine Learning
● 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
AI + AR: Does anyone do this themselves?
Yes, of course! But with help…
Vehicle Recognition & Auto Loans
● Blippar - AR/VR company
● Capital One - AR feature of
Auto Navigator
● USAA - Loans & insurance
APIs & Frameworks Are Your Friends!
Retail
● Burberry - Customize items,
detect counterfeits
● Cup Noodles - Turn cups into
musical instruments
Sports
● Homecourt- Practice
basketball, get coaching
● MLB - ID players, show stats
Key Terms
● 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
● 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
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-
ConnectionFragment
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
Install Prerequisites
● 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
- 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-
ConnectionFragment
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
Start Modifying Code
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
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-
ConnectionFragment
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
Build with Bazel
● 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 in “Windows Kits” directory
● Pray hard!
What
Success
Looks
Like
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-
ConnectionFragment
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
Add Augmented Reality Code
● 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
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-
ConnectionFragment
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
“Turn your phone into an incendiary device!
Run AI & AR at the same time.”
Throttling AI is key.
Pitfalls of AI + AR: Depth & size of object
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
Pitfalls of AI + AR: Sensor drift
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
Pitfalls of AI + AR: Tracking multiple objects
● 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
Thank You
@SWebCEO
goshtastic.blogspot.com
github.com/mrcity/mlworkshop
Slideshare: StephenWylie3

Mais conteúdo relacionado

Semelhante a Fusing Artificial Intelligence with Augmented Reality on Android - 1 Feb. 2019

Philipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudePhilipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudeAugmentedWorldExpo
 
Data Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsData Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsSafe Software
 
Augmented reality
Augmented realityAugmented reality
Augmented realitydzubovua
 
SEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
SEARIS 2014 Keynote - MiddleVR - Philosophy and architectureSEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
SEARIS 2014 Keynote - MiddleVR - Philosophy and architectureSebastien Kuntz
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...Hafez Kamal
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGLGlobant
 
Scope of Android and Future Work
Scope of Android and Future WorkScope of Android and Future Work
Scope of Android and Future WorkRabiRehman1
 
Build your own remote control. Droidcon greece 2016
Build your own remote control. Droidcon greece 2016Build your own remote control. Droidcon greece 2016
Build your own remote control. Droidcon greece 2016Jesus Gumiel
 
Compilation Of C/C++ program in Android
Compilation Of C/C++ program in AndroidCompilation Of C/C++ program in Android
Compilation Of C/C++ program in Androidrahulverma1080
 
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
 
Solving IoT Hardware Issues With Docker
Solving IoT Hardware Issues With DockerSolving IoT Hardware Issues With Docker
Solving IoT Hardware Issues With DockerWill Hall
 
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...Jason Conger
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google DevsCraig Dunn
 
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023Pedro Vicente
 
sdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicsdc-2016-gvrf-and-io_public
sdc-2016-gvrf-and-io_publicRick Lau
 
Augmented Reality Application - Final Year Project
Augmented Reality Application - Final Year ProjectAugmented Reality Application - Final Year Project
Augmented Reality Application - Final Year ProjectYash Kaushik
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App DevelopmentAnnmarie Lanesey
 

Semelhante a Fusing Artificial Intelligence with Augmented Reality on Android - 1 Feb. 2019 (20)

Philipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with WikitudePhilipp Nagele (Wikitude): What's Next with Wikitude
Philipp Nagele (Wikitude): What's Next with Wikitude
 
Data Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsData Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing Transformations
 
Virtual reality
Virtual realityVirtual reality
Virtual reality
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
 
Augmented reality
Augmented realityAugmented reality
Augmented reality
 
SEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
SEARIS 2014 Keynote - MiddleVR - Philosophy and architectureSEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
SEARIS 2014 Keynote - MiddleVR - Philosophy and architecture
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
Scope of Android and Future Work
Scope of Android and Future WorkScope of Android and Future Work
Scope of Android and Future Work
 
Build your own remote control. Droidcon greece 2016
Build your own remote control. Droidcon greece 2016Build your own remote control. Droidcon greece 2016
Build your own remote control. Droidcon greece 2016
 
Compilation Of C/C++ program in Android
Compilation Of C/C++ program in AndroidCompilation Of C/C++ program in Android
Compilation Of C/C++ program in 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
 
Solving IoT Hardware Issues With Docker
Solving IoT Hardware Issues With DockerSolving IoT Hardware Issues With Docker
Solving IoT Hardware Issues With Docker
 
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google Devs
 
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
 
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
 
Augmented Reality Application - Final Year Project
Augmented Reality Application - Final Year ProjectAugmented Reality Application - Final Year Project
Augmented Reality Application - Final Year Project
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
 

Último

Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 

Último (20)

Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 

Fusing Artificial Intelligence with Augmented Reality on Android - 1 Feb. 2019

  • 1. Fusing AI with AR By Stephen Wylie Windy City DevFest - Chicago Feb. 1, 2019
  • 2. About Me ● Google Developer Expert in Machine Learning ● 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
  • 3. AI + AR: Does anyone do this themselves? Yes, of course! But with help… Vehicle Recognition & Auto Loans ● Blippar - AR/VR company ● Capital One - AR feature of Auto Navigator ● USAA - Loans & insurance APIs & Frameworks Are Your Friends! Retail ● Burberry - Customize items, detect counterfeits ● Cup Noodles - Turn cups into musical instruments Sports ● Homecourt- Practice basketball, get coaching ● MLB - ID players, show stats
  • 4. Key Terms ● 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 ● ARCore Cross-platform augmented reality SDK using OpenGL for motion tracking, scene building ● Sceneform AR SDK for Android saving you from learning OpenGL
  • 5. 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- ConnectionFragment 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
  • 6. Install Prerequisites ● 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 - Android Studio - Android API level - Android NDK - Gradle - Bazel
  • 7. 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- ConnectionFragment 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
  • 8. Start Modifying Code 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
  • 9. 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- ConnectionFragment 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
  • 10. Build with Bazel ● 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 in “Windows Kits” directory ● Pray hard!
  • 12. 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- ConnectionFragment 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
  • 13. Add Augmented Reality Code ● 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
  • 14. 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- ConnectionFragment 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
  • 15. Pitfalls of AI + AR: Battery life “Turn your phone into an incendiary device! Run AI & AR at the same time.” Throttling AI is key.
  • 16. Pitfalls of AI + AR: Depth & size of object 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
  • 17. Pitfalls of AI + AR: Sensor drift 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
  • 18. Pitfalls of AI + AR: Tracking multiple objects ● 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

Notas do Editor

  1. Imagine recognizing a chair with your app. A normal-sized chair might be detected and you might understand it’s about 3 feet tall and 2 feet wide. This is useful to know when you’re sizing the billboard But then how far away from the camera is the chair? You’ll need to know that in order to find out where to place the billboard in space. Now imagine if your camera picks up on a tiny chair in a dollhouse. Your original billboard would be far too big to display with the chair if it were correctly placed above the chair. But, more likely, it would be placed way beyond the chair, and then the billboard would only appear correctly if you hold your phone at a specific angle. To capture the tiny dollhouse chair correctly, we need to consider our options: