ShixuanAn commited on
Commit
a9e225e
1 Parent(s): 43c281b

Update RDD_2020.py

Browse files
Files changed (1) hide show
  1. RDD_2020.py +1 -16
RDD_2020.py CHANGED
@@ -52,14 +52,8 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
52
  "image_id": datasets.Value("string"),
53
  "country": datasets.Value("string"),
54
  "type": datasets.Value("string"),
55
- "image_resolution": datasets.Features({
56
- "width": datasets.Value("int32"),
57
- "height": datasets.Value("int32"),
58
- "depth": datasets.Value("int32"),
59
- }),
60
  "image": datasets.Image(),
61
  "image_path": datasets.Value("string"),
62
- #"pics_array": datasets.Array3D(shape=(None, None, 3), dtype="uint8"),
63
  "crack_type": datasets.Sequence(datasets.Value("string")),
64
  "crack_coordinates": datasets.Sequence(datasets.Features({
65
  "x_min": datasets.Value("int32"),
@@ -84,11 +78,6 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
84
  name: dl_manager.download_and_extract(url)
85
  for name, url in urls_to_download.items()
86
  }
87
- # print( downloaded_files['train'])
88
-
89
-
90
- # files_and_directories = os.listdir(directory_path)
91
- # print(files_and_directories)
92
 
93
  return [
94
  datasets.SplitGenerator(
@@ -121,10 +110,6 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
121
  for country_dir in ['Czech', 'India', 'Japan']:
122
  images_dir = f"{filepath}/{country_dir}/images"
123
 
124
- # print(os.listdir(filepath))
125
- # print(os.listdir(filepath))
126
- # print(os.listdir(f"{filepath}/{country_dir}"))
127
-
128
  annotations_dir = f"{filepath}/{country_dir}/annotations/xmls" if split == "train" else None
129
 
130
  # Iterate over each image in the country's image directory
@@ -164,8 +149,8 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
164
  "image_id": image_id,
165
  "country": country_dir,
166
  "type": split,
167
- "image_path": image_path,
168
  "image": img,
 
169
  "crack_type": crack_type,
170
  "crack_coordinates": crack_coordinates,
171
  }
 
52
  "image_id": datasets.Value("string"),
53
  "country": datasets.Value("string"),
54
  "type": datasets.Value("string"),
 
 
 
 
 
55
  "image": datasets.Image(),
56
  "image_path": datasets.Value("string"),
 
57
  "crack_type": datasets.Sequence(datasets.Value("string")),
58
  "crack_coordinates": datasets.Sequence(datasets.Features({
59
  "x_min": datasets.Value("int32"),
 
78
  name: dl_manager.download_and_extract(url)
79
  for name, url in urls_to_download.items()
80
  }
 
 
 
 
 
81
 
82
  return [
83
  datasets.SplitGenerator(
 
110
  for country_dir in ['Czech', 'India', 'Japan']:
111
  images_dir = f"{filepath}/{country_dir}/images"
112
 
 
 
 
 
113
  annotations_dir = f"{filepath}/{country_dir}/annotations/xmls" if split == "train" else None
114
 
115
  # Iterate over each image in the country's image directory
 
149
  "image_id": image_id,
150
  "country": country_dir,
151
  "type": split,
 
152
  "image": img,
153
+ "image_path": image_path,
154
  "crack_type": crack_type,
155
  "crack_coordinates": crack_coordinates,
156
  }