KuAvLab commited on
Commit
86f68fe
·
verified ·
1 Parent(s): e7de586

Update EMT.py

Browse files
Files changed (1) hide show
  1. EMT.py +16 -5
EMT.py CHANGED
@@ -272,11 +272,22 @@ class EMT(datasets.GeneratorBasedBuilder):
272
 
273
  annotations = {}
274
 
275
- # Ensure we access the correct annotation subdirectory
276
- annotation_split = "train" if "train" in annotation_path else "test"
277
- ann_dir = os.path.join(annotation_path, "annotations", annotation_split)
278
-
279
- print("Looking for annotations in:", ann_dir)
 
 
 
 
 
 
 
 
 
 
 
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):