(self, geo_feat_channels, tex_feat_channels, feat_channel_up, mlp_hidden_channels, mlp_hidden_layers, use_tex=True, tex_channels=3, posenc=0)
| 20 | |
| 21 | class AutoEncoderGroupV3(nn.Module): |
| 22 | def __init__(self, geo_feat_channels, tex_feat_channels, feat_channel_up, mlp_hidden_channels, mlp_hidden_layers, use_tex=True, tex_channels=3, posenc=0) -> None: |
| 23 | super().__init__() |
| 24 | self.use_tex = use_tex |
| 25 | |
| 26 | self.geo_encoder = nn.Conv3d(1, geo_feat_channels, kernel_size=4, stride=2, padding=1, bias=True) |
| 27 | if use_tex: |
| 28 | self.tex_encoder = nn.Conv3d(tex_channels + 1, tex_feat_channels, kernel_size=4, stride=2, padding=1, bias=True) |
| 29 | out_channels = geo_feat_channels + tex_feat_channels if use_tex else geo_feat_channels |
| 30 | self.norm = nn.InstanceNorm2d(out_channels) |
| 31 | |
| 32 | self.geo_feat_dim = geo_feat_channels |
| 33 | self.tex_feat_dim = tex_feat_channels |
| 34 | |
| 35 | self.geo_convs = TriplaneGroupResnetBlock( |
| 36 | geo_feat_channels, feat_channel_up, ks=5, input_norm=False, input_act=False |
| 37 | ) |
| 38 | self.geo_decoder = DecoderMLP(feat_channel_up, 1, mlp_hidden_channels, mlp_hidden_layers) |
| 39 | |
| 40 | if use_tex: |
| 41 | self.tex_convs = TriplaneGroupResnetBlock( |
| 42 | tex_feat_channels, feat_channel_up, ks=5, input_norm=False, input_act=False |
| 43 | ) |
| 44 | self.tex_decoder = DecoderMLP(feat_channel_up, tex_channels, mlp_hidden_channels, mlp_hidden_layers, posenc=posenc) |
| 45 | |
| 46 | self.register_buffer("aabb", torch.tensor([-1, -1, -1, 1, 1, 1], dtype=torch.float32)) |
| 47 | |
| 48 | def geo_parameters(self): |
| 49 | return list(self.geo_encoder.parameters()) + list(self.geo_convs.parameters()) + list(self.geo_decoder.parameters()) |
no test coverage detected