Unpack input data from the dataloader and perform necessary pre-processing steps. Parameters: input (dict): include the data itself and its metadata information.
(self, input)
| 31 | self.optimizers.append(self.optimizer_G) |
| 32 | |
| 33 | def set_input(self, input): |
| 34 | """Unpack input data from the dataloader and perform necessary pre-processing steps. |
| 35 | Parameters: |
| 36 | input (dict): include the data itself and its metadata information. |
| 37 | """ |
| 38 | self.comp = input['comp'].to(self.device) |
| 39 | self.real = input['real'].to(self.device) |
| 40 | self.mask = input['mask'].to(self.device) |
| 41 | self.inputs = self.comp |
| 42 | if self.opt.input_nc == 4: |
| 43 | self.inputs = torch.cat([self.inputs, self.mask], 1) # channel-wise concatenation |
| 44 | self.real_f = self.real * self.mask |
| 45 | self.bg = self.real * (1 - self.mask) |
| 46 | |
| 47 | def forward(self): |
| 48 | self.output = self.netG(self.inputs, self.mask) |
nothing calls this directly
no outgoing calls
no test coverage detected