Update testdata.py
Browse files- testdata.py +6 -6
testdata.py
CHANGED
|
@@ -62,12 +62,12 @@ _SUBREDDITS = ["zurich"]
|
|
| 62 |
class TestDataConfig(datasets.BuilderConfig):
|
| 63 |
"""BuilderConfig for TestData."""
|
| 64 |
|
| 65 |
-
def __init__(self,
|
| 66 |
"""BuilderConfig for TestData.
|
| 67 |
Args:
|
| 68 |
**kwargs: keyword arguments forwarded to super.
|
| 69 |
"""
|
| 70 |
-
super(TestDataConfig, self).__init__(version=datasets.Version("1.0.0", ""),
|
| 71 |
|
| 72 |
class TestData(datasets.GeneratorBasedBuilder):
|
| 73 |
"""WIDER FACE dataset."""
|
|
@@ -105,17 +105,17 @@ class TestData(datasets.GeneratorBasedBuilder):
|
|
| 105 |
datasets.SplitGenerator(
|
| 106 |
name=datasets.Split.TEST,
|
| 107 |
gen_kwargs={
|
| 108 |
-
"
|
| 109 |
"data_dir": data_dir["test"],
|
| 110 |
"annot_dir": data_dir["annot"],
|
| 111 |
},
|
| 112 |
),
|
| 113 |
]
|
| 114 |
|
| 115 |
-
def _generate_examples(self,
|
| 116 |
|
| 117 |
-
image_dir = os.path.join(data_dir,
|
| 118 |
-
annotation_dir = os.path.join(annot_dir,
|
| 119 |
files = []
|
| 120 |
|
| 121 |
idx = 0
|
|
|
|
| 62 |
class TestDataConfig(datasets.BuilderConfig):
|
| 63 |
"""BuilderConfig for TestData."""
|
| 64 |
|
| 65 |
+
def __init__(self, name, **kwargs):
|
| 66 |
"""BuilderConfig for TestData.
|
| 67 |
Args:
|
| 68 |
**kwargs: keyword arguments forwarded to super.
|
| 69 |
"""
|
| 70 |
+
super(TestDataConfig, self).__init__(version=datasets.Version("1.0.0", ""), name=name, **kwargs)
|
| 71 |
|
| 72 |
class TestData(datasets.GeneratorBasedBuilder):
|
| 73 |
"""WIDER FACE dataset."""
|
|
|
|
| 105 |
datasets.SplitGenerator(
|
| 106 |
name=datasets.Split.TEST,
|
| 107 |
gen_kwargs={
|
| 108 |
+
"name": self.config.name,
|
| 109 |
"data_dir": data_dir["test"],
|
| 110 |
"annot_dir": data_dir["annot"],
|
| 111 |
},
|
| 112 |
),
|
| 113 |
]
|
| 114 |
|
| 115 |
+
def _generate_examples(self, name, data_dir, annot_dir):
|
| 116 |
|
| 117 |
+
image_dir = os.path.join(data_dir, name)
|
| 118 |
+
annotation_dir = os.path.join(annot_dir, name)
|
| 119 |
files = []
|
| 120 |
|
| 121 |
idx = 0
|