Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regarding to the test dataset preparation #117

Open
zyzhang1130 opened this issue Feb 3, 2020 · 9 comments
Open

regarding to the test dataset preparation #117

zyzhang1130 opened this issue Feb 3, 2020 · 9 comments

Comments

@zyzhang1130
Copy link

zyzhang1130 commented Feb 3, 2020

Hi, I would like to clarify the following confusion:

Why should the testing data set be split as well? I understand that at the training stage the model needs to understand which image belongs to which category(e.g. happy, sad etc.),but for testing there should be only one category of input and the model is supposed to generate all the categories same as for training right?

Correct me if I'm wrong. Thank you.

@yunjey
Copy link
Owner

yunjey commented Feb 3, 2020

@zyzhang1130 For categorical setting (e.g. RaFD), we don't need the original label of an input. The reason why we split test data is to use ImageFolder as our dataset class. You could implement your own dataset class to avoid splitting test data.

For binary setting (e.g. CelebA), we need the original label of an input to perform single or multiple attribute transfer.

@zyzhang1130
Copy link
Author

Yeah I am using my own dataset in the similar fashion as RaFD with the given Test StarGAN on custom datasets code. I setup my training data files as per instruction given but I still got error saying I did not split up my testing data. Actually does it mean I shouldn't use test command to generate new images? If yes then which command should I use?

Thank you.

@zyzhang1130
Copy link
Author

I used this one to generate new images:
python main.py --mode test --dataset RaFD --image_size 128
--c_dim 6 --rafd_image_dir data/RaFD/test
--sample_dir stargan_rafd/samples --log_dir stargan_rafd/logs
--model_save_dir stargan_rafd/models --result_dir stargan_rafd/results

@yunjey
Copy link
Owner

yunjey commented Feb 5, 2020

@zyzhang1130 Could you upload the detailed error message?

@zyzhang1130
Copy link
Author

zyzhang1130 commented Feb 6, 2020

RuntimeError: Found 0 files in subfolders of: data/RaFD/test
Supported extensions are: .jpg,.jpeg,.png,.ppm,.bmp,.pgm,.tif,.tiff,.webp
But actually I put my un-grouped .jpg image (for generation) in that path. The fact that it was trying to search the sub-folder makes me think the code assumes there are images in different categories under data/RaFD/test

@yunjey
Copy link
Owner

yunjey commented Feb 6, 2020

@zyzhang1130 As I mentioned in README, you should create a folder structure as described in here. Create sub-folders in 'data/RaFD/test' and put your image into the corresponding sub-folder.

@zyzhang1130
Copy link
Author

Sure but my testing images only have one single instance of portrayal/expression for each person, since my objective is to generate multiple expressions for each person. So how should I put those images in different sub-folder? It feels like defeating the purpose.

@yunjey
Copy link
Owner

yunjey commented Feb 6, 2020

@zyzhang1130 If there is no image for a particular domain (i.e. expression), leave it in an empty folder.

@zyzhang1130
Copy link
Author

May I further clarify that the reason you want to put test data in separate sub-folders is it because data in test folder was used during the training stage for validation purpose? And is there an underlying assumption that the input for generation must belong to one of the domain? To illustrate, in the example below, if the input does not belong to any of the existing eight expressions, how do you decide which sub-folder to put it in?
image
Thank you for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants