fcn_predict.py 文件源码

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

项目:fully-convolutional-network-semantic-segmentation 作者: alecng94 项目源码 文件源码
def preprocessImg(imgPath, clipSize):
    if clipSize != 0:
        im = enhance(imgPath, clipSize)
    else:
        im = cv2.imread(imgPath)
        im = Image.fromarray(cv2.cvtColor(im, cv2.COLOR_BGR2RGB))

    # switch to BGR, subtract mean
    in_ = np.array(im, dtype = np.float32)
    in_ = in_[:,:,::-1]
    in_ -= np.array((104.00698793,116.66876762,122.67891434))

    # make dims C x H x W for Caffe
    in_ = in_.transpose((2,0,1))

    return in_
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号