ShixuanAn commited on
Commit
78f8d75
1 Parent(s): 5d4ee12

Update RDD_2020.py

Browse files
Files changed (1) hide show
  1. RDD_2020.py +2 -1
RDD_2020.py CHANGED
@@ -120,6 +120,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
120
  image_id = f"{image_file.split('.')[0]}"
121
 
122
  image_path = os.path.join(images_dir, image_file)
 
123
  img = Image.open(image_path)
124
 
125
  if annotations_dir:
@@ -150,7 +151,7 @@ class RDD2020_Dataset(datasets.GeneratorBasedBuilder):
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
  }
 
120
  image_id = f"{image_file.split('.')[0]}"
121
 
122
  image_path = os.path.join(images_dir, image_file)
123
+ relative_image_path = os.path.relpath(image_path, start=filepath)
124
  img = Image.open(image_path)
125
 
126
  if annotations_dir:
 
151
  "country": country_dir,
152
  "type": split,
153
  "image": img,
154
+ "image_path": relative_image_path,
155
  "crack_type": crack_type,
156
  "crack_coordinates": crack_coordinates,
157
  }