Update testdata.py
Browse files- testdata.py +5 -6
testdata.py
CHANGED
@@ -104,12 +104,11 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
104 |
|
105 |
idx = 0
|
106 |
for i_file in glob(os.path.join(image_dir, "*.png")):
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
yield idx, {"image": i_file, "path": i_file, "gt_path": gt_path}
|
114 |
|
115 |
idx += 1
|
|
|
104 |
|
105 |
idx = 0
|
106 |
for i_file in glob(os.path.join(image_dir, "*.png")):
|
107 |
+
img_relative_file = os.path.relpath(i_file, image_dir)
|
108 |
+
gt_relative_path = img_relative_file.replace(".png", ".txt")
|
109 |
+
|
110 |
+
gt_path = os.path.join(annotation_dir, gt_relative_path)
|
111 |
+
|
|
|
112 |
yield idx, {"image": i_file, "path": i_file, "gt_path": gt_path}
|
113 |
|
114 |
idx += 1
|