Skip to content

Commit

Permalink
Merge pull request #2 from Dutra-Apex/fix_num_samples_error
Browse files Browse the repository at this point in the history
Update dataset.py
  • Loading branch information
Dutra-Apex committed Mar 23, 2023
2 parents 2e8fa01 + 5d87c01 commit 82e9b43
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def __init__(self, args):
self.mask_type = args.mask_type

# image and mask
self.image_path = []
for ext in ['*.jpg', '*.png']:
self.image_path.extend(glob(os.path.join(args.dir_image, args.data_train, ext)))
self.mask_path = glob(os.path.join(args.dir_mask, args.mask_type, '*.png'))
self.image_path, self.mask_path = [], []
for ext in ['*.jpg', '*.png', '*.jpeg']:
self.image_path.extend(glob(f'{args.dir_image}*{ext}))
self.mask_path.extend(glob(f'{args.dir_image}*{ext}))

# augmentation
self.img_trans = transforms.Compose([
Expand Down Expand Up @@ -77,4 +77,4 @@ def __getitem__(self, index):
data = InpaintingData(args)
print(len(data), len(data.mask_path))
img, mask, filename = data[0]
print(img.size(), mask.size(), filename)
print(img.size(), mask.size(), filename)

0 comments on commit 82e9b43

Please sign in to comment.