Update RDD_2020.py
Browse files- RDD_2020.py +5 -5
RDD_2020.py
CHANGED
@@ -56,7 +56,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
|
|
56 |
"height": datasets.Value("int32"),
|
57 |
"depth": datasets.Value("int32"),
|
58 |
}),
|
59 |
-
|
60 |
"image_path": datasets.Value("string"),
|
61 |
#"pics_array": datasets.Array3D(shape=(None, None, 3), dtype="uint8"),
|
62 |
"crack_type": datasets.Sequence(datasets.Value("string")),
|
@@ -126,8 +126,8 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
|
|
126 |
images_dir = f"{filepath}/{country_dir}/images"
|
127 |
|
128 |
# print(os.listdir(filepath))
|
129 |
-
|
130 |
-
|
131 |
|
132 |
annotations_dir = f"{filepath}/{country_dir}/annotations/xmls" if split == "train" else None
|
133 |
|
@@ -139,7 +139,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
|
|
139 |
image_id = f"{image_file.split('.')[0]}"
|
140 |
|
141 |
image_path = os.path.join(images_dir, image_file)
|
142 |
-
|
143 |
|
144 |
if annotations_dir:
|
145 |
annotation_file = image_id + '.xml'
|
@@ -169,7 +169,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
|
|
169 |
"country": country_dir,
|
170 |
"type": split,
|
171 |
"image_path": image_path,
|
172 |
-
|
173 |
"crack_type": crack_type,
|
174 |
"crack_coordinates": crack_coordinates,
|
175 |
}
|
|
|
56 |
"height": datasets.Value("int32"),
|
57 |
"depth": datasets.Value("int32"),
|
58 |
}),
|
59 |
+
# "image": datasets.Value("string"),
|
60 |
"image_path": datasets.Value("string"),
|
61 |
#"pics_array": datasets.Array3D(shape=(None, None, 3), dtype="uint8"),
|
62 |
"crack_type": datasets.Sequence(datasets.Value("string")),
|
|
|
126 |
images_dir = f"{filepath}/{country_dir}/images"
|
127 |
|
128 |
# print(os.listdir(filepath))
|
129 |
+
# print(os.listdir(filepath))
|
130 |
+
# print(os.listdir(f"{filepath}/{country_dir}"))
|
131 |
|
132 |
annotations_dir = f"{filepath}/{country_dir}/annotations/xmls" if split == "train" else None
|
133 |
|
|
|
139 |
image_id = f"{image_file.split('.')[0]}"
|
140 |
|
141 |
image_path = os.path.join(images_dir, image_file)
|
142 |
+
# img = Image.open(image_path)
|
143 |
|
144 |
if annotations_dir:
|
145 |
annotation_file = image_id + '.xml'
|
|
|
169 |
"country": country_dir,
|
170 |
"type": split,
|
171 |
"image_path": image_path,
|
172 |
+
# "image": img,
|
173 |
"crack_type": crack_type,
|
174 |
"crack_coordinates": crack_coordinates,
|
175 |
}
|