TongkunGuan / CCD

[ICCV2023] Self-supervised Character-to-Character Distillation for Text Recognition
https://openaccess.thecvf.com/content/ICCV2023/papers/Guan_Self-Supervised_Character-to-Character_Distillation_for_Text_Recognition_ICCV_2023_paper.pdf
142 stars 7 forks source link

dataset.py代码问题 #15

Closed anzitong closed 2 months ago

anzitong commented 2 months ago

198行代码中的return self._postprocessing(image, text, idx_new) text是什么?并没有被定义或赋值。

TongkunGuan commented 2 months ago

198行代码中的return self._postprocessing(image, text, idx_new) text是什么?并没有被定义或赋值。

where is the code?

anzitong commented 2 months ago

\CCD\Dino\dataset\dataset.py 文件中的第198行。

def __getitem__(self, idx):
    if self.use_portion:
        idx = self.optional_ind[idx]
    datum = self.get(idx)
    if datum is None:
        return
    image, mask, idx_new = datum

    if self.mask:
        if self.is_training:
            image, mask, metric = self._process_training(image, mask)
        else:
            image, mask, metric = self._process_test(image)
        return self._postprocessing(image, mask, metric, idx_new)
    else:
        if self.is_training:
            image = self._process_training(image)
        else:
            image = self._process_test(image)
        return self._postprocessing(image, text, idx_new)
TongkunGuan commented 2 months ago

\CCD\Dino\dataset\dataset.py 文件中的第198行。

def __getitem__(self, idx):
    if self.use_portion:
        idx = self.optional_ind[idx]
    datum = self.get(idx)
    if datum is None:
        return
    image, mask, idx_new = datum

    if self.mask:
        if self.is_training:
            image, mask, metric = self._process_training(image, mask)
        else:
            image, mask, metric = self._process_test(image)
        return self._postprocessing(image, mask, metric, idx_new)
    else:
        if self.is_training:
            image = self._process_training(image)
        else:
            image = self._process_test(image)
        return self._postprocessing(image, text, idx_new)

ok! 在我的程序中我默认设置 self.mask=True 所以else部分没有被使用到

anzitong commented 2 months ago

非常感谢您的回复。