Update Image-demo.py
Browse files- Image-demo.py +2 -2
Image-demo.py
CHANGED
@@ -57,10 +57,10 @@ class ImageSet(datasets.GeneratorBasedBuilder):
|
|
57 |
def _generate_examples(self, images, filepath):
|
58 |
""" This function returns the examples in the raw (text) form."""
|
59 |
_CAPTION = json.load(open(filepath, 'r'))
|
60 |
-
for idx, (
|
61 |
# description = filepath.split('/')[-1][:-4]
|
62 |
# description = description.replace('_', ' ')
|
63 |
yield idx, {
|
64 |
-
"image": {"path":
|
65 |
"text": _CAPTION[idx],
|
66 |
}
|
|
|
57 |
def _generate_examples(self, images, filepath):
|
58 |
""" This function returns the examples in the raw (text) form."""
|
59 |
_CAPTION = json.load(open(filepath, 'r'))
|
60 |
+
for idx, (imgpath, image) in enumerate(images):
|
61 |
# description = filepath.split('/')[-1][:-4]
|
62 |
# description = description.replace('_', ' ')
|
63 |
yield idx, {
|
64 |
+
"image": {"path": imgpath, "bytes": image.read()},
|
65 |
"text": _CAPTION[idx],
|
66 |
}
|