Skip to content

Commit

Permalink
revise feature maps of the discriminator
Browse files Browse the repository at this point in the history
  • Loading branch information
MingtaoGuo authored Oct 19, 2022
1 parent c16fb7c commit 5b941c3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions face_model/gpen_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
'''
@paper: GAN Prior Embedded Network for Blind Face Restoration in the Wild (CVPR2021)
@author: yangxy (yangtao9009@gmail.com)
'''
import math
import random
import functools
Expand Down Expand Up @@ -702,7 +698,6 @@ def forward(self,
truncation_latent=None,
input_is_latent=False,
):
I = inputs * 1.0
noise = []
for i in range(self.log_size-1):
ecd = getattr(self, self.names[i])
Expand All @@ -713,7 +708,6 @@ def forward(self,
noise = noise[::-1]
outs = self.generator([z_id], return_latents, inject_index, truncation, truncation_latent, input_is_latent, noise=noise)
I_st, latents, M = outs
# res = I_st * M + I * (1 - M)
return I_st, latents, M

class Discriminator(nn.Module):
Expand Down Expand Up @@ -779,7 +773,7 @@ def forward(self, input):

out = out.view(batch, -1)
out = self.final_linear(out)
return out, feats
return out, feats[2:]


class VGG19(torch.nn.Module):
Expand Down Expand Up @@ -812,4 +806,4 @@ def forward(self, X):
h_relu4 = self.slice4(h_relu3)
h_relu5 = self.slice5(h_relu4)
out = [h_relu1, h_relu2, h_relu3, h_relu4, h_relu5]
return out
return out

0 comments on commit 5b941c3

Please sign in to comment.