977e38de2e77d46b36ace96b4c76910174f77ad7,models/face_shift_net/face_shiftnet_model.py,FaceShiftNetModel,set_input,#FaceShiftNetModel#,127

Before Change


            // make it 4 dimensions.
            // Mention: the extra dim, the masked part is filled with 0, non-mask part is filled with 1.
            real_A = torch.cat((real_A, (1 - self.mask_global).expand(real_A.size(0), 1, real_A.size(2), real_A.size(3)).type_as(real_A)), dim=1)
            real_A_flip = torch.cat((real_A_flip, (1 - self.mask_global_flip).expand(real_A_flip.size(0), 1, real_A.size(2), real_A.size(3)).type_as(real_A)), dim=1)

        self.real_A = real_A
        self.real_B = real_B

After Change


        real_A.narrow(1,1,1).masked_fill_(self.mask_global, 0.)/ǘ*104.0/255.0 - 1.0
        real_A.narrow(1,2,1).masked_fill_(self.mask_global, 0.)/ǘ*117.0/255.0 - 1.0

        self.mask_global_flip = torch.flip(self.mask_global.float(), [3]).bool()
        real_A_flip.narrow(1,0,1).masked_fill_(self.mask_global_flip, 0.)/ǘ*123.0/255.0 - 1.0
        real_A_flip.narrow(1,1,1).masked_fill_(self.mask_global_flip, 0.)/ǘ*104.0/255.0 - 1.0
        real_A_flip.narrow(1,2,1).masked_fill_(self.mask_global_flip, 0.)/ǘ*117.0/255.0 - 1.0


        if self.opt.add_mask2input:
            // make it 4 dimensions.
            // Mention: the extra dim, the masked part is filled with 0, non-mask part is filled with 1.
            real_A = torch.cat((real_A, (~self.mask_global).expand(real_A.size(0), 1, real_A.size(2), real_A.size(3)).type_as(real_A)), dim=1)
            real_A_flip = torch.cat((real_A_flip, (~self.mask_global_flip).expand(real_A_flip.size(0), 1, real_A.size(2), real_A.size(3)).type_as(real_A)), dim=1)

        self.real_A = real_A
        self.real_B = real_B
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 6

Instances


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: 977e38de2e77d46b36ace96b4c76910174f77ad7
Time: 2020-06-14
Author: yanzhaoyi@outlook.com
File Name: models/face_shift_net/face_shiftnet_model.py
Class Name: FaceShiftNetModel
Method Name: set_input


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: 977e38de2e77d46b36ace96b4c76910174f77ad7
Time: 2020-06-14
Author: yanzhaoyi@outlook.com
File Name: models/face_shift_net/face_shiftnet_model.py
Class Name: FaceShiftNetModel
Method Name: set_gt_latent


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: 4e611ef928fdeb52d4fd5521a6f2b2d3bf3fb4a5
Time: 2019-12-21
Author: yanzhaoyi@outlook.com
File Name: models/shift_net/shiftnet_model.py
Class Name: ShiftNetModel
Method Name: set_input


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: 4e611ef928fdeb52d4fd5521a6f2b2d3bf3fb4a5
Time: 2019-12-21
Author: yanzhaoyi@outlook.com
File Name: models/shift_net/shiftnet_model.py
Class Name: ShiftNetModel
Method Name: set_gt_latent