| 120 | |
| 121 | class MultiProjModel(nn.Module): |
| 122 | def __init__(self, adapter_in_dim=1024, cross_attention_dim=1024): |
| 123 | super().__init__() |
| 124 | |
| 125 | self.generator = None |
| 126 | self.cross_attention_dim = cross_attention_dim |
| 127 | self.eye_proj = torch.nn.Linear(6, cross_attention_dim, bias=False) |
| 128 | self.emo_proj = torch.nn.Linear(30, cross_attention_dim, bias=False) |
| 129 | self.mouth_proj = torch.nn.Linear(512, cross_attention_dim, bias=False) |
| 130 | self.headpose_proj = torch.nn.Linear(6, cross_attention_dim, bias=False) |
| 131 | |
| 132 | self.norm = torch.nn.LayerNorm(cross_attention_dim) |
| 133 | |
| 134 | def forward(self, adapter_embeds): |
| 135 | B, num_frames, C = adapter_embeds.shape |