MCPcopy Create free account
hub / github.com/deepbrainai-research/float / Generator

Class Generator

models/float/generator.py:7–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5from models import BaseModel
6
7class Generator(BaseModel):
8 def __init__(self, size, style_dim=512, motion_dim=20, channel_multiplier=1, blur_kernel=[1, 3, 3, 1]):
9 super().__init__()
10
11 self.enc = Encoder(size, style_dim, motion_dim)
12 self.dec = Synthesis(size, style_dim, motion_dim, blur_kernel, channel_multiplier)
13
14 def get_direction(self):
15 return self.dec.direction(None)
16
17 def synthesis(self, wa, alpha, feat):
18 img, flow = self.dec(wa, alpha, feat)
19 return img
20
21 def forward(self, img_source, img_drive, h_start=None):
22 wa, alpha, feats = self.enc(img_source, img_drive, h_start)
23 img_recon, flow = self.dec(wa, alpha, feats)
24 return {'d_hat': img_recon, 'flow': flow}
25

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected