pierreguillou commited on
Commit
b614fd9
1 Parent(s): ec15867

Update DocLayNet-base.py

Browse files
Files changed (1) hide show
  1. DocLayNet-base.py +4 -4
DocLayNet-base.py CHANGED
@@ -167,7 +167,7 @@ class DocLayNet(datasets.GeneratorBasedBuilder):
167
  # These kwargs will be passed to _generate_examples
168
  gen_kwargs={
169
  "filepath": os.path.join(downloaded_file, "base_dataset/train/"),
170
- # "split_key": "train",
171
  },
172
  ),
173
  datasets.SplitGenerator(
@@ -175,7 +175,7 @@ class DocLayNet(datasets.GeneratorBasedBuilder):
175
  # These kwargs will be passed to _generate_examples
176
  gen_kwargs={
177
  "filepath": os.path.join(downloaded_file, "base_dataset/val/"),
178
- # "split_key": "validation",
179
  },
180
  ),
181
  datasets.SplitGenerator(
@@ -183,13 +183,13 @@ class DocLayNet(datasets.GeneratorBasedBuilder):
183
  # These kwargs will be passed to _generate_examples
184
  gen_kwargs={
185
  "filepath": os.path.join(downloaded_file, "base_dataset/test/"),
186
- # "split_key": "test"
187
  },
188
  ),
189
  ]
190
 
191
 
192
- def _generate_examples(self, filepath):
193
  logger.info("⏳ Generating examples from = %s", filepath)
194
  ann_dir = os.path.join(filepath, "annotations")
195
  img_dir = os.path.join(filepath, "images")
 
167
  # These kwargs will be passed to _generate_examples
168
  gen_kwargs={
169
  "filepath": os.path.join(downloaded_file, "base_dataset/train/"),
170
+ "split": "train",
171
  },
172
  ),
173
  datasets.SplitGenerator(
 
175
  # These kwargs will be passed to _generate_examples
176
  gen_kwargs={
177
  "filepath": os.path.join(downloaded_file, "base_dataset/val/"),
178
+ "split": "validation",
179
  },
180
  ),
181
  datasets.SplitGenerator(
 
183
  # These kwargs will be passed to _generate_examples
184
  gen_kwargs={
185
  "filepath": os.path.join(downloaded_file, "base_dataset/test/"),
186
+ "split": "test"
187
  },
188
  ),
189
  ]
190
 
191
 
192
+ def _generate_examples(self, filepath, split):
193
  logger.info("⏳ Generating examples from = %s", filepath)
194
  ann_dir = os.path.join(filepath, "annotations")
195
  img_dir = os.path.join(filepath, "images")