MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / bgdR

Function bgdR

src/shape_assembly/utils.py:46–52  ·  view source on GitHub ↗
(Rgts, Rps)

Source from the content-addressed store, hash-verified

44
45
46def bgdR(Rgts, Rps):
47 Rds = torch.bmm(Rgts.permute(0, 2, 1), Rps)
48 Rt = torch.sum(Rds[:, torch.eye(3).bool()], 1) #batch trace
49 # necessary or it might lead to nans and the likes
50 theta = torch.clamp(0.5 * (Rt - 1), -1 + 1e-6, 1 - 1e-6)
51 # print("\033[33m the theta in bgdR is", theta,"\033[0m")
52 return torch.acos(theta)
53
54def get_6d_rot_loss(gt_6d, pred_6d):
55 #input pred_6d , gt_6d : batch * 2 * 3

Callers 1

get_6d_rot_lossFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected