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

Reproducing season translation results #1

Open
lukfischer opened this issue May 13, 2019 · 10 comments
Open

Reproducing season translation results #1

lukfischer opened this issue May 13, 2019 · 10 comments

Comments

@lukfischer
Copy link

Hello!
First of all I want to thank you for this very interesting work and of course for sharing your implementation!

I was trying to reproduce your season translation results (yosemite dataset) but cant get it working.
I made a separate dataset class similar to the existing Celeba one to load the yosemite data, set the att_dict to {'summer': 0, 'winter': 1} and specified label pairs for each image (e.g. [1, -1] summer, [-1, 1] winter).
I tried training the STGAN with diff and target label parameter, but it did not help. The generated images during training (sample_training) as well as when using the test function always show the identical input images.

Is there a special parameter configuration needed to achieve image2image translation results?
Would you mind sharing your implementation for this experiment too?

Thank you in advance!

@wxqTS
Copy link

wxqTS commented May 14, 2019

Hello!@luckfisher
Are you get good results in Facial attribute editing? The results in my testimg looked not very well.
Is the training epoch of 200 not enough?or do you have any tricks?

Thank you!

@csmliu
Copy link
Owner

csmliu commented May 17, 2019

@lukfischer Thanks for your interests on our work. So sorry for the late reply, and I'll check the Automatically watch repositories option.
It's a bit hard to train the season translation model maybe due to that the dataset is too small comparing to CelebA, and I'll give some details to train the season model:

  1. I used only one attribute season, with 1 and -1 representing summer and winter, respectively;
  2. The channels of the model was reduced to 32, and I guess the network for CelebA is too big for this small dataset to train;
  3. I adjusted the tradeoff parameters of the loss functions during the training procedure, but have no idea about them at present.

As for producing identical input images, you may refer to LynnHo/AttGAN-Tensorflow#7 to see if your're meeting with the same problem. I also met with the question once before, and I remember that after I fixed a bug, everything went fine, but I'm sorry that I don't remember what was wrong.
Besides, the structure of STU is still limited, and we'll try to design a better architecture in the recent future.

@csmliu
Copy link
Owner

csmliu commented May 17, 2019

@wxqTS Hi, I don't know what happend, yet there is a small bug in the released code,
In

STGAN/train.py

Line 360 in 1896596

_b_sample_ipt[..., i - 1] = _b_sample_ipt[..., i - 1] * test_int / thres_int
, / thres_int is identical to * 2 since thres_int is set to 0.5 by default. However, I deleted the / thres_int in the test code when merging test_slide.py, test_single.py and test_multi.py. So, if you find the validation results looks fine but the testing results are not so good, you can add --test_int 2, which performs the same as / 0.5. And you could try other numbers, 1.5 for example.
The released model was trained for 130 or 140 epochs, but I dont't remember the certain number. No other tricks are used to train the CelebA model, yet you may explore different tradeoff parameters and new techniques such as Spectral Norm.

@plutoyuxie
Copy link

Hi! @wxqTS I have the same problem. When I train the model to do the facial attribute editing task, the result doesn't converge sometimes using author's code and the default config. It seems that the faces generated have little change compared to the source face images.

@csmliu
Copy link
Owner

csmliu commented May 29, 2019

I checked my code and found that there is a small bug in the evaluation code, I'll update the repo ASAP (maybe today or tomorrow). So sorry for the mistake.


Updated.

@AdarshMJ
Copy link

AdarshMJ commented Jul 16, 2019

Hello!
Any pointers on how to train this on a different dataset?
Should I create a text file like list_attr_celeba.txt where the first lines are the attributes and for each image a label pair (-1 1) indicating the presence or absence of that particular attribute?

Thanks in advance.

@csmliu
Copy link
Owner

csmliu commented Jul 17, 2019

Yes, the total number of samples in the first line, and attributes in the second line (though not used), and image name and attribute labels (for a single sample) in each line.

@AdarshMJ
Copy link

Attributes in the second line is not necessary?

@csmliu
Copy link
Owner

csmliu commented Jul 17, 2019

Not used in the CelebA class, and if you want to skip that row, the skiprows=2 should be changed to skiprows=1 in

STGAN/data.py

Line 156 in 2ef612e

names = np.loadtxt(list_file, skiprows=2, usecols=[0], dtype=np.str)

@AdarshMJ
Copy link

Got it. Thank You!

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

5 participants