When calculating the direction loss between the pred and gt, I found that after calculating sin (a) cos (b), you assigned the value to bbox_ Pred [:, - 1], but when calculating cos (a) sin (b), you use bbox_ Pred [:, - 1] again, so your loss calculation becomes sin (a) cos (b) - cos (sin (a) cos (b)) sin (b) instead of sin (a) cos (b) - cos (a) sin (b). Is there an error here?
@zhulf0804
# sin(a - b) = sin(a)*cos(b) - cos(a)*sin(b)
bbox_pred[:, -1] = torch.sin(bbox_pred[:, -1].clone()) * torch.cos(batched_bbox_reg[:, -1].clone())
batched_bbox_reg[:, -1] = torch.cos(bbox_pred[:, -1].clone()) * torch.sin(batched_bbox_reg[:, -1].clone())
When calculating the direction loss between the pred and gt, I found that after calculating sin (a) cos (b), you assigned the value to
bbox_ Pred [:, - 1]
, but when calculating cos (a) sin (b), you usebbox_ Pred [:, - 1]
again, so your loss calculation becomes sin (a) cos (b) - cos (sin (a) cos (b)) sin (b) instead of sin (a) cos (b) - cos (a) sin (b). Is there an error here? @zhulf0804