alkzar90 commited on
Commit
7f0f8b7
1 Parent(s): 1d1d19b

Reuse a line

Browse files
Files changed (1) hide show
  1. NIH-Chest-X-ray-dataset.py +3 -2
NIH-Chest-X-ray-dataset.py CHANGED
@@ -149,11 +149,12 @@ class XChest(datasets.GeneratorBasedBuilder):
149
  file_name = os.path.basename(path)
150
  # Get image id to filter the respective row of the csv
151
  image_id = file_name.split('/')[-1]
 
152
  if file_name.endswith(".png"):
153
  yield i, {
154
  "image_file_path": path,
155
  "image": path,
156
- "labels": label_csv[label_csv['Image Index'] == image_id]['Finding Labels'].values[0].split('|')[0],
157
- "multi-labels": label_csv[label_csv['Image Index'] == image_id]['Finding Labels'].values[0].split('|'),
158
  }
159
 
 
149
  file_name = os.path.basename(path)
150
  # Get image id to filter the respective row of the csv
151
  image_id = file_name.split('/')[-1]
152
+ image_labels = label_csv[label_csv['Image Index'] == image_id]['Finding Labels'].values[0].split('|')
153
  if file_name.endswith(".png"):
154
  yield i, {
155
  "image_file_path": path,
156
  "image": path,
157
+ "labels": image_labels[0],
158
+ "multi-labels": image_labels,
159
  }
160