Skip to content

Latest commit

 

History

History
executable file
·
132 lines (118 loc) · 3.99 KB

prepare_data.md

File metadata and controls

executable file
·
132 lines (118 loc) · 3.99 KB

Uncontrolable Image Inpainting

FFHQ

Create a symlink data/ffhq pointing to the images1024x1024 folder obtained from the FFHQ repository.

ImageNet

Download ILSVRC2012_img_train.tar and ILSVRC2012_img_val.tar through Academic Torrents if you do not have imagenet dataset. Then put or symlink the ImageNet data into $data/imagenet/{split} where {split} is one of train/validation. It should have the following structure:

$data/imagenet/{split}/
├── n01440764
│   ├── n01440764_10026.JPEG
│   ├── n01440764_10027.JPEG
│   ├── ...
├── n01443537
│   ├── n01443537_10007.JPEG
│   ├── n01443537_10014.JPEG
│   ├── ...
├── ...

Places2_natural

Download train_split and validation_split, and orgnize the data as follows:

$data/naturalscene/
├── b
│   ├── butte
│   |     |── 00000001.jpg
│   |     |── ...
├── c
│   ├── canyon
│   |     |── 00000001.jpg
│   |     |── ...
├── ...
├── val
│   |── Places365_val00000007.jpg
│   |── ...

irregular mask

We use the mask provided by PConv. Only the testing mask is needed, which can be download from here. Then orgnize the data as follows:

$data/irregular-mask/
├── testing_mask_dataset
│   |── 00000.png
│   |── ...

Controllable Image Inpainting (Optional)

To train the controllable image inpainting model, we need to get the semantic map and sketch map for each dataset.

  • Sketch map: We use DexiNed to generate the sketch map from RGB images. Please refer to its repository for more details. We only train one model on ImageNet, and use the same model for FFHQ and Places2_natural.

  • Semantic map: We use Mask2Former to generate the semantic map from RGB images. Please refer to its repository for more details. The models we used are all trained on COCO.

The semantic map should be orgnized as follows:

$data/segmentation/ffhq/
├── 00000
│   ├── 00000.png
│   ├── 00001.png
│   ├── ...
├── ...

# imagenet
$data/segmentation/imagenet/{split}/
├── n01440764
│   ├── n01440764_10026.png
│   ├── n01440764_10027.png
│   ├── ...
├── n01443537
│   ├── n01443537_10007.png
│   ├── n01443537_10014.png
│   ├── ...
├── ...

# naturalscene
$data/segmentation/naturalscene/
├── b
│   ├── butte
│   |     |── 00000001.png
│   |     |── ...
├── c
│   ├── canyon
│   |     |── 00000001.png
│   |     |── ...
├── ...
├── val
│   |── Places365_val00000007.png
│   |── ...

The sketch map should be orgnized as follows:

$data/sketch/ffhq/
├── 00000
│   ├── 00000.png
│   ├── 00001.png
│   ├── ...
├── ...

# imagenet
$data/sketch/imagenet/{split}/
├── n01440764
│   ├── n01440764_10026.png
│   ├── n01440764_10027.png
│   ├── ...
├── n01443537
│   ├── n01443537_10007.png
│   ├── n01443537_10014.png
│   ├── ...
├── ...

# naturalscene
$data/sketch/naturalscene/
├── b
│   ├── butte
│   |     |── 00000001.png
│   |     |── ...
├── c
│   ├── canyon
│   |     |── 00000001.png
│   |     |── ...
├── ...
├── val
│   |── Places365_val00000007.png
│   |── ...