Ldhlwh / DFMGAN

[AAAI 2023] Official implementation of "Few-Shot Defect Image Generation via Defect-Aware Feature Manipulation".
https://arxiv.org/abs/2303.02389
Other
83 stars 12 forks source link

hazelnut hole defect train #36

Closed CVKim closed 2 weeks ago

CVKim commented 1 month ago

Did you use any other augmentations while training for hazelnut hole defects?

Did you follow the method provided in the official GitHub exactly as it is for training hazelnut holes?

I resumed training for hole defects using the hazelnut good model you provided, but the performance seems different.

------------------------------ code python train.py --data ./data/hazelnut_hole_mask.zip \ --outdir runs/hazelnut_hole --resume pkls/hazelnut_good.pkl \ --gpus 2 --kimg 400 --snap 10 --transfer res_block_match_dis

Ldhlwh commented 1 month ago

Did you use any other augmentations while training for hazelnut hole defects?

No, only ADA of StyleGAN2-ADA.

Did you follow the method provided in the official GitHub exactly as it is for training hazelnut holes?

Yes, the training codes are exactly the same.

You may have to check each checkpoint as the best model may not be the latest one. Trying different hyperparameters may also help.

CVKim commented 1 month ago

So, can I understand that you didn't perform any additional augmentations or hyperparameter tuning for other classes and conducted the process the same way as in the official repository?

Question: Did you use the same method for training other classes as provided in the pre-train command of the official repo?

thank you!!

Ldhlwh commented 1 month ago

No additional augmentation applied. I may have tried different numbers of kimgs in stage 1 and weights for the mode seeking loss in stage 2, but I can't quite remember the exact value for each category. If you find the results less satisfying you may start with adjusting these arguments.

CVKim commented 1 month ago

Is the output image generated by the G Model a normalized image?

The shape of the image is torch.Size([1, 3, 256, 256]). The minimum value in the image tensor is -1.0932 and the maximum value is 0.9577.

Sorry for asking questions so frequently.


img, mask = G.module.synthesis(ws, defect_ws, noise_mode=noise_mode, output_mask=True, fix_residual_to_zero=False)

Ldhlwh commented 1 month ago

During training we usually do not clamp the generated images to a certain range because it breaks the gradients, instead the generator will be learned to yield images within the range, thus values slightly outside the range like -1.0932 are possible for an expected range of [-1, 1]. When generating images we will do the clamping.