image_handler.py 文件源码

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

项目:AVSR-Deep-Speech 作者: pandeydivesh15 项目源码 文件源码
def visualize_image(image, name="Image", resize=False, save_image=False, path=None):
    """Helper function to visualize and save any image"""
    image = image.reshape([IMAGE_WIDTH, IMAGE_HEIGHT])
    image = image.astype(np.uint8)

    if resize: 
        image = cv2.resize(image, (IMAGE_WIDTH * 10, IMAGE_HEIGHT * 10))

    cv2.imshow(name, image)
    if cv2.waitKey(0) & 0xFF == ord('q'):
        cv2.destroyAllWindows()

    if save_image:
        assert path is not None
        cv2.imwrite(path, image)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号