小白请教。我在tensorflow跑fcn的时候,发现原代码
tensorflow吧
全部回复
仅看楼主
level 2
小白请教。我在tensorflow跑fcn的时候,发现原代码中并没有mode为test的代码,请问测试单张图片的代码怎么写啊?
2020年04月21日 04点04分 1
level 1
else:
test_image = misc.imread('./testImage/1.jpg')
resize_image = misc.imresize(test_image, [224, 224], interp='nearest')
a = np.expand_dims(resize_image, axis=0)
a = np.array(a)
pred = sess.run(pred_annotation, feed_dict={image: a, keep_probability: 1.0})
pred = np.squeeze(pred, axis=3)
utils.save_image(pred[0].astype(np.uint8), FLAGS.logs_dir, name="pred_" + str(5))
print("Saved image: succeed")
在最后加上else
2021年03月02日 10点03分 2
1