Update EMT.py
Browse files
EMT.py
CHANGED
@@ -67,34 +67,35 @@ class EMT(datasets.GeneratorBasedBuilder):
|
|
67 |
)
|
68 |
|
69 |
def _split_generators(self, dl_manager):
|
70 |
-
"""Download
|
71 |
-
|
72 |
-
"train":
|
73 |
-
"test":
|
74 |
}
|
75 |
-
|
76 |
annotation_paths = {
|
77 |
"train": dl_manager.download_and_extract(f"{_ANNOTATION_REPO}/train/"),
|
78 |
"test": dl_manager.download_and_extract(f"{_ANNOTATION_REPO}/test/"),
|
79 |
}
|
80 |
-
|
81 |
return [
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TRAIN,
|
84 |
gen_kwargs={
|
85 |
-
"images": dl_manager.iter_archive(
|
86 |
"annotation_path": annotation_paths["train"],
|
87 |
},
|
88 |
),
|
89 |
datasets.SplitGenerator(
|
90 |
name=datasets.Split.TEST,
|
91 |
gen_kwargs={
|
92 |
-
"images": dl_manager.iter_archive(
|
93 |
"annotation_path": annotation_paths["test"],
|
94 |
},
|
95 |
),
|
96 |
]
|
97 |
|
|
|
98 |
def _generate_examples(self, images, annotation_path):
|
99 |
"""Generate dataset examples by matching images to their corresponding annotations."""
|
100 |
annotations = {}
|
|
|
67 |
)
|
68 |
|
69 |
def _split_generators(self, dl_manager):
|
70 |
+
"""Download train/test images and annotations."""
|
71 |
+
image_urls = {
|
72 |
+
"train": _TRAIN_IMAGE_ARCHIVE_URL,
|
73 |
+
"test": _TEST_IMAGE_ARCHIVE_URL,
|
74 |
}
|
75 |
+
|
76 |
annotation_paths = {
|
77 |
"train": dl_manager.download_and_extract(f"{_ANNOTATION_REPO}/train/"),
|
78 |
"test": dl_manager.download_and_extract(f"{_ANNOTATION_REPO}/test/"),
|
79 |
}
|
80 |
+
|
81 |
return [
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TRAIN,
|
84 |
gen_kwargs={
|
85 |
+
"images": dl_manager.iter_archive(image_urls["train"]),
|
86 |
"annotation_path": annotation_paths["train"],
|
87 |
},
|
88 |
),
|
89 |
datasets.SplitGenerator(
|
90 |
name=datasets.Split.TEST,
|
91 |
gen_kwargs={
|
92 |
+
"images": dl_manager.iter_archive(image_urls["test"]),
|
93 |
"annotation_path": annotation_paths["test"],
|
94 |
},
|
95 |
),
|
96 |
]
|
97 |
|
98 |
+
|
99 |
def _generate_examples(self, images, annotation_path):
|
100 |
"""Generate dataset examples by matching images to their corresponding annotations."""
|
101 |
annotations = {}
|