VGG16 (presented by University of Oxford)
implemented with TensorFlow
python3.6
- numpy
- skimage
- TensorFlow
- matplotlib
- Import required modules
import tensorflow as tf
from util.util import *
from model.vgg16 import *
- Load test-image
img = load_image('./test.jpg')
img = img.reshape((1, 224, 224, 3))
In this example, load single-image.
If you attempt to batch-process, load some images and concatenate them.
Then, modify img-shape e.g.,
img = img.reshape((batch_size, 224, 224, 3))
- Start Session
with tf.Session() as sess:
image = tf.placeholder(shape=[batch_size, 224, 224, 3], dtype=tf.float32)
feed_dict = {image: img}
vgg = Vgg16()
vgg.build(image)
sess.run(tf.global_variables_initializer())
prob = sess.run(vgg.net, feed_dict=feed_dict)
print(prob)
$ python cifar.py
Finished cifar-10 learning.
- Learning cifar10
- saving and restoring parameters
If I have overlooked something, please tell me.