alokwhitewolf / pytorch-attention-guided-cyclegan Goto Github PK
View Code? Open in Web Editor NEWPytorch implementation of Unsupervised Attention-guided Image-to-Image Translation.
Pytorch implementation of Unsupervised Attention-guided Image-to-Image Translation.
i wonder a better way to make this kind of attn-base generator convergence
could you please share some train tricks while you train this architecture ? : )
Very clean code, however I have found what I believe are differences between the paper and the code implementation in the model structure. Could you please share why these differences came into existence?
I get this error whenever I try to train the network using "train.py"
Traceback (most recent call last):
File ".\train.py", line 237, in <module>
all()
File ".\train.py", line 141, in all
attnMapA = toZeroThreshold(AttnA(realA))
File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\User1\Documents\Pytorch-Attention-Guided-CycleGAN\models.py", line 141, in forward
return self.model(x)
File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\User1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\conv.py", line 320, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [32, 3, 7, 7], expected input[1, 4, 256, 256] to have 3 channels, but got 4 channels instead
It's also important to mention that i had to slightly modify the code for windows multiprocessing compatibility. I created a all() function that includes the whole code and gets run like this as stated in the Pytorch windows FAQ:
if __name__ == '__main__':
all()
Hi,
Thank you for this task. If I want to make attention in the background that I need to change rather than the object. For example, in domain A and B, we have horse images, when translating from domain A - B, I want to keep the same horse in domain B but the background will be changed as domain A. How I can do that? Thank you in advance.
Hi,
I believe there is a bug in this line
DisLossB = fakeTargetLoss(disB(genB)) + fakeTargetLoss(disB(genB_)) + 2*realTargetLoss(disA(realB))
in the last term, there should be disB
instead of disA
, right?
Thank you for your implementation of Unsupervised Attention-guided Image-to-Image Translation. After learning your code, I found some difference between yours and the description of the original paper.
your code:
attnMapA = toZeroThreshold(AttnA(realA))
fgA = attnMapA * realA
bgA = (1 - attnMapA) * realA
genB = genA2B(fgA)
fakeB = (attnMapA * genB) + bgA
but in original paper, After feeding the input image to the generator, Apply the learned mask
to the generated image using an element-wise product ‘* ’, and then add the background using the
inverse of the mask applied to the input image.
attnMapA = toZeroThreshold(AttnA(realA))
fgA = attnMapA * realA
bgA = (1 - attnMapA) * realA
genB = genA2B(realA)
fakeB = (attnMapA * genB) + bgA
According to the original paper, genB = genA2B(realA) rather than genB = genA2B(fgA) , and then fakeB = (attnMapA * genB) + bgA
Could you tall me why do you implement the code in this way?
Finally, please forgive me for my bad English if it annoys you. =。=!
Hi,
How can we get test images?
Thanks in advanced.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.