advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
7.9k stars 838 forks source link

about my dataset structure #255

Closed kwanwoo02 closed 1 year ago

kwanwoo02 commented 1 year ago

Hi I have a question. about readme It want a structure like below:

train
val_source # 2000 or more images
visual_test_source # 100 or more images
eval_source # 2000 or more images

However, it is not created through a file called gen_mask_dataset.py by train I think need to create dataset by the structure below

my_dataset
├── train
│   ├── image1_crop000_mask000.png
│   ├── image1_crop000.png
│   ├── ...
│   ├── image200_crop000_mask000.png
│   └── image200_crop000.png
├── val_source 
│   ├── image1_crop000_mask000.png
│   ├── image1_crop000.png
│   ├── ...
│   ├── image200_crop000_mask000.png
│   └── image200_crop000.png
├── visual_test_source 
│   ├── image1_crop000_mask000.png
│   ├── image1_crop000.png
│   ├── ...
│   ├── image200_crop000_mask000.png
│   └── image200_crop000.png
├── eval_source 
│   ├── image1_crop000_mask000.png
│   ├── image1_crop000.png
│   ├── ...
│   ├── image200_crop000_mask000.png
└   └── image200_crop000.png

Please give an example of each dataset structure.

a-lasri commented 1 year ago

Do not place masks in the 'train' directory. Masks are generated automatically during training with random variations. For the 'source' directories, you should only include the images and their corresponding masks. There's no need to crop them, as this is handled by the gen_mask_dataset.py script as indicated in the README.

Also, ensure you check whether the images should be in JPG or PNG format. I've encountered issues in the past with this, so it's crucial to confirm the expected format.

kwanwoo02 commented 1 year ago

@a-lasri thank you for the reply. But I didn't understand it properly. Are you saying there are original images in the train folder? and Are you dividing the train folder into a source folder?

a-lasri commented 1 year ago

To clarify, you need to provide images in the 'train' folder, and both images and masks for 'val_source', 'eval_source', and 'visual_test_source'. There isn't a 'train_source' because the code handles cropping and on-the-fly mask generation during training.