My commit
Browse files
aphantasia_drawing_dataset.py
CHANGED
@@ -163,8 +163,8 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
|
|
163 |
with open(filepath, "r") as subjects_file:
|
164 |
subjects_data = json.load(subjects_file)
|
165 |
idx = 0
|
|
|
166 |
for sub in subjects_data:
|
167 |
-
s = subjects_data[sub]
|
168 |
for room in subjects_data[sub]["drawings"].keys():
|
169 |
if subjects_data[sub]["drawings"][room]["perception"] != "":
|
170 |
img_byt = base64.b64decode(subjects_data[sub]["drawings"][room]["perception"])
|
@@ -181,7 +181,7 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
|
|
181 |
subjects_data[sub]["drawings"][room]["memory"] = None
|
182 |
|
183 |
for room in subjects_data[sub]["image"].keys():
|
184 |
-
img_byt = base64.b64decode(
|
185 |
img = Image.open(io.BytesIO(img_byt))
|
186 |
subjects_data[sub]["image"][room] = img
|
187 |
idx += 1
|
|
|
163 |
with open(filepath, "r") as subjects_file:
|
164 |
subjects_data = json.load(subjects_file)
|
165 |
idx = 0
|
166 |
+
print(subjects_data)
|
167 |
for sub in subjects_data:
|
|
|
168 |
for room in subjects_data[sub]["drawings"].keys():
|
169 |
if subjects_data[sub]["drawings"][room]["perception"] != "":
|
170 |
img_byt = base64.b64decode(subjects_data[sub]["drawings"][room]["perception"])
|
|
|
181 |
subjects_data[sub]["drawings"][room]["memory"] = None
|
182 |
|
183 |
for room in subjects_data[sub]["image"].keys():
|
184 |
+
img_byt = base64.b64decode(subjects_data[sub]["image"][room])
|
185 |
img = Image.open(io.BytesIO(img_byt))
|
186 |
subjects_data[sub]["image"][room] = img
|
187 |
idx += 1
|