def __init__(self, in_dir, transform):
    super(ISSTestDataset, self).__init__()
    self.in_dir = in_dir
    self.transform = transform
    self._images = []
    for img_path in chain(*(glob.iglob(path.join(self.in_dir, '**', ext), recursive=True) for ext in ISSTestDataset._EXTENSIONS)):
        (_, name_with_ext) = path.split(img_path)
        (idx, _) = path.splitext(name_with_ext)
        with Image.open(img_path) as img_raw:
            size = (img_raw.size[1], img_raw.size[0])
        self._images.append({'idx': idx, 'path': img_path, 'size': size})
def __init__(self, in_dir, transform):
    super(ISSTestDataset, self).__init__()
    self.in_dir = in_dir
    self.transform = transform
    self._images = []
    for img_path in chain(*(glob.iglob(path.join(self.in_dir, '**', ext), recursive=True) for ext in ISSTestDataset._EXTENSIONS)):
        (_, name_with_ext) = path.split(img_path)
        (idx, _) = path.splitext(name_with_ext)
        with Image.open(img_path) as img_raw:
            size = (img_raw.size[1], img_raw.size[0])
        self._images.append({'idx': idx, 'path': img_path, 'size': size})