Commit
·
52c877e
1
Parent(s):
437986b
fix bug
Browse files- IIIT-5K.py +4 -2
IIIT-5K.py
CHANGED
@@ -74,6 +74,7 @@ class IIIT5K(datasets.GeneratorBasedBuilder):
|
|
74 |
datasets.SplitGenerator(
|
75 |
name=datasets.Split.TRAIN,
|
76 |
gen_kwargs={
|
|
|
77 |
"archive_path": Path(archive_path) / "IIIT5K",
|
78 |
"info_path": Path(archive_path) / "IIIT5K/traindata.mat",
|
79 |
},
|
@@ -81,15 +82,16 @@ class IIIT5K(datasets.GeneratorBasedBuilder):
|
|
81 |
datasets.SplitGenerator(
|
82 |
name=datasets.Split.TEST,
|
83 |
gen_kwargs={
|
|
|
84 |
"archive_path": Path(archive_path) / "IIIT5K",
|
85 |
"info_path": Path(archive_path) / "IIIT5K/testdata.mat",
|
86 |
},
|
87 |
),
|
88 |
]
|
89 |
|
90 |
-
def _generate_examples(self, archive_path, info_path):
|
91 |
info = scipy.io.loadmat(info_path)
|
92 |
-
info = info["
|
93 |
|
94 |
for idx, info_ex in enumerate(info):
|
95 |
path_image = os.path.join(archive_path, str(info_ex[0][0]))
|
|
|
74 |
datasets.SplitGenerator(
|
75 |
name=datasets.Split.TRAIN,
|
76 |
gen_kwargs={
|
77 |
+
"split": "train",
|
78 |
"archive_path": Path(archive_path) / "IIIT5K",
|
79 |
"info_path": Path(archive_path) / "IIIT5K/traindata.mat",
|
80 |
},
|
|
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TEST,
|
84 |
gen_kwargs={
|
85 |
+
"split": "test",
|
86 |
"archive_path": Path(archive_path) / "IIIT5K",
|
87 |
"info_path": Path(archive_path) / "IIIT5K/testdata.mat",
|
88 |
},
|
89 |
),
|
90 |
]
|
91 |
|
92 |
+
def _generate_examples(self, split, archive_path, info_path):
|
93 |
info = scipy.io.loadmat(info_path)
|
94 |
+
info = info[split+"data.mat"][0]
|
95 |
|
96 |
for idx, info_ex in enumerate(info):
|
97 |
path_image = os.path.join(archive_path, str(info_ex[0][0]))
|