junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
23.09k stars 6.32k forks source link

Query realted if the model can give RGBA image as output? #1662

Open roshan2024nar opened 5 months ago

roshan2024nar commented 5 months ago

Hello,

just wanted to know can i train the model for taking jpg or png(Transperent) as input and then get result in png(Transperent)..... how should i modify the code ?

Thank you for the help :)

Jiwno commented 2 months ago

You can train png image if you change --input_nc and --output_nc into 4. And there might be an converting code in loading the data in file "aligned_dataset.py". You have to delete the convert code of PIL library. I hope this help.

Jiwno commented 2 months ago

Oh, and you might also have to change the normalizing part in file "base_dataset.py" I remember that the code is for 3 dimension image so you have to add one more dimension when it nomalize it.