Blame view

3rdparty/opencv-4.5.4/modules/ml/misc/python/test/test_knearest.py 373 Bytes
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
  #!/usr/bin/env python
  import cv2 as cv
  
  from tests_common import NewOpenCVTests
  
  class knearest_test(NewOpenCVTests):
      def test_load(self):
          k_nearest = cv.ml.KNearest_load(self.find_file("ml/opencv_ml_knn.xml"))
          self.assertFalse(k_nearest.empty())
          self.assertTrue(k_nearest.isTrained())
  
  if __name__ == '__main__':
      NewOpenCVTests.bootstrap()