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

Update RDD_2020.py

Browse files
Files changed (1) hide show
  1. RDD_2020.py +3 -3
RDD_2020.py CHANGED
@@ -57,7 +57,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
57
  "height": datasets.Value("int32"),
58
  "depth": datasets.Value("int32"),
59
  }),
60
- # "image": datasets.Value("string"),
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")),
@@ -135,7 +135,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
135
  image_id = f"{image_file.split('.')[0]}"
136
 
137
  image_path = os.path.join(images_dir, image_file)
138
- # img = Image.open(image_path)
139
 
140
  if annotations_dir:
141
  annotation_file = image_id + '.xml'
@@ -165,7 +165,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
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
  }
 
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")),
 
135
  image_id = f"{image_file.split('.')[0]}"
136
 
137
  image_path = os.path.join(images_dir, image_file)
138
+ img = Image.open(image_path)
139
 
140
  if annotations_dir:
141
  annotation_file = image_id + '.xml'
 
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
  }