MCPcopy Create free account
hub / github.com/JunlinHan/DCLGAN / set_input

Method set_input

models/template_model.py:72–81  ·  view source on GitHub ↗

Unpack input data from the dataloader and perform necessary pre-processing steps. Parameters: input: a dictionary that contains the data itself and its metadata information.

(self, input)

Source from the content-addressed store, hash-verified

70 # Our program will automatically call <model.setup> to define schedulers, load networks, and print networks
71
72 def set_input(self, input):
73 """Unpack input data from the dataloader and perform necessary pre-processing steps.
74
75 Parameters:
76 input: a dictionary that contains the data itself and its metadata information.
77 """
78 AtoB = self.opt.direction == 'AtoB' # use <direction> to swap data_A and data_B
79 self.data_A = input['A' if AtoB else 'B'].to(self.device) # get image data A
80 self.data_B = input['B' if AtoB else 'A'].to(self.device) # get image data B
81 self.image_paths = input['A_paths' if AtoB else 'B_paths'] # get image paths
82
83 def forward(self):
84 """Run forward pass. This will be called by both functions <optimize_parameters> and <test>."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected