Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Intelligent Mobile Projects with TensorFlow

You're reading from   Intelligent Mobile Projects with TensorFlow Build 10+ Artificial Intelligence apps using TensorFlow Mobile and Lite for iOS, Android, and Raspberry Pi

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788834544
Length 404 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jeff Tang Jeff Tang
Author Profile Icon Jeff Tang
Jeff Tang
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with Mobile TensorFlow FREE CHAPTER 2. Classifying Images with Transfer Learning 3. Detecting Objects and Their Locations 4. Transforming Pictures with Amazing Art Styles 5. Understanding Simple Speech Commands 6. Describing Images in Natural Language 7. Recognizing Drawing with CNN and LSTM 8. Predicting Stock Price with RNN 9. Generating and Enhancing Images with GAN 10. Building an AlphaZero-like Mobile Game App 11. Using TensorFlow Lite and Core ML on Mobile 12. Developing TensorFlow Apps on Raspberry Pi 13. Other Books You May Enjoy

To get the most out of this book

We recommend that you start with reading the first four chapters in order, along with running the accompanying iOS and Android apps available from the book's source code repository at http://github.com/jeffxtang/mobiletfbook. That'll help you ensure that you have the development environments all set up for TensorFlow mobile app development and that you know how to integrate TensorFlow into your own iOS and/or Android apps. If you're an iOS developer, you'll also learn how to use Objective-C or Swift with TensorFlow, and when and how to use the TensorFlow pod or the manual TensorFlow iOS library.

Then, if you need to build a custom TensorFlow Android library, go to Chapter 7, Recognizing Drawing with CNN and LSTM, and if you want to learn how to use a Keras model in your mobile app, check out Chapter 8, Predicting Stock Price with RNN, and Chapter 10, Building an AlphaZero-like Mobile Game App.

If you're more interested in TensorFlow Lite or Core ML, read Chapter 11, Using TensorFlow Lite and Core ML on Mobile, and if you're most interested in TensorFlow on Raspberry Pi, or reinforcement learning in TensorFlow, jump to Chapter 12, Developing TensorFlow Apps on Raspberry Pi.

Other than that, you can go through chapters 5 to 10 in order to see how to train different kinds of CNN, RNN, LSTM, GAN, and AlphaZero models and how to use them on mobile, maybe running the iOS and/or Android apps for each chapter before looking into the detailed implementation. Alternatively, you can jump directly to any chapter with the model you're most interested in; just be aware that a later chapter may refer to an earlier chapter for some duplicated details, such as steps of adding a TensorFlow custom iOS library to your iOS app, or fixing some model loading or running errors by building a TensorFlow custom library. However, rest assured that you won't be lost, or at least we've done our best to provide user-friendly and step-by-step tutorials, with occasional references to some steps of previous tutorials, to help you avoid all possible pitfalls you may encounter when building mobile TensorFlow apps, while also avoiding repeating ourselves.

When to read the book

AI, or its hottest branch machine learning, or its hottest subbranch deep learning, has enjoyed rapid progress in recent years. New releases of TensorFlow, backed by Google and with the most popular developer community of all open source machine learning frameworks, has also been launched at a faster speed. When we started writing the book in December 2017, the latest TensorFlow release was 1.4.0, released on November 2, 2017, and after that 1.5.0 was released on January 26, 2018, 1.6.0 on February 28, 2018, 1.7.0 on March 29, 2018, and 1.8.0 on April 27, 2018. All the iOS, Android, and Python code in the book has been tested with all those TensorFlow versions. Still, by the time you read the book, the latest TensorFlow version likely will be later than 1.8.0.

It turns out you don't need to worry too much about new releases of TensorFlow; the code in the book will most likely run seamlessly on the latest TensorFlow releases. During our testing run the apps on TensorFlow 1.4, 1.5, 1.6, 1.7, and 1.8, we've made no code changes at all. It's likely that in a later version, more TensorFlow operations will be supported by default, so you won't need to build a custom TensorFlow library, or you'll be able to build the custom TensorFlow library in a simpler way.

Of course, there's no guarantee that all the code will run without any changes in all future TensorFlow versions, but with all the detailed tutorials and troubleshooting tips covered in the book, no matter when you read the book, now or months later, you should have a smooth time reading the book and running the apps in the book with TensorFlow 1.4-1.8 or later.

As we have to stop with a specific TensorFlow version at certain points to get the book published, we'll continue to test run all the code in the book with every new major TensorFlow release, and update the code and test results accordingly on the book's source code repository at http://github.com/jeffxtang/mobiletfbook. If you have any questions about the code or the book, you may also post an issue directly on the repository.

Another concern is about the choice between TensorFlow Mobile and TensorFlow Lite. The book covers TensorFlow Mobile in most chapters (1 to 10). TensorFlow Lite may be the future of running TensorFlow on mobile, it's still in developer preview as of Google I/O 2018—that's why Google expects you to "use TensorFlow Mobile to cover production cases." Even after TensorFlow Lite is officially released, according to Google, "TensorFlow Mobile isn't going away anytime soon"—in fact, with the latest TensorFlow 1.8.0 version we tested before the book's publication, we found that using TensorFlow Mobile gets even simpler.

If the day that TensorFlow Lite fully replaces TensorFlow Mobile in all use cases, with Lite's better performance and smaller size, does finally come, the skills you'll learn from the book will only better prepare you for that day. In the meantime, before that unforeseeable future arrives, you can read the book and get to know how to use the big brother such as TensorFlow Mobile to run all those amazing and powerful TensorFlow models in your mobile apps.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  1. Click on Code Downloads & Errata.
  2. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on the Packt GitHub account at https://github.com/PacktPublishing/Intelligent-Mobile-Projects-with-TensorFlow. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Install the matplotlib, pillow, lxml, and jupyter libraries. On Ubuntu or Mac, you can run."

A block of code is set as follows:

syntax = "proto2";
package object_detection.protos;
message StringIntLabelMapItem {
optional string name = 1;
optional int32 id = 2;
optional string display_name = 3;
};

message StringIntLabelMap {
repeated StringIntLabelMapItem item = 1;
};

Any command-line input or output is written as follows:

sudo pip install pillow
sudo pip install lxml
sudo pip install jupyter
sudo pip install matplotlib

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Now, let's select the Enhance Image option, you'll see the result"

Warnings or important notes appear like this.
Tips and tricks appear like this.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime