My commit
Browse files
aphantasia_drawing_dataset.py
CHANGED
@@ -164,8 +164,8 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
|
|
164 |
subjects_data = json.load(subjects_file)
|
165 |
idx = 0
|
166 |
for sub in subjects_data:
|
167 |
-
|
168 |
-
|
169 |
for room in subjects_data[sub]["drawings"].keys():
|
170 |
if subjects_data[sub]["drawings"][room]["perception"] != "":
|
171 |
img_byt = base64.b64decode(subjects_data[sub]["drawings"][room]["perception"])
|
@@ -188,7 +188,21 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
|
|
188 |
idx += 1
|
189 |
|
190 |
yield idx-1, {
|
191 |
-
"subject_id":
|
192 |
-
"treatment":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
|
|
|
164 |
subjects_data = json.load(subjects_file)
|
165 |
idx = 0
|
166 |
for sub in subjects_data:
|
167 |
+
sub_id = subjects_data[sub]["subject_id"]
|
168 |
+
trt = subjects_data[sub]["treatment"]
|
169 |
for room in subjects_data[sub]["drawings"].keys():
|
170 |
if subjects_data[sub]["drawings"][room]["perception"] != "":
|
171 |
img_byt = base64.b64decode(subjects_data[sub]["drawings"][room]["perception"])
|
|
|
188 |
idx += 1
|
189 |
|
190 |
yield idx-1, {
|
191 |
+
"subject_id": sub_id,
|
192 |
+
"treatment": trt,
|
193 |
+
"demographics": {
|
194 |
+
"country": subjects_data[sub]["country"],
|
195 |
+
"age": subjects_data[sub]["age"],
|
196 |
+
"gender": subjects_data[sub]["gender"],
|
197 |
+
"occupation": subjects_data[sub]["occupation"],
|
198 |
+
"art_ability": subjects_data[sub]["art_ability"],
|
199 |
+
"art_experience": subjects_data[sub]["art_experience"],
|
200 |
+
"device": subjects_data[sub]["device"],
|
201 |
+
"input": subjects_data[sub]["input"],
|
202 |
+
"difficult": subjects_data[sub]["difficult"],
|
203 |
+
"diff_explaination": subjects_data[sub]["diff_explaination"],
|
204 |
+
"vviq_score": subjects_data[sub]["vviq_score"],
|
205 |
+
"osiq_score": subjects_data[sub]["osiq_score"]
|
206 |
+
}
|
207 |
}
|
208 |
|