Ejemplo n.º 1
0
    def test_rad2deg(self):
        lf = LandmarkFace(np.random.random((68, 2)), np.zeros((12, 13)))

        for i in range(68):
            for j in range(68):
                res_rad = lf.angle(i, j, use_radians=True)
                res_deg = lf.angle(i, j)
                assert math.degrees(res_rad) == res_deg
Ejemplo n.º 2
0
    def test_identical(self):
        lf = LandmarkFace(np.random.random((68, 2)), np.zeros((12, 13)))

        for i in range(68):
            for j in range(68):
                ref_vector = lf.points[j] - lf.points[i]
                assert lf.angle(i, j, reference_vector=ref_vector) == 0