skytnt commited on
Commit
8c90c8d
1 Parent(s): f73854b

Update anime-segmentation.py

Browse files
Files changed (1) hide show
  1. anime-segmentation.py +2 -2
anime-segmentation.py CHANGED
@@ -65,9 +65,9 @@ class AnimeSegmentation(datasets.GeneratorBasedBuilder):
65
  for image_fname in image_fnames:
66
  yield image_fname, {"image": os.path.join(path, image_fname)}
67
  else:
68
- path = os.path.join(dirs[0], "imgs")
69
  all_fnames = {os.path.relpath(os.path.join(root, fname), start=path)
70
- for root, _dirs, files in os.walk(path) for fname in files}
71
  image_fnames = sorted(fname for fname in all_fnames if os.path.splitext(fname)[1].lower() in _EXTENSION)
72
  for image_fname in image_fnames:
73
  yield image_fname, {"image": os.path.join(path, image_fname),
65
  for image_fname in image_fnames:
66
  yield image_fname, {"image": os.path.join(path, image_fname)}
67
  else:
68
+ path = dirs[0]
69
  all_fnames = {os.path.relpath(os.path.join(root, fname), start=path)
70
+ for root, _dirs, files in os.walk(os.path.join(path, "imgs")) for fname in files}
71
  image_fnames = sorted(fname for fname in all_fnames if os.path.splitext(fname)[1].lower() in _EXTENSION)
72
  for image_fname in image_fnames:
73
  yield image_fname, {"image": os.path.join(path, image_fname),