Update imagetest.py
Browse files- imagetest.py +16 -2
imagetest.py
CHANGED
|
@@ -41,7 +41,21 @@ class ImageSet(datasets.GeneratorBasedBuilder):
|
|
| 41 |
name="all_routes",
|
| 42 |
gen_kwargs={
|
| 43 |
"images": image_path,
|
| 44 |
-
"infos": info_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
),
|
| 47 |
]
|
|
@@ -54,7 +68,7 @@ class ImageSet(datasets.GeneratorBasedBuilder):
|
|
| 54 |
for image in images:
|
| 55 |
images_dict[image.split("/")[-1].split(".")[0]] = image
|
| 56 |
|
| 57 |
-
with open(
|
| 58 |
for idx, line in enumerate(data):
|
| 59 |
record = json.loads(line)
|
| 60 |
index = record["obs"].split(".")[0]
|
|
|
|
| 41 |
name="all_routes",
|
| 42 |
gen_kwargs={
|
| 43 |
"images": image_path,
|
| 44 |
+
"infos": f"{info_path}/all_routes.jsonl"
|
| 45 |
+
}
|
| 46 |
+
),
|
| 47 |
+
datasets.SplitGenerator(
|
| 48 |
+
name="single_route",
|
| 49 |
+
gen_kwargs={
|
| 50 |
+
"images": image_path,
|
| 51 |
+
"infos": f"{info_path}/single_route.jsonl"
|
| 52 |
+
}
|
| 53 |
+
),
|
| 54 |
+
datasets.SplitGenerator(
|
| 55 |
+
name="shortest_route",
|
| 56 |
+
gen_kwargs={
|
| 57 |
+
"images": image_path,
|
| 58 |
+
"infos": f"{info_path}/shortest_route.jsonl"
|
| 59 |
}
|
| 60 |
),
|
| 61 |
]
|
|
|
|
| 68 |
for image in images:
|
| 69 |
images_dict[image.split("/")[-1].split(".")[0]] = image
|
| 70 |
|
| 71 |
+
with open(infos, encoding="utf-8") as data:
|
| 72 |
for idx, line in enumerate(data):
|
| 73 |
record = json.loads(line)
|
| 74 |
index = record["obs"].split(".")[0]
|