Datasets:
Languages:
English
Size:
1K<n<10K
ArXiv:
Tags:
iiw
imageinwords
image-descriptions
image-captions
detailed-descriptions
hyper-detailed-descriptions
License:
Update imageinwords.py
#9
by
zheedong
- opened
- imageinwords.py +24 -11
imageinwords.py
CHANGED
|
@@ -125,17 +125,30 @@ class ImageInWords(datasets.GeneratorBasedBuilder):
|
|
| 125 |
]
|
| 126 |
|
| 127 |
def _generate_examples(self, filepath):
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
def _generate_examples_iiw_400(self, filepath):
|
| 141 |
with open(filepath) as fp:
|
|
|
|
| 125 |
]
|
| 126 |
|
| 127 |
def _generate_examples(self, filepath):
|
| 128 |
+
try:
|
| 129 |
+
match self.config.name:
|
| 130 |
+
case "IIW-400":
|
| 131 |
+
return self._generate_examples_iiw_400(filepath)
|
| 132 |
+
case "DCI_Test":
|
| 133 |
+
return self._generate_examples_dci_test(filepath)
|
| 134 |
+
case "DOCCI_Test":
|
| 135 |
+
return self._generate_examples_docci_test(filepath)
|
| 136 |
+
case "CM_3600":
|
| 137 |
+
return self._generate_examples_cm_3600(filepath)
|
| 138 |
+
case "LocNar_Eval":
|
| 139 |
+
return self._generate_examples_locnar_eval(filepath)
|
| 140 |
+
except:
|
| 141 |
+
if self.config.name == "IIW-400":
|
| 142 |
+
return self._generate_examples_iiw_400(filepath)
|
| 143 |
+
elif self.config.name == "DCI_Test":
|
| 144 |
+
return self._generate_examples_dci_test(filepath)
|
| 145 |
+
elif self.config.name == "DOCCI_Test":
|
| 146 |
+
return self._generate_examples_docci_test(filepath)
|
| 147 |
+
elif self.config.name == "CM_3600":
|
| 148 |
+
return self._generate_examples_cm_3600(filepath)
|
| 149 |
+
elif self.config.name == "LocNar_Eval":
|
| 150 |
+
return self._generate_examples_locnar_eval(filepath)
|
| 151 |
+
|
| 152 |
|
| 153 |
def _generate_examples_iiw_400(self, filepath):
|
| 154 |
with open(filepath) as fp:
|