Update testdata.py
Browse files- testdata.py +9 -10
testdata.py
CHANGED
|
@@ -73,14 +73,10 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 73 |
features=datasets.Features(
|
| 74 |
{
|
| 75 |
"image": datasets.Image(),
|
| 76 |
-
"
|
| 77 |
{
|
| 78 |
-
"
|
| 79 |
-
|
| 80 |
-
),
|
| 81 |
-
"plates": datasets.Sequence(
|
| 82 |
-
{
|
| 83 |
-
"bbox": datasets.Sequence(datasets.Value("float32"), length=4)
|
| 84 |
}
|
| 85 |
),
|
| 86 |
}
|
|
@@ -122,8 +118,7 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 122 |
image_dir = os.path.join(data_dir, "fisheye")
|
| 123 |
annotation_dir = os.path.join(annot_dir, "annotations", "fisheye")
|
| 124 |
files = []
|
| 125 |
-
|
| 126 |
-
plates = []
|
| 127 |
for file_type in IMG_EXT:
|
| 128 |
files.extend(list(Path(image_dir).glob(f'**/*.{file_type}')))
|
| 129 |
|
|
@@ -153,5 +148,9 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 153 |
# else:
|
| 154 |
# plates({"bbox": [x1, y1, x2, y2]})
|
| 155 |
|
| 156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
idx += 1
|
|
|
|
| 73 |
features=datasets.Features(
|
| 74 |
{
|
| 75 |
"image": datasets.Image(),
|
| 76 |
+
"objects": datasets.Sequence(
|
| 77 |
{
|
| 78 |
+
"faces": datasets.Sequence(datasets.Value("float32"), length=4),
|
| 79 |
+
"plates": datasets.Sequence(datasets.Value("float32"), length=4)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
),
|
| 82 |
}
|
|
|
|
| 118 |
image_dir = os.path.join(data_dir, "fisheye")
|
| 119 |
annotation_dir = os.path.join(annot_dir, "annotations", "fisheye")
|
| 120 |
files = []
|
| 121 |
+
objects = []
|
|
|
|
| 122 |
for file_type in IMG_EXT:
|
| 123 |
files.extend(list(Path(image_dir).glob(f'**/*.{file_type}')))
|
| 124 |
|
|
|
|
| 148 |
# else:
|
| 149 |
# plates({"bbox": [x1, y1, x2, y2]})
|
| 150 |
|
| 151 |
+
objects.append({
|
| 152 |
+
'faces': [1, 2, 3, 4],
|
| 153 |
+
'plates': [1, 2, 3, 4]
|
| 154 |
+
})
|
| 155 |
+
yield idx, {"image": image_path, "objects": objects}
|
| 156 |
idx += 1
|