jmc255 commited on
Commit
27b68d2
1 Parent(s): c5edc51
Files changed (1) hide show
  1. aphantasia_drawing_dataset.py +2 -4
aphantasia_drawing_dataset.py CHANGED
@@ -102,7 +102,6 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
102
  return datasets.DatasetInfo(
103
  description=_DESCRIPTION,
104
  features=datasets.Features({
105
- #"subject": {
106
  "subject_id": datasets.Value("int32"),
107
  "treatment": datasets.Value("string"),#datasets.ClassLabel(names=["aphantasia", "control"]),
108
  "demographics": {
@@ -138,7 +137,6 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
138
  "livingroom": datasets.Image(decode=True, id=None),
139
  "bedroom": datasets.Image(decode=True, id=None)
140
  }
141
- #}
142
  }),
143
  # No default supervised_keys (as we have to pass both question
144
  # and context as input).
@@ -182,7 +180,7 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
182
  for room in subjects_data[sub]["image"].keys():
183
  img_byt = base64.b64decode(subjects_data[sub]["image"][room])
184
  img = Image.open(io.BytesIO(img_byt))
185
- subjects_data[sub]["image"][room] = img
186
  idx += 1
187
 
188
  yield idx-1, {
@@ -205,7 +203,7 @@ class AphantasiaDrawingDataset(datasets.GeneratorBasedBuilder):
205
  "drawings": {
206
  "kitchen": {
207
  "perception": subjects_data[sub]["drawings"]["kitchen"]["perception"],
208
- "memory": subjects_data[sub]["drawings"]["kitchen"]["perception"]
209
  },
210
  "livingroom": {
211
  "perception": subjects_data[sub]["drawings"]["livingroom"]["perception"],
 
102
  return datasets.DatasetInfo(
103
  description=_DESCRIPTION,
104
  features=datasets.Features({
 
105
  "subject_id": datasets.Value("int32"),
106
  "treatment": datasets.Value("string"),#datasets.ClassLabel(names=["aphantasia", "control"]),
107
  "demographics": {
 
137
  "livingroom": datasets.Image(decode=True, id=None),
138
  "bedroom": datasets.Image(decode=True, id=None)
139
  }
 
140
  }),
141
  # No default supervised_keys (as we have to pass both question
142
  # and context as input).
 
180
  for room in subjects_data[sub]["image"].keys():
181
  img_byt = base64.b64decode(subjects_data[sub]["image"][room])
182
  img = Image.open(io.BytesIO(img_byt))
183
+ subjects_data[sub]["image"][room] = img.resize((500,500))
184
  idx += 1
185
 
186
  yield idx-1, {
 
203
  "drawings": {
204
  "kitchen": {
205
  "perception": subjects_data[sub]["drawings"]["kitchen"]["perception"],
206
+ "memory": subjects_data[sub]["drawings"]["kitchen"]["memory"]
207
  },
208
  "livingroom": {
209
  "perception": subjects_data[sub]["drawings"]["livingroom"]["perception"],