How to structure image files for datasets.load_dataset("imagefolder") when you have input and output images like in instruct pix2pix?

I want to train diffusion model in the same way as it was done in instruct_pix2pix. I have already created triplets of input_image, text_instruction, and output_image, however, I don’t understand how to link an input image to output one in metadata.jsonl. What should be directory layout or the fields metadata file? Currently I have all my input image and output images stored in the directory - generated_data/triplet_dataset/train.

An example of stored images in train directory:

Hi. It’s not supported yet. See Multi-image loading in Imagefolder dataset · Issue #5760 · huggingface/datasets · GitHub, feel free to upvote and comment there.

Meanwhile, maybe you’re better done using the WebDatasets format: Create an image dataset

1 Like

Thanks for suggestion! Could you then steer me in the right direction for publishing the dataset to hub? I want to create exactly the same structure dataset as in here. Any leads are appreciated :pray:

cc @lhoestq @sayakpaul