Datasets:
Tasks:
Image Classification
Sub-tasks:
multi-class-image-classification
Languages:
English
Size:
100K<n<1M
ArXiv:
License:
Reuse a line
Browse files
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":
|
157 |
-
"multi-labels":
|
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 |
|