preprocessing.py 文件源码

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

项目:SSD-Keras_Tensorflow 作者: jedol 项目源码 文件源码
def resize_image(image, params={}):
    if params.has_key('height') and params.has_key('width'):
        if np.random.uniform() < params.get('resize_prob', 1.0):
            interpolation_map = {
                'LINEAR': cv2.INTER_LINEAR,
                'AREA': cv2.INTER_AREA,
                'NEAREST': cv2.INTER_NEAREST,
                'CUBIC': cv2.INTER_CUBIC,
                'LANCZOS4': cv2.INTER_LANCZOS4,
            }
            interp = interpolation_map[np.random.choice(params.get('interpolation', ['LINEAR']))]
            image,_ = resize_image_by_warp(image, params['width'], params['height'], interp)

    return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号