Book Image

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

By : Anubhav Singh, Rimjhim Bhadani
Book Image

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

By: Anubhav Singh, Rimjhim Bhadani

Overview of 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.
Table of Contents (13 chapters)

Getting pictures from the device's local storage

In this section, we will add the functionality of FloatingActionButton to let the user choose an image from the gallery of the device. This will eventually be sent to the server so that we can receive a response.

The following steps describe how to launch the gallery and let the user choose an image:

  1. To allow the user to choose an image from the device's gallery, we will use the image_picker library. This launches the gallery and stores the image file selected by the user. We will start by adding a dependency in the pubspec.yaml file:
image_picker: 0.4.12+1

Also, we fetch the library by running flutter pub get on the Terminal.

  1. Next, we import the library inside the image_super_resolution.dart file:
import 'package:image_picker/image_picker.dart';
  1. Now, let's define the pickImage() ...