Update testdata.py
Browse files- testdata.py +9 -7
testdata.py
CHANGED
@@ -95,23 +95,25 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
95 |
},
|
96 |
),
|
97 |
]
|
98 |
-
|
99 |
def _generate_examples(self, split, data_dir, annot_dir):
|
100 |
image_dir = os.path.join(data_dir, "fisheye")
|
101 |
annotation_dir = os.path.join(annot_dir, "annotations", "fisheye")
|
102 |
files = []
|
|
|
|
|
103 |
|
104 |
-
|
105 |
-
for file_type in IMG_EXT:
|
106 |
-
files.extend(list(Path(image_dir).glob(f'**/*.{file_type}')))
|
107 |
|
108 |
-
|
109 |
-
|
|
|
|
|
110 |
faces = []
|
111 |
plates = []
|
112 |
faces.append([1,2,3,4])
|
113 |
plates.append([1,2,3,4])
|
114 |
-
yield idx, {"image": str(
|
115 |
|
116 |
idx += 1
|
117 |
|
|
|
95 |
},
|
96 |
),
|
97 |
]
|
98 |
+
|
99 |
def _generate_examples(self, split, data_dir, annot_dir):
|
100 |
image_dir = os.path.join(data_dir, "fisheye")
|
101 |
annotation_dir = os.path.join(annot_dir, "annotations", "fisheye")
|
102 |
files = []
|
103 |
+
|
104 |
+
idx = 0
|
105 |
|
106 |
+
for img_file in glob(os.path.join(image_dir, "*.png")):
|
|
|
|
|
107 |
|
108 |
+
d = { image_dir: annot_dir, "png": "txt"}
|
109 |
+
gt_path = img_file
|
110 |
+
for i, j in d.items():
|
111 |
+
gt_path = gt_path.replace(i, j)
|
112 |
faces = []
|
113 |
plates = []
|
114 |
faces.append([1,2,3,4])
|
115 |
plates.append([1,2,3,4])
|
116 |
+
yield idx, {"image": str(img_file), "faces": faces, "plates": plates}
|
117 |
|
118 |
idx += 1
|
119 |
|