feat: add test support
Browse files
tfcol.py
CHANGED
|
@@ -102,7 +102,7 @@ class TFCol(datasets.GeneratorBasedBuilder):
|
|
| 102 |
datasets.SplitGenerator(
|
| 103 |
name=datasets.Split.TEST,
|
| 104 |
gen_kwargs={
|
| 105 |
-
"annotations":
|
| 106 |
"images": data_dir["test"]["images"],
|
| 107 |
"split": "test"
|
| 108 |
}
|
|
@@ -115,15 +115,11 @@ class TFCol(datasets.GeneratorBasedBuilder):
|
|
| 115 |
with open(annotations, encoding="utf-8") as f:
|
| 116 |
for id_, row in enumerate(f):
|
| 117 |
data = json.loads(row)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
-
if split != "test":
|
| 120 |
-
yield id_, {
|
| 121 |
-
"lat": data["lat"],
|
| 122 |
-
"lon": data["lon"],
|
| 123 |
-
"labels": data["labels"],
|
| 124 |
-
"image": os.path.join(images, split, data["fname"]),
|
| 125 |
-
}
|
| 126 |
-
else:
|
| 127 |
-
yield id_, {
|
| 128 |
-
"image": os.path.join(images, split, data["fname"])
|
| 129 |
-
}
|
|
|
|
| 102 |
datasets.SplitGenerator(
|
| 103 |
name=datasets.Split.TEST,
|
| 104 |
gen_kwargs={
|
| 105 |
+
"annotations": data_dir["test"]["annotations"],
|
| 106 |
"images": data_dir["test"]["images"],
|
| 107 |
"split": "test"
|
| 108 |
}
|
|
|
|
| 115 |
with open(annotations, encoding="utf-8") as f:
|
| 116 |
for id_, row in enumerate(f):
|
| 117 |
data = json.loads(row)
|
| 118 |
+
|
| 119 |
+
yield id_, {
|
| 120 |
+
"lat": data["lat"],
|
| 121 |
+
"lon": data["lon"],
|
| 122 |
+
"labels": data["labels"],
|
| 123 |
+
"image": os.path.join(images, split, data["fname"]),
|
| 124 |
+
}
|
| 125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|