List of Images in a parquet dataset

Is there a way to save a hf dataset in parquet where one column contains a list of PIL.Image?
Each row in the table (sample) may have N images where: 0<=N<20
Thanks!

1 Like

Hi ! Yes using datasets, for example

from datasets import Dataset, Image, Sequence

ds = Dataset.form_dict({"images": [["path/to/image1", "path/to/image2"], ["path/to/image3"]]})
ds = ds.cast_column("images", Sequence(Image()))
ds.push_to_hub(...)

It would be cool to support lists of images in pandas-image-methods too though (open to contribution :stuck_out_tongue: )

2 Likes