Home Data Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

By Anubhav Singh , Rimjhim Bhadani
books-svg-icon Book
eBook $29.99 $20.98
Print $43.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $29.99 $20.98
Print $43.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Mobile Vision - Face Detection Using On-Device Models
About this book
Deep learning is rapidly becoming the most popular topic in the mobile app industry. This book introduces trending deep learning concepts and their use cases with an industrial and application-focused approach. You will cover a range of projects covering tasks such as mobile vision, facial recognition, smart artificial intelligence assistant, augmented reality, and more. With the help of eight projects, you will learn how to integrate deep learning processes into mobile platforms, iOS, and Android. This will help you to transform deep learning features into robust mobile apps efficiently. You’ll get hands-on experience of selecting the right deep learning architectures and optimizing mobile deep learning models while following an application oriented-approach to deep learning on native mobile apps. We will later cover various pre-trained and custom-built deep learning model-based APIs such as machine learning (ML) Kit through Firebase. Further on, the book will take you through examples of creating custom deep learning models with TensorFlow Lite. Each project will demonstrate how to integrate deep learning libraries into your mobile apps, right from preparing the model through to deployment. By the end of this book, you’ll have mastered the skills to build and deploy deep learning mobile applications on both iOS and Android.
Publication date:
April 2020
Publisher
Packt
Pages
380
ISBN
9781789611212

 

Mobile Vision - Face Detection Using On-Device Models

In this chapter, we will build a Flutter application that is capable of detecting faces from media uploaded from the gallery of a device or directly from the camera using the ML Kit's Firebase Vision Face Detection API. The API leverages the power of pre-trained models hosted on Firebase and provides the application, the ability to identify the key features of a face, detect the expression, and get the contours of the detected faces. As the face detection is performed in real time by the API, it can also be used to track faces in a video sequence, in a video chat, or in games that respond to the user's expression. The application, coded in Dart, will work efficiently on Android and iOS devices.

In this chapter, we will be covering the following topics:

  • Introduction to image processing
  • Developing a...
 

Technical requirements

 

Introduction to image processing

In this chapter, we shall be detecting faces in images. In the context of artificial intelligence, the action of processing an image for the purpose of extracting information about the visual content of that image is called image processing.

Image processing is an emerging field, thanks to the surge in the number of better AI-powered cameras, medical imagery-based machine learning, self-driving vehicles, analysis of people's emotions from images, and many other applications.

Consider the use of image processing by a self-driving vehicle. The vehicle needs to make decisions in as close to real time as possible to ensure the best possible accident-free driving. A delay in the response of the AI model running the car could lead to catastrophic consequences. Several techniques and algorithms have been developed for fast and accurate...

 

Developing a face detection application using Flutter

With the basic understanding of how a CNN works from Chapter 1Introduction to Deep Learning for Mobile, and how image processing is done at the most basic level, we are ready to proceed with using the pre-trained models from Firebase ML Kit to detect faces from the given images.

We will be using the Firebase ML Kit Face Detection API to detect the faces in an image. The key features of the Firebase Vision Face Detection API are as follows:

  • Recognize and return the coordinates of facial features such as the eyes, ears, cheeks, nose, and mouth of every face detected.
  • Get the contours of detected faces and facial features.
  • Detect facial expressions, such as whether a person is smiling or has one eye closed.
  • Get an identifier for each individual face detected in a video frame. This identifier is consistent across invocations...
 

Summary

In this chapter, we examined the concept behind image processing and how we can integrate it with our Android- or iOS-based application made using Flutter to perform face detection. The chapter started with adding relevant dependencies to support the functionalities of Firebase ML Kit and the image_picker library. The required UI components with the necessary functionalities were added. The implementation mainly covered image file selection using the Flutter plugin and how images can be processed once they are selected. An example of on-device Face Detector model usage was presented, along with an in-depth discussion of the method by which the implementation was carried out. 

In the next chapter, we will be discussing how you can create your own AI-powered chatbot that can double-up as a virtual assistant using the Actions on Google platform.&...

About the Authors
  • Anubhav Singh

    Anubhav Singh, a web developer since before Bootstrap was launched, is an explorer of technologies, often pulling off crazy combinations of uncommon tech. An international rank holder in the Cyber Olympiad, he started off by developing his own social network and search engine as his first projects at the age of 15, which stood among the top 500 websites of India during their operational years. He's continuously developing software for the community in domains with roads less walked on. You can often catch him guiding students on how to approach ML or the web, or both together. He's also the founder of The Code Foundation, an AI-focused start-up. Anubhav is a Venkat Panchapakesan Memorial Scholarship awardee and an Intel Software Innovator.

    Browse publications by this author
  • Rimjhim Bhadani

    Rimjhim Bhadani is an open source lover. She has always believed in making the resources accessible to everyone at a minimal cost. She is a big fan of Mobile Application Development and has developed a number of projects most which aim to solve major and minor daily life challenges. She has been an Android mentor in Google Code-In and an Android developer for Google Summer of Code. Supporting her vision to serve the community, she is one among the six Indian students to be recognized as Google Venkat Panchapakesan Memorial Scholar and one among the three Indian students to be awarded the Grace Hopper Student Scholarship in 2019.

    Browse publications by this author
Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter
Unlock this book and the full library FREE for 7 days
Start now