コード例 #1
0
ファイル: test_feature.py プロジェクト: ALouis38/vital
    def test_set_covar(self):
        f = Feature(ctype=ctypes.c_double)
        nose.tools.assert_equal(f.covariance, Covariance())

        expected = [[1, 2],
                    [3, 4]]
        c = Covariance(2, ctypes.c_double, expected)
        f.covariance = c
        nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
        nose.tools.assert_equal(f.covariance, c)

        # And for floats...
        f = Feature(ctype=ctypes.c_float)
        nose.tools.assert_equal(f.covariance, Covariance())

        expected = [[1, 2],
                    [3, 4]]
        c = Covariance(2, ctypes.c_float, expected)
        f.covariance = c
        nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
        nose.tools.assert_equal(f.covariance, c)
コード例 #2
0
ファイル: test_feature.py プロジェクト: vanthaiunghoa/kwiver
    def test_set_covar(self):
        f = Feature(ctype='d')
        #nose.tools.assert_equal(f.covariance, Covariance.new_covar())

        expected = [[1, 2], [3, 4]]
        c = Covariance.from_matrix(2, 'd', expected)
        f.covariance = c
        #nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
        #nose.tools.assert_equal(f.covariance, c)

        # And for floats...
        f = Feature(ctype='f')
        #nose.tools.assert_equal(f.covariance, Covariance())

        expected = [[1, 2], [3, 4]]
        c = Covariance.from_matrix(2, 'f', expected)
        f.covariance = c
        #nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
コード例 #3
0
    def test_set_covar(self):
        f = Feature(ctype=ctypes.c_double)
        nose.tools.assert_equal(f.covariance, Covariance())

        expected = [[1, 2], [3, 4]]
        c = Covariance(2, ctypes.c_double, expected)
        f.covariance = c
        nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
        nose.tools.assert_equal(f.covariance, c)

        # And for floats...
        f = Feature(ctype=ctypes.c_float)
        nose.tools.assert_equal(f.covariance, Covariance())

        expected = [[1, 2], [3, 4]]
        c = Covariance(2, ctypes.c_float, expected)
        f.covariance = c
        nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
        nose.tools.assert_equal(f.covariance, c)
コード例 #4
0
ファイル: test_feature.py プロジェクト: Kitware/kwiver
    def test_set_covar(self):
        f = Feature(ctype='d')
        #nose.tools.assert_equal(f.covariance, Covariance.new_covar())

        expected = [[1, 2],
                    [3, 4]]
        c = Covariance.from_matrix(2, 'd', expected)
        f.covariance = c
        #nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected
        #nose.tools.assert_equal(f.covariance, c)

        # And for floats...
        f = Feature(ctype='f')
        #nose.tools.assert_equal(f.covariance, Covariance())

        expected = [[1, 2],
                    [3, 4]]
        c = Covariance.from_matrix(2, 'f', expected)
        f.covariance = c
        #nose.tools.assert_equal(f.covariance, c)
        # Should also work if we just give it the raw iterable
        f.covariance = expected