zhulf0804 / PointPillars

A Simple PointPillars PyTorch Implementation for 3D LiDAR(KITTI) Detection.
MIT License
454 stars 112 forks source link

On Angle Calculation in LOSS #38

Closed hehualin-tut closed 5 months ago

hehualin-tut commented 1 year ago

# 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 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

zhulf0804 commented 1 year ago

Hello @hehualin-tut, I'm sorry for the late reply.

Yes, I think you are right. Free feel to open a PR to fix this error.

Best, Lifa.