fix: image representation as np.ndarray
Browse files
generated-usa-passeports-dataset.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import datasets
|
2 |
import PIL.Image
|
3 |
import PIL.ImageOps
|
|
|
4 |
|
5 |
_CITATION = """\
|
6 |
@InProceedings{huggingface:dataset,
|
@@ -95,7 +96,7 @@ def load_image_file(file, mode='RGB'):
|
|
95 |
|
96 |
img = img.convert(mode)
|
97 |
|
98 |
-
return img
|
99 |
|
100 |
|
101 |
class GeneratedUsaPasseportsDataset(datasets.GeneratorBasedBuilder):
|
|
|
1 |
import datasets
|
2 |
import PIL.Image
|
3 |
import PIL.ImageOps
|
4 |
+
import numpy as np
|
5 |
|
6 |
_CITATION = """\
|
7 |
@InProceedings{huggingface:dataset,
|
|
|
96 |
|
97 |
img = img.convert(mode)
|
98 |
|
99 |
+
return np.array(img)
|
100 |
|
101 |
|
102 |
class GeneratedUsaPasseportsDataset(datasets.GeneratorBasedBuilder):
|