server.py 文件源码

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

项目:vqa-mcb 作者: akirafukui 项目源码 文件源码
def trim_image(img):
    y,x,c = img.shape
    if c != 3:
        raise Exception('Expected 3 channels in the image')
    resized_img = cv2.resize( img, (TARGET_IMG_SIZE, TARGET_IMG_SIZE))
    transposed_img = np.transpose(resized_img,(2,0,1)).astype(np.float32)
    ivec = transposed_img - resnet_mean
    return ivec
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号