Update pidray-targz.py
Browse files- pidray-targz.py +3 -6
pidray-targz.py
CHANGED
|
@@ -66,18 +66,15 @@ class PIDrayTargz(datasets.GeneratorBasedBuilder):
|
|
| 66 |
|
| 67 |
]
|
| 68 |
|
| 69 |
-
def _generate_examples(self,
|
| 70 |
"""This function returns the examples in the raw (text) form."""
|
| 71 |
idx = 0
|
| 72 |
# iterate through images
|
| 73 |
-
for filepath, image
|
| 74 |
|
| 75 |
text = filepath.split
|
| 76 |
yield idx, {
|
| 77 |
"pixel_values": {"filepath": filepath, "image": image.read()},
|
| 78 |
-
"label": {"filepath": filepath, "label": label.read()},
|
| 79 |
}
|
| 80 |
idx += 1
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
| 66 |
|
| 67 |
]
|
| 68 |
|
| 69 |
+
def _generate_examples(self, images, label):
|
| 70 |
"""This function returns the examples in the raw (text) form."""
|
| 71 |
idx = 0
|
| 72 |
# iterate through images
|
| 73 |
+
for filepath, image in images
|
| 74 |
|
| 75 |
text = filepath.split
|
| 76 |
yield idx, {
|
| 77 |
"pixel_values": {"filepath": filepath, "image": image.read()},
|
| 78 |
+
"label": {"filepath": label[idx]['filepath'], "label": label[idx]['image'].read()},
|
| 79 |
}
|
| 80 |
idx += 1
|
|
|
|
|
|
|
|
|