BIT-DA / SePiCo

[TPAMI 2023 ESI Highly Cited Paper] SePiCo: Semantic-Guided Pixel Contrast for Domain Adaptive Semantic Segmentation https://arxiv.org/abs/2204.08808
https://arxiv.org/abs/2204.08808
Other
112 stars 7 forks source link

UDADataset的__getitem__问题 #15

Closed wzr0108 closed 1 year ago

wzr0108 commented 1 year ago
    def __getitem__(self, idx):
        if self.rcs_enabled:
            return self.get_rare_class_sample()
        else:
            s1 = self.source[idx // len(self.target)]
            s2 = self.target[idx % len(self.target)]
            return {
                **s1, 'target_img_metas': s2['img_metas'],
                'target_img': s2['img']
            }

为什么源域和目标域的索引,一个是//一个是%?

BinhuiXie commented 1 year ago

Hi @wzr0108, THX for your interest!

The following two lines may be helpful.

https://github.com/BIT-DA/SePiCo/blob/b010072316edb840ad22ac9e70391c21fbfcbd54/mmseg/datasets/uda_dataset.py#L117-L118