Euniceyeee
commited on
Commit
•
81a6582
1
Parent(s):
70891f4
Update kidney-ct-abnormality.py
Browse files- kidney-ct-abnormality.py +3 -3
kidney-ct-abnormality.py
CHANGED
@@ -94,7 +94,6 @@ class KidneyCTAbnormality(datasets.GeneratorBasedBuilder):
|
|
94 |
|
95 |
def _generate_examples(self, filepath, metadata):
|
96 |
"""Generate images and labels for splits."""
|
97 |
-
print(filepath)
|
98 |
for i, meta in enumerate(metadata):
|
99 |
img_path = os.path.join(
|
100 |
filepath,
|
@@ -105,8 +104,9 @@ class KidneyCTAbnormality(datasets.GeneratorBasedBuilder):
|
|
105 |
img = sitk.ReadImage(img_path)
|
106 |
img_array = sitk.GetArrayFromImage(img)
|
107 |
img_array_c = img_array.astype('uint8')
|
108 |
-
|
|
|
109 |
yield i, {
|
110 |
-
"images":
|
111 |
"label": meta["abnormality"],
|
112 |
}
|
|
|
94 |
|
95 |
def _generate_examples(self, filepath, metadata):
|
96 |
"""Generate images and labels for splits."""
|
|
|
97 |
for i, meta in enumerate(metadata):
|
98 |
img_path = os.path.join(
|
99 |
filepath,
|
|
|
104 |
img = sitk.ReadImage(img_path)
|
105 |
img_array = sitk.GetArrayFromImage(img)
|
106 |
img_array_c = img_array.astype('uint8')
|
107 |
+
print(img_array_c.shape)
|
108 |
+
# img_array_cr = img_array_c.transpose(2, 0, 1)[..., np.newaxis]
|
109 |
yield i, {
|
110 |
+
"images": img_array_c,
|
111 |
"label": meta["abnormality"],
|
112 |
}
|