mit_sceneparsing_benchmark_loader.py 文件源码

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

项目:pytorch-semseg 作者: meetshah1995 项目源码 文件源码
def __getitem__(self, index):
        """__getitem__

        :param index:
        """
        img_path = self.files[self.split][index].rstrip()
        lbl_path = os.path.join(self.annotations_base, os.path.basename(img_path)[:-4] + '.png')

        img = m.imread(img_path)
        img = np.array(img, dtype=np.uint8)

        lbl = m.imread(lbl_path)
        lbl = np.array(lbl, dtype=np.uint8)

        if self.is_transform:
            img, lbl = self.transform(img, lbl)

        return img, lbl
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号