Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

fix: image size in decoder sty2 #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pnsuau
Copy link

@pnsuau pnsuau commented Dec 23, 2020

PR to allow the use of different image sizes into encoder and decoder while using sty2 decoder.

@pnsuau pnsuau requested review from beniz and Bycob December 23, 2020 14:24
@pnsuau pnsuau changed the title Fix decoder sty2 fix: image size in decoder sty2 Dec 23, 2020
@@ -264,19 +267,19 @@ def forward(self):
#self.netDecoderG_B.eval()
if self.rec_noise > 0.0:
self.fake_B_noisy1 = self.gaussian(self.fake_B, self.rec_noise)
self.z_rec_A, self.n_rec_A = self.netG_B(self.fake_B_noisy1)
self.z_rec_A, self.n_rec_A = self.netG_B(nnf.interpolate(self.fake_B_noisy1, size=(self.opt.crop_size), mode='bicubic', align_corners=False))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe only interpolate if the image size is not already the one requested ? Or maybe this is what nnf.interpolate does already, i.e. does nothing if size is correct ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you may want to separate the interpolation call from the netG and other calls, as it makes the code difficult to read.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the code according to your advices :)

@pnsuau pnsuau marked this pull request as ready for review December 29, 2020 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants