bingykang / Fewshot_Detection

Few-shot Object Detection via Feature Reweighting
https://arxiv.org/abs/1812.01866
528 stars 111 forks source link

Strange Code in Dataset.py #77

Open ojipadeson opened 2 years ago

ojipadeson commented 2 years ago

Here is code in class MetaDataset in dataset.py:

    def get_metain(self, clsid, metaind):
        meta_img, meta_lab = self.get_metaimg(clsid, metaind)
        if meta_lab:
            for lab in meta_lab:
                # print(lab)
                img, mask = self.get_img_mask(meta_img, lab, merge=False)    # <<<<<<------------
                if mask is None:
                    continue
                return (img, mask)

The line with <- symbol is strange. In each loop, the mask will be covered by a new return value, so that mask will only contain 1 bounding box no matter how many boxes there is in images. So should it be modified?

Thanks.