Perform the following steps:
- First, we'll download the pre-trained network in mat format. The mat format is a matlab object, and the scipy package in Python has a method that can read it. The link to download the mat object is here. We save this model in the same folder our Python script is in, for reference:
http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat
- We'll start our Python script by loading the necessary libraries:
import osimport scipy.ioimport scipy.miscimport imageiofrom skimage.transform import resizefrom operator import mulfrom functools import reduceimport numpy as npimport tensorflow as tffrom tensorflow.python.framework import opsops.reset_default_graph()
- Then we can declare ...