MCPcopy Create free account
hub / github.com/OpenTalker/StyleHEAT / forward

Method forward

models/e4e/e4e.py:141–148  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

139 self.latent_avg = latent_avg
140
141 def forward(self, x):
142 codes = self.encoder(x)
143 # normalize with respect to the center of an average face
144 if codes.ndim == 2:
145 w_latent = codes + self.latent_avg.repeat(codes.shape[0], 1, 1)[:, 0, :]
146 else:
147 w_latent = codes + self.latent_avg.repeat(codes.shape[0], 1, 1)
148 return w_latent

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected