MCPcopy Create free account
hub / github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait / UpBlock3d

Class UpBlock3d

LivePortrait/modules/util.py:102–119  ·  view source on GitHub ↗

Upsampling block for use in decoder.

Source from the content-addressed store, hash-verified

100
101
102class UpBlock3d(nn.Module):
103 """
104 Upsampling block for use in decoder.
105 """
106
107 def __init__(self, in_features, out_features, kernel_size=3, padding=1, groups=1):
108 super(UpBlock3d, self).__init__()
109
110 self.conv = nn.Conv3d(in_channels=in_features, out_channels=out_features, kernel_size=kernel_size,
111 padding=padding, groups=groups)
112 self.norm = nn.BatchNorm3d(out_features, affine=True)
113
114 def forward(self, x):
115 out = F.interpolate(x, scale_factor=(1, 2, 2))
116 out = self.conv(out)
117 out = self.norm(out)
118 out = F.relu(out)
119 return out
120
121
122class DownBlock2d(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected