find_kanji.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:MachineLearning 作者: timomernick 项目源码 文件源码
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]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号