MCPcopy Create free account
hub / github.com/ai4ce/RAP / get_pose_error

Function get_pose_error

utils/eval_utils.py:56–63  ·  view source on GitHub ↗
(gt_pose, pred_pose)

Source from the content-addressed store, hash-verified

54
55
56def get_pose_error(gt_pose, pred_pose):
57 gt_q = rotation_matrix_to_quaternion(gt_pose[..., :3, :3]) # .cpu().numpy()
58 gt_t = gt_pose[..., :3, 3]
59 pred_q = rotation_matrix_to_quaternion(pred_pose[..., :3, :3]) # .cpu().numpy()
60 pred_t = pred_pose[..., :3, 3]
61 theta = gt_q.mul_(pred_q).sum(dim=-1).abs_().clamp_(-1., 1.).acos_().mul_(2 * 180 / math.pi)
62 error_x = torch.linalg.vector_norm(gt_t - pred_t, ord=2, dim=-1)
63 return error_x, theta
64
65def generate_rotation_error_bar(errors_rot, output_dir):
66

Callers 5

refineFunction · 0.90
refineFunction · 0.90
refineMethod · 0.90
refineMethod · 0.90
eval_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected