Update testdata.py
Browse files- testdata.py +10 -7
testdata.py
CHANGED
@@ -73,8 +73,9 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
73 |
features=datasets.Features(
|
74 |
{
|
75 |
"image": datasets.Image(),
|
76 |
-
"
|
77 |
-
"
|
|
|
78 |
}
|
79 |
),
|
80 |
supervised_keys=None,
|
@@ -103,11 +104,13 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
103 |
|
104 |
idx = 0
|
105 |
for i_file in glob(os.path.join(image_dir, "*.png")):
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
111 |
|
112 |
idx += 1
|
113 |
|
|
|
73 |
features=datasets.Features(
|
74 |
{
|
75 |
"image": datasets.Image(),
|
76 |
+
"path": datasets.Value("string"),
|
77 |
+
"gt_path": datasets.Value("string"),
|
78 |
+
|
79 |
}
|
80 |
),
|
81 |
supervised_keys=None,
|
|
|
104 |
|
105 |
idx = 0
|
106 |
for i_file in glob(os.path.join(image_dir, "*.png")):
|
107 |
+
|
108 |
+
d = { image_dir: annotation_dir, "png": "txt"}
|
109 |
+
gt_path = i_file
|
110 |
+
for i, j in d.items():
|
111 |
+
gt_path = gt_path.replace(i, j)
|
112 |
+
|
113 |
+
yield idx, {"image": i_file, "path": i_file, "gt_path": gt_path}
|
114 |
|
115 |
idx += 1
|
116 |
|