Commit
·
7cf61d8
1
Parent(s):
ac8d193
Update flickr_1k_test_image_text_retrieval.py
Browse files
flickr_1k_test_image_text_retrieval.py
CHANGED
@@ -34,15 +34,15 @@ class Dataset(datasets.GeneratorBasedBuilder):
|
|
34 |
return datasets.DatasetInfo(
|
35 |
features=datasets.Features(
|
36 |
{
|
|
|
|
|
37 |
"sentids": [datasets.Value("string")],
|
38 |
"imgid": datasets.Value("string"),
|
39 |
"split": datasets.Value("string"),
|
40 |
"filename": datasets.Value("string"),
|
41 |
-
'image': datasets.Image(),
|
42 |
'sentids': [datasets.Value('int64')],
|
43 |
'imgid': [datasets.Value('int64')],
|
44 |
'tokens': [[datasets.Value('string')]],
|
45 |
-
'raw': [datasets.Value('string')],
|
46 |
'sentid': [datasets.Value('int64')],
|
47 |
}
|
48 |
),
|
@@ -77,4 +77,5 @@ class Dataset(datasets.GeneratorBasedBuilder):
|
|
77 |
r_dict = r.to_dict()
|
78 |
image_path = os.path.join(images_dir, _INPUT_IMAGES, r_dict['filename'])
|
79 |
r_dict['image'] = image_path
|
|
|
80 |
yield r_idx, r_dict
|
|
|
34 |
return datasets.DatasetInfo(
|
35 |
features=datasets.Features(
|
36 |
{
|
37 |
+
"image": datasets.Image(),
|
38 |
+
"caption": [datasets.Value('string')],
|
39 |
"sentids": [datasets.Value("string")],
|
40 |
"imgid": datasets.Value("string"),
|
41 |
"split": datasets.Value("string"),
|
42 |
"filename": datasets.Value("string"),
|
|
|
43 |
'sentids': [datasets.Value('int64')],
|
44 |
'imgid': [datasets.Value('int64')],
|
45 |
'tokens': [[datasets.Value('string')]],
|
|
|
46 |
'sentid': [datasets.Value('int64')],
|
47 |
}
|
48 |
),
|
|
|
77 |
r_dict = r.to_dict()
|
78 |
image_path = os.path.join(images_dir, _INPUT_IMAGES, r_dict['filename'])
|
79 |
r_dict['image'] = image_path
|
80 |
+
r_dict['caption'] = r_dict.pop('raw')
|
81 |
yield r_idx, r_dict
|