preprocess_data.py 文件源码

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

项目:tensorflow1 作者: wasif26 项目源码 文件源码
def process(image):
    # apply gaussian filter to image to make text wider
    image = gaussian_filter(image, sigma=BLUR_AMOUNT)
    # invert black and white because most of the image is white
    image = 255 - image
    # resize image to make it smaller
    image = scipy.misc.imresize(arr=image, size=(FINAL_SIZE, FINAL_SIZE))
    # scale down the value of each pixel
    image = image / 255.0
    # flatten the image array to a list
    return [item for sublist in image for item in sublist]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号