October 2018
Intermediate to advanced
472 pages
10h 57m
English
Next, we will use Inception-v3 (pretrained on ImageNet) to classify each image. We will extract features from the last convolutional layer. We will create a helper function that will transform the input image to the format that is expected by Inception-v3:
#Resizing the image to (299, 299)#Using the preprocess_input method to place the pixels in the range of -1 to 1.def load_image(image_path): img = tf.read_file(image_path) img = tf.image.decode_jpeg(img, channels=3) img = tf.image.resize_images(img, (299, 299)) img = tf.keras.applications.inception_v3.preprocess_input(img) return img, image_path
Now let's initialize the Inception-v3 model and load the pretrained ImageNet weights. To do so, we'll create ...
Read now
Unlock full access