Using the GAN models in Android

It turns out we don't need to use the custom TensorFlow Android library, as we did in Chapter 7, Recognizing Drawing with CNN and LSTM, to run the GAN models in Android. Simply create a new Android Studio app called GAN with all the defaults, add compile 'org.tensorflow:tensorflow-android:+' to the app's build.gradle file, create a new assets folder and copy the two GAN model files and a test blurry image there.

Your project in Android Studio should now look like Figure 9.5:

Figure 9.5: Android Studio GAN app overview, showing constant definitions

Notice that for simplicity, we set BATCH_SIZE to 1. You can easily ...

Get Intelligent Mobile Projects with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.