Update imagedemo.py
Browse files- imagedemo.py +9 -9
imagedemo.py
CHANGED
|
@@ -452,14 +452,14 @@ class imagedemo(datasets.GeneratorBasedBuilder):
|
|
| 452 |
|
| 453 |
]
|
| 454 |
|
| 455 |
-
def _generate_examples(self,images):
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
|
|
|
|
|
|
| 462 |
|
| 463 |
-
}
|
| 464 |
-
idx +=1
|
| 465 |
|
|
|
|
| 452 |
|
| 453 |
]
|
| 454 |
|
| 455 |
+
def _generate_examples(self, images):
|
| 456 |
+
"""This function returns the examples in the raw (text) form."""
|
| 457 |
+
idx = 0
|
| 458 |
+
# Iterate through images
|
| 459 |
+
for filepath, image in images:
|
| 460 |
+
yield idx, {
|
| 461 |
+
"image": {"filepath": filepath, "image": image.read()},
|
| 462 |
+
}
|
| 463 |
+
idx += 1
|
| 464 |
|
|
|
|
|
|
|
| 465 |
|