def scale_image()

in 3-photos/1-chromakey/app.py [0:0]


def scale_image(image):
    _image = image
    target_height = 800

    height, width, channels = _image.shape
    logger.info('Original size: {}h x {}w'.format(height, width))
    scale = height/target_height
    if scale > 1:
        _image = cv2.resize(image, (int(width/scale), int(height/scale)))
        height, width, channels = image.shape
        logger.info('New size: {}h x {}w'.format(int(height/scale), int(width/scale)))
    return _image