We will next code funcs.py by completing the following steps:
- Import packages: First, we import the required packages:
import numpy as npimport sysimport tensorflow as tf
- Complete the ImageProcess() class: Then, convert the 210 x 160 x 3 RGB image from the Atari emulator to an 84 x 84 grayscale image. For this, we create an ImageProcess() class and use TensorFlow utility functions, such as rgb_to_grayscale() to convert RGB to grayscale, crop_to_bounding_box() to crop the image to the region of interest, resize_images() to resize the image to the desired 84 x 84 size, and squeeze() to remove a dimension from the input. The process() function of the class will carry out the operations by invoking the sess.run() function ...