Commit
•
a597d45
1
Parent(s):
f60b1a1
Update flickr_1k_test_image_text_retrieval.py
Browse files
flickr_1k_test_image_text_retrieval.py
CHANGED
@@ -28,8 +28,13 @@ class Dataset(datasets.GeneratorBasedBuilder):
|
|
28 |
def _info(self):
|
29 |
return datasets.DatasetInfo(
|
30 |
features=datasets.Features(
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
),
|
35 |
task_templates=[],
|
@@ -58,4 +63,6 @@ class Dataset(datasets.GeneratorBasedBuilder):
|
|
58 |
df = pd.read_csv(examples_csv)
|
59 |
for r_idx, r in df.iterrows():
|
60 |
r_dict = r.to_dict()
|
|
|
|
|
61 |
yield r_idx, r_dict
|
|
|
28 |
def _info(self):
|
29 |
return datasets.DatasetInfo(
|
30 |
features=datasets.Features(
|
31 |
+
{
|
32 |
+
"sentids": [datasets.Value("string")],
|
33 |
+
"imgid": datasets.Value("string"),
|
34 |
+
"sentences": [datasets.Value("string")],
|
35 |
+
"split": datasets.Value("string"),
|
36 |
+
"filename": datasets.Value("string"),
|
37 |
+
'image': datasets.Image(),
|
38 |
}
|
39 |
),
|
40 |
task_templates=[],
|
|
|
63 |
df = pd.read_csv(examples_csv)
|
64 |
for r_idx, r in df.iterrows():
|
65 |
r_dict = r.to_dict()
|
66 |
+
image_path = os.path.join(images_dir, "images_flickr_1k_test", r_dict['filename'])
|
67 |
+
r_dict['image'] = image_path
|
68 |
yield r_idx, r_dict
|