Update EMT.py
Browse files
EMT.py
CHANGED
@@ -272,11 +272,22 @@ class EMT(datasets.GeneratorBasedBuilder):
|
|
272 |
|
273 |
annotations = {}
|
274 |
|
275 |
-
#
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
# Extract annotation files and read their contents
|
282 |
for ann_file in os.listdir(ann_dir):
|
|
|
272 |
|
273 |
annotations = {}
|
274 |
|
275 |
+
# Determine whether we're processing train or test split
|
276 |
+
if "train" in annotation_path:
|
277 |
+
annotation_split = "train"
|
278 |
+
elif "test" in annotation_path:
|
279 |
+
annotation_split = "test"
|
280 |
+
else:
|
281 |
+
raise ValueError(f"Unknown annotation path: {annotation_path}")
|
282 |
+
|
283 |
+
ann_dir = os.path.join(annotation_path, annotation_split)
|
284 |
+
|
285 |
+
print(f"Extracted annotations path: {annotation_path}")
|
286 |
+
print(f"Looking for annotations in: {ann_dir}")
|
287 |
+
|
288 |
+
# Check if annotation directory exists
|
289 |
+
if not os.path.exists(ann_dir):
|
290 |
+
raise FileNotFoundError(f"Annotation directory does not exist: {ann_dir}")
|
291 |
|
292 |
# Extract annotation files and read their contents
|
293 |
for ann_file in os.listdir(ann_dir):
|