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

Class ResBlock3d

LivePortrait/modules/util.py:79–99  ·  view source on GitHub ↗

Res block, preserve spatial resolution.

Source from the content-addressed store, hash-verified

77
78
79class ResBlock3d(nn.Module):
80 """
81 Res block, preserve spatial resolution.
82 """
83
84 def __init__(self, in_features, kernel_size, padding):
85 super(ResBlock3d, self).__init__()
86 self.conv1 = nn.Conv3d(in_channels=in_features, out_channels=in_features, kernel_size=kernel_size, padding=padding)
87 self.conv2 = nn.Conv3d(in_channels=in_features, out_channels=in_features, kernel_size=kernel_size, padding=padding)
88 self.norm1 = nn.BatchNorm3d(in_features, affine=True)
89 self.norm2 = nn.BatchNorm3d(in_features, affine=True)
90
91 def forward(self, x):
92 out = self.norm1(x)
93 out = F.relu(out)
94 out = self.conv1(out)
95 out = self.norm2(out)
96 out = F.relu(out)
97 out = self.conv2(out)
98 out += x
99 return out
100
101
102class UpBlock3d(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected