NVIDIA / pix2pixHD

Synthesizing and manipulating 2048x1024 images with conditional GANs
https://tcwang0509.github.io/pix2pixHD/
Other
6.64k stars 1.39k forks source link

how to prepare gray scale dataset? #105

Open TravisFar opened 5 years ago

TravisFar commented 5 years ago

Hi, I wanna apply 2000 gray scale images by 256*256 size to pix2pixhd, however, I dont know how I should prepare my dataset to feed in. I am working on medical images so I have 3 modalities and I wanna synthesize another one but I dont know how I should prepare dataset for this. By preparing, I mean, creating input matrix. is it reasonable to create an input like [256,256, 2000]? Thank you for your help.

SikkeyHuang commented 5 years ago

You want to prepare the dataset or you want to put your prepared dataset for training?

if you want to prepare the dataset, just resize and crop the images to the size you want. https://github.com/SikkeyHuang/pix2pixHD/tree/master/scripts/dataprocess I also prepare my own dataset. There are some scripts to transfer images from colorful to gray images and resize them.

[w,d,c] means the width, the height and the channel of the image. c normally is 3 for the orginal images. If you are using medical images. It should be 3

If you want to training your dataset, just follow the instructions. create a folder in the datasets and create train_A train_B, put your images inside of it.

TravisFar commented 5 years ago

Actually, I wanna train the network with my own dataset. But there is a problem in the results. Because of this, I wonder maybe I have prepared my dataset in the wrong way. I have trained the pix2pix network with this exact dataset and I got reasonable output. However, when I apply this dataset to the pix2pixHD and watch the results, the input images seem blurry which are not in the input. So I am trying to solve this issue. BTW, I am working on medical images and using 3 modalities of MRI as input. Do you have any idea?

BrouBoni commented 5 years ago

@TravisFar Are you using 16 bit gray-scale png ?

SikkeyHuang commented 5 years ago

Can you show a pair of images (the input and the desired output)