Euniceyeee
commited on
Commit
•
d644bcc
1
Parent(s):
81a6582
Update kidney-ct-abnormality.py
Browse files- kidney-ct-abnormality.py +2 -6
kidney-ct-abnormality.py
CHANGED
@@ -50,12 +50,8 @@ class KidneyCTAbnormality(datasets.GeneratorBasedBuilder):
|
|
50 |
features=datasets.Features(
|
51 |
{
|
52 |
"images": datasets.Sequence(datasets.Image()),
|
|
|
53 |
"label": datasets.ClassLabel(num_classes=2, names=LABELS),
|
54 |
-
|
55 |
-
# features = Features({'post': Sequence(feature={'text': Value(dtype='string'),
|
56 |
-
# 'upvotes': Value(dtype='int32'),
|
57 |
-
# 'label': ClassLabel(num_classes=2, names=['hot', 'cold'])})})
|
58 |
-
|
59 |
}
|
60 |
),
|
61 |
supervised_keys=("image", "label"),
|
@@ -104,9 +100,9 @@ class KidneyCTAbnormality(datasets.GeneratorBasedBuilder):
|
|
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 |
}
|
|
|
50 |
features=datasets.Features(
|
51 |
{
|
52 |
"images": datasets.Sequence(datasets.Image()),
|
53 |
+
"img_f64_array": datasets.Array3D(dtype = 'float64'),
|
54 |
"label": datasets.ClassLabel(num_classes=2, names=LABELS),
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
),
|
57 |
supervised_keys=("image", "label"),
|
|
|
100 |
img = sitk.ReadImage(img_path)
|
101 |
img_array = sitk.GetArrayFromImage(img)
|
102 |
img_array_c = img_array.astype('uint8')
|
|
|
103 |
# img_array_cr = img_array_c.transpose(2, 0, 1)[..., np.newaxis]
|
104 |
yield i, {
|
105 |
"images": img_array_c,
|
106 |
+
"img_f64_array": img_array,
|
107 |
"label": meta["abnormality"],
|
108 |
}
|