1
0
Fork 0

arch adjustments

This commit is contained in:
Sean Sube 2023-12-30 13:50:14 -06:00
parent 366efd1a58
commit 54db63394f
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 5 additions and 0 deletions

View File

@ -105,6 +105,7 @@ def convert_upscale_resrgan(
"conv_up1.weight" in state_dict.keys() "conv_up1.weight" in state_dict.keys()
and "conv_up2.weight" in state_dict.keys() and "conv_up2.weight" in state_dict.keys()
): ):
# both variants are the same for scale=4
model = RRDBNetRescale( model = RRDBNetRescale(
num_in_ch=3, num_in_ch=3,
num_out_ch=3, num_out_ch=3,

View File

@ -185,6 +185,8 @@ class RRDBNetFixed(nn.Module):
# upsampling # upsampling
if self.scale > 1: if self.scale > 1:
self.conv_up1 = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True) self.conv_up1 = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True)
if self.scale > 2:
self.conv_up2 = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True) self.conv_up2 = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True)
self.conv_hr = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True) self.conv_hr = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True)
@ -201,6 +203,8 @@ class RRDBNetFixed(nn.Module):
feat = self.lrelu( feat = self.lrelu(
self.conv_up1(F.interpolate(feat, scale_factor=2, mode="nearest")) self.conv_up1(F.interpolate(feat, scale_factor=2, mode="nearest"))
) )
if self.scale > 2:
feat = self.lrelu( feat = self.lrelu(
self.conv_up2(F.interpolate(feat, scale_factor=2, mode="nearest")) self.conv_up2(F.interpolate(feat, scale_factor=2, mode="nearest"))
) )