thohemp / 6DRepNet360

Official Pytorch implementation of "Towards Robust and Unconstrained Full Range of Rotation Head Pose Estimation" IEEE TIP 24
MIT License
112 stars 2 forks source link

evaluate mae #11

Open geoffzhang opened 4 months ago

geoffzhang commented 4 months ago

Hello, I have a question about the method of calculating mae. The below is coded in your code. """ += torch.sum(torch.min(torch.stack((torch.abs(p_gt_deg - p_pred_deg), torch.abs(p_pred_deg + 360 - p_gt_deg), torch.abs( p_pred_deg - 360 - p_gt_deg), torch.abs(p_pred_deg + 180 - p_gt_deg), torch.abs(p_pred_deg - 180 - p_gt_deg))), 0)[0]) yaw_error += torch.sum(torch.min(torch.stack((torch.abs(y_gt_deg - y_pred_deg), torch.abs(y_pred_deg + 360 - y_gt_deg), torch.abs( y_pred_deg - 360 - y_gt_deg), torch.abs(y_pred_deg + 180 - y_gt_deg), torch.abs(y_pred_deg - 180 - y_gt_deg))), 0)[0]) roll_error += torch.sum(torch.min(torch.stack((torch.abs(r_gt_deg - r_pred_deg), torch.abs(r_pred_deg + 360 - r_gt_deg), torch.abs( r_pred_deg - 360 - r_gt_deg), torch.abs(r_pred_deg + 180 - r_gt_deg), torch.abs(r_pred_deg - 180 - r_gt_deg))), 0)[0]) """ I don't understand why to use " torch.abs(p_pred_deg + 180 - p_gt_deg), torch.abs(p_pred_deg - 180 - p_gt_deg)". For example, if p_pred_deg=10 and p_gt_deg=170, the error should be 160. But if I calculate it use your method, the error is 20.

geoffzhang commented 4 months ago

@thohemp

awarebayes commented 4 months ago

https://github.com/thohemp/6DRepNet360/issues/2#issuecomment-1798445673

thohemp commented 4 months ago

Thanks @geoffzhang @awarebayes This seems indeed odd, I will investigate this.