b0199525a691c3382eefc3487e82dbdbde78d39b,examples/pretrained_cnn/tutorial_models_vgg.py,,,#,13
Before Change
vgg = tl.models.vgg16(pretrained=True)
img1 = tl.vis.read_image("data/tiger.jpeg")
img1 = tl.prepro.imresize(img1, (224, 224))
img1 = img1.astype(np.float32)
mean = np.array([123.68, 116.779, 103.939], dtype=np.float32).reshape([1, 1, 1, 3])
img1 = img1 - mean
start_time = time.time()
vgg.eval()
output = vgg(img1)
probs = tf.nn.softmax(output)[0].numpy()
print(" End time : %.5ss" % (time.time() - start_time))
preds = (np.argsort(probs)[::-1])[0:5]
for p in preds:
print(class_names[p], probs[p])
After Change
// or get the whole model (VGG19)
// vgg = tl.models.vgg19(pretrained=True)
img = tl.vis.read_image("data/tiger.jpeg")
img = tl.prepro.imresize(img, (224, 224)).astype(np.float32) / 255
start_time = time.time()
output = vgg(img, is_train=False)
probs = tf.nn.softmax(output)[0].numpy()
print(" End time : %.5ss" % (time.time() - start_time))
preds = (np.argsort(probs)[::-1])[0:5]
for p in preds:
print(class_names[p], probs[p])
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: tensorlayer/tensorlayer
Commit Name: b0199525a691c3382eefc3487e82dbdbde78d39b
Time: 2019-04-30
Author: 37874862+warshallrho@users.noreply.github.com
File Name: examples/pretrained_cnn/tutorial_models_vgg.py
Class Name:
Method Name:
Project Name: tensorlayer/tensorlayer
Commit Name: b0199525a691c3382eefc3487e82dbdbde78d39b
Time: 2019-04-30
Author: 37874862+warshallrho@users.noreply.github.com
File Name: examples/pretrained_cnn/tutorial_models_vgg.py
Class Name:
Method Name:
Project Name: tensorlayer/tensorlayer
Commit Name: b0199525a691c3382eefc3487e82dbdbde78d39b
Time: 2019-04-30
Author: 37874862+warshallrho@users.noreply.github.com
File Name: examples/pretrained_cnn/tutorial_models_vgg19.py
Class Name:
Method Name:
Project Name: tensorlayer/tensorlayer
Commit Name: b0199525a691c3382eefc3487e82dbdbde78d39b
Time: 2019-04-30
Author: 37874862+warshallrho@users.noreply.github.com
File Name: examples/pretrained_cnn/tutorial_models_vgg16.py
Class Name:
Method Name: