MER_NN.py 文件源码

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

项目:EquationRecognition 作者: xyjiang94 项目源码 文件源码
def input_wrapper(f):
    image = misc.imread(f)
    sx,sy = image.shape
    diff = np.abs(sx-sy)

    sx,sy = image.shape
    image = np.pad(image,((sx//8,sx//8),(sy//8,sy//8)),'constant')
    if sx > sy:
        image = np.pad(image,((0,0),(diff//2,diff//2)),'constant')
    else:
        image = np.pad(image,((diff//2,diff//2),(0,0)),'constant')

    image = dilation(image,disk(max(sx,sy)/32))
    image = misc.imresize(image,(32,32))
    if np.max(image) > 1:
        image = image/255.
    return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号