Datasets:
pain
/

Languages:
Arabic
ArXiv:
License:
pain commited on
Commit
8bb50c8
1 Parent(s): 3310b7c

Update AASL.py

Browse files
Files changed (1) hide show
  1. AASL.py +8 -6
AASL.py CHANGED
@@ -69,9 +69,11 @@ class AASL(datasets.GeneratorBasedBuilder):
69
  print(x)
70
  print(images)
71
 
72
- for file_path, file_obj in images:
73
- if file_path.startswith("images/"):
74
- yield file_path, {
75
- "image": {"path": file_path, "bytes": file_obj.read()},
76
- "label": 'x',
77
- }
 
 
 
69
  print(x)
70
  print(images)
71
 
72
+ for i, file in enumerate(file):
73
+ if os.path.basename(file).endswith(".jpg"):
74
+ with open(file, "rb") as f:
75
+ yield str(i), {
76
+ "image": file,
77
+ "labels": os.path.basename(os.path.dirname(file)).lower(),
78
+ }
79
+