data_process.py 文件源码

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

项目:Comicolorization 作者: DwangoMediaVillage 项目源码 文件源码
def __call__(self, image, test):
        # type: (Image.Image, any) -> any
        image = numpy.asarray(image, dtype=self._dtype)[:, :, :3] / 255  # rgb
        image = rgb2lab(image).astype(self._dtype).transpose(2, 0, 1)

        if self._normalize:
            image /= 50
            image[0] -= 1

        return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号