예제 #1
0
 def test_points2rotation1(self):
     """Test that X points returns R rotations."""
     tol = 1e-5
     skel = Skeleton("TEST")
     rot = skel._points2rotation(X[None, ...])
     result = torch.allclose(R, rot, atol=tol, rtol=tol)
     self.assertTrue(result)
예제 #2
0
 def test_rotation2points2(self):
     """Test rotation retruns test points."""
     tol = 1e-5
     skel = Skeleton("TEST")
     xyz = skel._rotation2points(R[None, ...])
     result = torch.allclose(X, xyz[0, ...], atol=tol, rtol=tol)
     self.assertTrue(result)
예제 #3
0
 def test_roundtrip3(self):
     """Test that X points returns R rotations that make X points."""
     tol = 1e-5
     skel = Skeleton("TEST")
     rot = skel.angles(X[None, ...])
     xyz = skel.points(rot)
     result = torch.allclose(X, xyz, atol=tol, rtol=tol)
     self.assertTrue(result)
예제 #4
0
 def test_roundtrip2(self):
     """Test that R rotations returns xyz points  that make R rotations."""
     tol = 1e-5
     skel = Skeleton("TEST")
     xyz = skel._rotation2points(R[None, ...])
     _r = skel._points2rotation(xyz)
     result = torch.allclose(R, _r, atol=tol, rtol=tol)
     self.assertTrue(result)
예제 #5
0
 def test_roundtrip4(self):
     """Test that R rotations returns xyz points that make R rotations."""
     tol = 1e-5
     skel = Skeleton("TEST")
     r = R[None, :, :2, :].reshape(1, -1, 6)
     xyz = skel.points(r)
     _r = skel.angles(xyz)
     result = torch.allclose(_r, r, atol=tol, rtol=tol)
     self.assertTrue(result)
예제 #6
0
 def test_rotation2points1(self):
     """Test that identity does not apply rotation."""
     skel = Skeleton("TEST")
     xyz = skel._rotation2points(ZR[None, ...])
     self.assertTrue(torch.allclose(skel.xyz[0], xyz))
예제 #7
0
 def test_body25(self):
     """Test body 25 has 25 points"""
     skel = Skeleton("BODY_25")
     self.assertEqual(skel.n, 25)
예제 #8
0
 def test_default(self):
     """Test number of lengths is greater than 0."""
     skel = Skeleton()
     self.assertGreater(skel.n, 0)