(self)
| 69 | return image, gt |
| 70 | |
| 71 | def filter_files(self): |
| 72 | assert len(self.images) == len(self.gts) |
| 73 | images = [] |
| 74 | gts = [] |
| 75 | for img_path, gt_path in zip(self.images, self.gts): |
| 76 | img = Image.open(img_path) |
| 77 | gt = Image.open(gt_path) |
| 78 | if img.size == gt.size: |
| 79 | images.append(img_path) |
| 80 | gts.append(gt_path) |
| 81 | self.images = images |
| 82 | self.gts = gts |
| 83 | |
| 84 | def rgb_loader(self, path): |
| 85 | with open(path, 'rb') as f: |