corentinm7 commited on
Commit
48fd36a
1 Parent(s): fe68baf

Update MyoQuant-SDH-Data.py

Browse files
Files changed (1) hide show
  1. MyoQuant-SDH-Data.py +3 -3
MyoQuant-SDH-Data.py CHANGED
@@ -120,14 +120,14 @@ class SDH_16k(datasets.GeneratorBasedBuilder):
120
 
121
  def _generate_examples(self, download_path, metadata):
122
  """Generate images and labels for splits."""
123
- for single_metdata in metadata:
124
  img_path = os.path.join(
125
  download_path,
126
  single_metdata["split"],
127
  single_metdata["label"],
128
  single_metdata["file_name"],
129
  )
130
- yield single_metdata["file_name"], {
131
- "image": {"path": img_path, "bytes": open(img_path, "rb").read()},
132
  "label": single_metdata["label"],
133
  }
 
120
 
121
  def _generate_examples(self, download_path, metadata):
122
  """Generate images and labels for splits."""
123
+ for i, single_metdata in enumerate(metadata):
124
  img_path = os.path.join(
125
  download_path,
126
  single_metdata["split"],
127
  single_metdata["label"],
128
  single_metdata["file_name"],
129
  )
130
+ yield i, {
131
+ "image": img_path,
132
  "label": single_metdata["label"],
133
  }