Exemplo n.º 1
0
    def define_criterion(self):
        self.projection_loss = loss_utils.kp_l2_loss
        self.mask_loss_fn = torch.nn.MSELoss()
        self.entropy_loss = loss_utils.entropy_loss
        self.deform_reg_fn = loss_utils.deform_l2reg
        self.camera_loss = loss_utils.camera_loss
        self.triangle_loss_fn = loss_utils.LaplacianLoss(self.faces)

        if self.opts.texture:
            self.texture_loss = loss_utils.PerceptualTextureLoss()
            self.texture_dt_loss_fn = loss_utils.texture_dt_loss
Exemplo n.º 2
0
    def define_criterion(self):
        # 3
        if self.opts.kp_loss == 'vanilla':
            print("Using simple L2 loss for reprojection error!")
            self.projection_loss = loss_utils.kp_l2_loss
        elif self.opts.kp_loss == 'gmof':
            print(
                "Using robust Geman-McClure loss with confidences as reprojection error!"
            )
            self.projection_loss = loss_utils.kp_gmof_loss
        else:
            print(
                "Using L2 loss scaled with confidence as reprojection error!")
            self.projection_loss = loss_utils.kp_l2_conf_loss

        self.mask_loss_fn = torch.nn.MSELoss()
        self.entropy_loss = loss_utils.entropy_loss
        self.deform_reg_fn = loss_utils.deform_l2reg
        self.camera_loss = loss_utils.camera_loss
        self.triangle_loss_fn = loss_utils.LaplacianLoss(self.faces)

        if self.opts.texture:
            self.texture_loss = loss_utils.PerceptualTextureLoss()
            self.texture_dt_loss_fn = loss_utils.texture_dt_loss