def main():
sess = tf.Session()
t_input = tf.placeholder(np.float32, name='input') # define the input tensor
image_mean = 117.0
t_preprocessed = tf.expand_dims(t_input-image_mean, 0)
# Build the inference graph
nodes = tmp.vggface16.load('data/vgg_face.mat', t_preprocessed)
img_noise = np.random.uniform(size=(224,224,3)) + 117.0
# Picking some internal layer. Note that we use outputs before applying the ReLU nonlinearity
# to have non-zero gradients for features with negative initial activations.
layer = 'conv5_3'
channel = 140 # picking some feature channel to visualize
img = render_naive(sess, t_input, nodes[layer][:,:,:,channel], img_noise)
showarray(img)
visualize_vggface.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录