lipnet_dataset.py 文件源码

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

项目:lipnet 作者: grishasergei 项目源码 文件源码
def _read_image(self, image_name):
        """
        Read image from self._path_to_img and perform any necessary preparation
        :param image_name: string, image name, which is added to self._path_to_img
        :return: numpy 2d array
        """
        filename = image_name
        try:
            img = io.imread(filename)
        except IOError:
            return None
        img = img_as_float(img)
        if len(img.shape) > 2:
            img = img[:, :, 0]
        img = resize(img, (self._image_width, self._image_height))
        img = img.reshape((self._image_width, self._image_height, 1))
        return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号