13ed139f539684bf39919963241bf37ab2967d77,examples/pretrained_cnn/tutorial_models_mobilenetv1.py,,,#,18
Before Change
tf.logging.set_verbosity(tf.logging.DEBUG)
tl.logging.set_verbosity(tl.logging.DEBUG)
x = tf.placeholder(tf.float32, [None, 224, 224, 3])
// get the whole model
mobilenetv1 = tl.models.MobileNetV1(x)
// restore pre-trained parameters
sess = tf.InteractiveSession()
mobilenetv1.restore_params(sess)
probs = tf.nn.softmax(mobilenetv1.outputs)
mobilenetv1.print_params(False)
mobilenetv1.print_layers()
img1 = tl.vis.read_image("data/tiger.jpeg")
img1 = tl.prepro.imresize(img1, (224, 224)) / 255
_ = sess.run(probs, feed_dict={x: [img1]})[0] // 1st time takes time to compile
start_time = time.time()
prob = sess.run(probs, feed_dict={x: [img1]})[0]
print(" End time : %.5ss" % (time.time() - start_time))
preds = (np.argsort(prob)[::-1])[0:5]
for p in preds:
print(class_names[p], prob[p])
After Change
img1 = tl.vis.read_image("data/tiger.jpeg")
img1 = tl.prepro.imresize(img1, (224, 224)) / 255
img1 = img1.astype(np.float32)[np.newaxis, ...]
start_time = time.time()
output = mobilenetv1(img1, is_train=False)
prob = tf.nn.softmax(output)[0].numpy()
print(" End time : %.5ss" % (time.time() - start_time))
preds = (np.argsort(prob)[::-1])[0:5]
for p in preds:
print(class_names[p], prob[p])
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: tensorlayer/tensorlayer
Commit Name: 13ed139f539684bf39919963241bf37ab2967d77
Time: 2019-04-23
Author: rundi_wu@pku.edu.cn
File Name: examples/pretrained_cnn/tutorial_models_mobilenetv1.py
Class Name:
Method Name:
Project Name: arraiy/torchgeometry
Commit Name: 6a85646b6d99b92ba436b227ee04c7344bb1f72a
Time: 2019-11-13
Author: priba@cvc.uab.cat
File Name: test/color/test_hsv.py
Class Name: TestHsvToRgb
Method Name: test_batch_hsv_to_rgb
Project Name: tensorlayer/tensorlayer
Commit Name: 301f593e6d80712315ec965996cdccb9a20b54c0
Time: 2019-04-24
Author: rundi_wu@pku.edu.cn
File Name: examples/pretrained_cnn/tutorial_models_squeezenetv1.py
Class Name:
Method Name:
Project Name: arraiy/torchgeometry
Commit Name: 060dfe2da846c7168f98dd9f46f47308e4317a9d
Time: 2019-11-13
Author: priba@cvc.uab.cat
File Name: test/color/test_hls.py
Class Name: TestHlsToRgb
Method Name: test_batch_hls_to_rgb