def test():
test_filename = sys.argv[2]
test_image = scipy.misc.imread(test_filename, flatten=True)
test_image = scipy.misc.imresize(test_image, [background_height, background_width])
test_image = skimage.img_as_float(test_image).astype(np.float32)
model.load("find_kanji.tflearn")
Y = model.predict(test_image.reshape([-1, background_height, background_width]))[0]
print(Y)
masked = np.square(Y)
masked = scipy.misc.imresize(masked, [background_height, background_width])
masked = test_image * masked
scipy.misc.imsave("y.png", masked)
#Y_indices = np.argsort(Y)[::-1]
评论列表
文章目录