SiddiqueAkhonda commited on
Commit
7d738c4
1 Parent(s): aeefba8

Update msynth.py

Browse files
Files changed (1) hide show
  1. msynth.py +10 -10
msynth.py CHANGED
@@ -113,13 +113,13 @@ class msynth(datasets.GeneratorBasedBuilder):
113
 
114
  DEFAULT_WRITER_BATCH_SIZE = 256
115
  BUILDER_CONFIGS = [
116
- msynthConfig("device-data"),
117
- msynthConfig("segmentation-mask"),
118
  msynthConfig("metadata"),
119
  ]
120
 
121
  def _info(self):
122
- if self.config.name == "device-data":
123
  # Define dataset features and keys
124
  features = datasets.Features(
125
  {
@@ -132,7 +132,7 @@ class msynth(datasets.GeneratorBasedBuilder):
132
  }
133
  )
134
  #keys = ("image", "metadata")
135
- elif self.config.name == "segmentation-mask":
136
  # Define features and keys
137
  features = datasets.Features(
138
  {
@@ -179,7 +179,7 @@ class msynth(datasets.GeneratorBasedBuilder):
179
  self.config.size = _SIZE
180
 
181
 
182
- if self.config.name == "device-data":
183
  file_name = []
184
  for ld in self.config.lesion_density:
185
  for ds in self.config.dose:
@@ -218,7 +218,7 @@ class msynth(datasets.GeneratorBasedBuilder):
218
 
219
  return [
220
  datasets.SplitGenerator(
221
- name="device-data",
222
  gen_kwargs={
223
  "files": [data_dir_t for data_dir_t in data_dir],
224
  "name": "all_data",
@@ -226,7 +226,7 @@ class msynth(datasets.GeneratorBasedBuilder):
226
  ),
227
  ]
228
 
229
- elif self.config.name == "segmentation-mask":
230
  seg_file_name = []
231
  for den in self.config.density:
232
  for sz in self.config.size:
@@ -260,7 +260,7 @@ class msynth(datasets.GeneratorBasedBuilder):
260
 
261
  return [
262
  datasets.SplitGenerator(
263
- name="segmentation-mask",
264
  gen_kwargs={
265
  "files": [data_dir_t for data_dir_t in seg_dir],
266
  "name": "seg",
@@ -314,7 +314,7 @@ class msynth(datasets.GeneratorBasedBuilder):
314
 
315
 
316
  def _generate_examples(self, files, name):
317
- if self.config.name == "device-data":
318
  key = 0
319
  data_dir = []
320
  for folder in files:
@@ -350,7 +350,7 @@ class msynth(datasets.GeneratorBasedBuilder):
350
  key += 1
351
 
352
 
353
- if self.config.name == "segmentation-mask":
354
  key = 0
355
  data_dir = []
356
  for folder in files:
 
113
 
114
  DEFAULT_WRITER_BATCH_SIZE = 256
115
  BUILDER_CONFIGS = [
116
+ msynthConfig("device_data"),
117
+ msynthConfig("segmentation_mask"),
118
  msynthConfig("metadata"),
119
  ]
120
 
121
  def _info(self):
122
+ if self.config.name == "device_data":
123
  # Define dataset features and keys
124
  features = datasets.Features(
125
  {
 
132
  }
133
  )
134
  #keys = ("image", "metadata")
135
+ elif self.config.name == "segmentation_mask":
136
  # Define features and keys
137
  features = datasets.Features(
138
  {
 
179
  self.config.size = _SIZE
180
 
181
 
182
+ if self.config.name == "device_data":
183
  file_name = []
184
  for ld in self.config.lesion_density:
185
  for ds in self.config.dose:
 
218
 
219
  return [
220
  datasets.SplitGenerator(
221
+ name="device_data",
222
  gen_kwargs={
223
  "files": [data_dir_t for data_dir_t in data_dir],
224
  "name": "all_data",
 
226
  ),
227
  ]
228
 
229
+ elif self.config.name == "segmentation_mask":
230
  seg_file_name = []
231
  for den in self.config.density:
232
  for sz in self.config.size:
 
260
 
261
  return [
262
  datasets.SplitGenerator(
263
+ name="segmentation_mask",
264
  gen_kwargs={
265
  "files": [data_dir_t for data_dir_t in seg_dir],
266
  "name": "seg",
 
314
 
315
 
316
  def _generate_examples(self, files, name):
317
+ if self.config.name == "device_data":
318
  key = 0
319
  data_dir = []
320
  for folder in files:
 
350
  key += 1
351
 
352
 
353
+ if self.config.name == "segmentation_mask":
354
  key = 0
355
  data_dir = []
356
  for folder in files: