def __init__(self, opt): super(DddLoss, self).__init__() self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_reg = L1Loss() self.crit_rot = BinRotLoss() self.opt = opt self.emb_scale = 1
def __init__(self, opt): super(DddLoss, self).__init__() self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_reg = L1Loss() self.crit_kp = RegWeightedL1Loss() self.crit_rot = BinRotLoss() self.opt = opt
def __init__(self, opt): super(DddLoss, self).__init__() self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_reg = L1Loss() self.crit_rot = BinRotLoss() self.dept_reg = ConfidenceLoss() self.opt = opt
def __init__(self, opt): super(DddLoss, self).__init__() self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_reg = L1Loss() self.crit_rot = BinRotLoss() self.depth_reg = L2Loss() self.dim_reg = L2Loss() self.vec_reg = L1Loss_ver() self.opt = opt
def __init__(self, opt): super(CarPoseLoss, self).__init__() self.crit = FocalLoss() self.crit_hm_hp = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_kp = RegWeightedL1Loss() if not opt.dense_hp else \ torch.nn.L1Loss(reduction='sum') self.crit_reg = RegL1Loss() if opt.reg_loss == 'l1' else \ RegLoss() if opt.reg_loss == 'sl1' else None self.crit_rot = BinRotLoss() self.opt = opt self.position_loss = Position_loss(opt)
def __init__(self, opt): super(DddLoss, self).__init__() # 定义损失函数 self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() # L1损失函数 self.crit_reg = L1Loss() # 混合连续-离散损失:multiBin损失 self.crit_rot = BinRotLoss() self.opt = opt
def __init__(self, opt): super(RodetLoss, self).__init__() self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_reg = RegL1Loss() if opt.reg_loss == 'l1' else \ RegLoss() if opt.reg_loss == 'sl1' else None self.crit_wh = torch.nn.L1Loss(reduction='sum') if opt.dense_wh else \ NormRegL1Loss() if opt.norm_wh else \ RegWeightedL1Loss() if opt.cat_spec_wh else self.crit_reg self.crit_angle = BinRotLoss() if opt.rotate_binloss else RegMSELoss() self.crit_dense_angle = DenseRegL1Loss() if opt.dense_angle else None self.opt = opt