Update testdata.py
Browse files- testdata.py +12 -9
testdata.py
CHANGED
|
@@ -104,11 +104,18 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 104 |
annotation_dir = os.path.join(annot_dir, "annotations", "fisheye")
|
| 105 |
files = []
|
| 106 |
objects = []
|
| 107 |
-
for file_type in IMG_EXT:
|
| 108 |
-
files.extend(list(Path(image_dir).glob(f'**/*.{file_type}')))
|
| 109 |
-
|
| 110 |
idx = 0
|
| 111 |
-
for
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
# img_relative_path = image_path.relative_to(image_dir)
|
| 113 |
#gt_pah = (Path(annotation_dir) / img_relative_path).with_suffix('.txt')
|
| 114 |
|
|
@@ -133,8 +140,4 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 133 |
# else:
|
| 134 |
# plates({"bbox": [x1, y1, x2, y2]})
|
| 135 |
|
| 136 |
-
|
| 137 |
-
'faces': [1.0, 2.0, 3.0, 4.0]
|
| 138 |
-
})
|
| 139 |
-
yield idx, {"image": str(image_path), "objects": objects}
|
| 140 |
-
idx += 1
|
|
|
|
| 104 |
annotation_dir = os.path.join(annot_dir, "annotations", "fisheye")
|
| 105 |
files = []
|
| 106 |
objects = []
|
|
|
|
|
|
|
|
|
|
| 107 |
idx = 0
|
| 108 |
+
for file in glob.glob(os.path.join(image_dir, "*.png")):
|
| 109 |
+
objects.append({
|
| 110 |
+
'faces': [1.0, 2.0, 3.0, 4.0]
|
| 111 |
+
})
|
| 112 |
+
yield idx, {"image": str(file), "objects": objects}
|
| 113 |
+
idx += 1
|
| 114 |
+
# for file_type in IMG_EXT:
|
| 115 |
+
# files.extend(list(Path(image_dir).glob(f'**/*.{file_type}')))
|
| 116 |
+
|
| 117 |
+
# idx = 0
|
| 118 |
+
# for image_path in tqdm(files):
|
| 119 |
# img_relative_path = image_path.relative_to(image_dir)
|
| 120 |
#gt_pah = (Path(annotation_dir) / img_relative_path).with_suffix('.txt')
|
| 121 |
|
|
|
|
| 140 |
# else:
|
| 141 |
# plates({"bbox": [x1, y1, x2, y2]})
|
| 142 |
|
| 143 |
+
|
|
|
|
|
|
|
|
|
|
|
|