def __init__(self, opt):
    super(MotLoss, 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.opt = opt
    self.emb_dim = opt.reid_dim
    self.nID = opt.nID
    self.classifier = nn.Linear(self.emb_dim, self.nID)
    self.IDLoss = nn.CrossEntropyLoss(ignore_index=(- 1))
    self.emb_scale = (math.sqrt(2) * math.log((self.nID - 1)))
    self.s_det = nn.Parameter(((- 1.85) * torch.ones(1)))
    self.s_id = nn.Parameter(((- 1.05) * torch.ones(1)))
def __init__(self, opt):
    super(MotLoss, 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.opt = opt
    self.emb_dim = opt.reid_dim
    self.nID = opt.nID
    self.classifier = nn.Linear(self.emb_dim, self.nID)
    self.IDLoss = nn.CrossEntropyLoss(ignore_index=(- 1))
    self.emb_scale = (math.sqrt(2) * math.log((self.nID - 1)))
    self.s_det = nn.Parameter(((- 1.85) * torch.ones(1)))
    self.s_id = nn.Parameter(((- 1.05) * torch.ones(1)))