This repository has been archived by the owner on Oct 21, 2021. It is now read-only.
forked from junyanz/pytorch-CycleGAN-and-pix2pix
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: image size in decoder sty2 #11
Open
pnsuau
wants to merge
6
commits into
jolibrain:master
Choose a base branch
from
pnsuau:fix_decoder_sty2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…N-and-pix2pix into fix_decoder_sty2
beniz
reviewed
Dec 28, 2020
models/cycle_gan_sty2_model.py
Outdated
@@ -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)) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
force-pushed
the
fix_decoder_sty2
branch
from
December 29, 2020 17:31
d9ae451
to
acff3ae
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR to allow the use of different image sizes into encoder and decoder while using sty2 decoder.