Esempio n. 1
0
 def __init__(self):
     ImageObjectDetector.__init__(self)
     self.classifier_file = ""
     self.classifier_name = "Face"
     self.scale_factor = 1.1
     self.min_neighbor = 3
     self.face_cascade = None
Esempio n. 2
0
 def __init__( self ):
   ImageObjectDetector.__init__(self)
   self._net_config = ""
   self._weight_file = ""
   self._class_names = ""
   self._thresh = 0.01
   self._gpu_index = "0"
Esempio n. 3
0
 def __init__( self ):
   ImageObjectDetector.__init__(self)
   self._net_config = ""
   self._weight_file = ""
   self._class_names = ""
   self._thresh = 0.01
   self._gpu_index = "0"
Esempio n. 4
0
    def __init__( self ):
        ImageObjectDetector.__init__( self )

        # TODO: Keep these config variables or make new ones
        self._net_config = ""
        self._weight_file = ""
        self._class_names = ""
Esempio n. 5
0
 def __init__(self):
     ImageObjectDetector.__init__(self)
     self._net_config = ""
     self._weight_file = ""
     self._class_names = ""
     self._thresh = 0.01
     self._gpu_index = "0"
     self._display_detections = False
     self._template = ""
 def __init__(self):
     ImageObjectDetector.__init__(self)
     self.m_center_x = 200.0
     self.m_center_y = 200.0
     self.m_height = 200.0
     self.m_width = 100.0
     self.m_dx = 0
     self.m_dy = 0
     self.frame_ct = 0
Esempio n. 7
0
    def __init__(self):
        ImageObjectDetector.__init__(self)

        self.model_file = "model_file"
        self.norm_image_type = ""
        self.fixed_range = 7000
        self.confidence_thresh = 0.5
        self.memory_usage = 1.0
        self.category_name = "detection"
Esempio n. 8
0
  def __init__(self):
    ImageObjectDetector.__init__(self)

    self.model_file = "model_file"
    self.norm_image_type = ""
    self.fixed_range = 7000
    self.confidence_thresh = 0.5
    self.memory_usage = 1.0
    self.category_name = "detection"
Esempio n. 9
0
 def __init__(self):
     ImageObjectDetector.__init__(self)
     self.m_center_x = 200.0
     self.m_center_y = 200.0
     self.m_height = 200.0
     self.m_width = 100.0
     self.m_dx = 0
     self.m_dy = 0
     self.frame_ct = 0
Esempio n. 10
0
 def test_detect(self):
     modules.load_known_modules()
     detector = ImageObjectDetector.create("example_detector")
     image = Image()
     image_container = ImageContainer(image)
     detections = detector.detect(image_container)
     nose.tools.ok_(detections is not None, "Unexpected empty detections")
     nose.tools.assert_equal(len(detections), 1)
Esempio n. 11
0
 def test_detect(self):
     modules.load_known_modules()
     detector = ImageObjectDetector.create("example_detector")
     image = Image()
     image_container = ImageContainer(image)
     detections = detector.detect(image_container)
     nose.tools.ok_(detections is not None,
                    "Unexpected empty detections" )
     nose.tools.assert_equal(len(detections), 1)
Esempio n. 12
0
    def test_nested_config(self):
        modules.load_known_modules()
        detector = ImageObjectDetector.create("SimpleImageObjectDetector")
        nested_cfg = config.empty_config()
        ImageObjectDetector.get_nested_algo_configuration(
            "detector", nested_cfg, detector)
        # Verify that test cfg is set to configuration inside detector
        # nested configuration uses the name of a detector as an additional configuration
        # key thus it is checked against 7 rather than 6
        #nose.tools.assert_equal(len(nested_cfg), 7)

        #test_cfg = _dummy_detector_cfg()
        #test_cfg.set_value("example_detector:type", "example_detector")
        #ImageObjectDetector.set_nested_algo_configuration( "example_detector",
        #                                    test_cfg,
        #                                    detector )
        nose.tools.assert_equal(
            ImageObjectDetector.check_nested_algo_configuration(
                "detector", nested_cfg), True)
Esempio n. 13
0
    def test_nested_config(self):
        modules.load_known_modules()
        detector = ImageObjectDetector.create("SimpleImageObjectDetector")
        nested_cfg = config.empty_config()
        ImageObjectDetector.get_nested_algo_configuration( "detector",
                                                            nested_cfg,
                                                            detector )
        # Verify that test cfg is set to configuration inside detector
        # nested configuration uses the name of a detector as an additional configuration
        # key thus it is checked against 7 rather than 6
        #nose.tools.assert_equal(len(nested_cfg), 7)

        #test_cfg = _dummy_detector_cfg()
        #test_cfg.set_value("example_detector:type", "example_detector")
        #ImageObjectDetector.set_nested_algo_configuration( "example_detector",
        #                                    test_cfg,
        #                                    detector )
        nose.tools.assert_equal(ImageObjectDetector.check_nested_algo_configuration(
                                                            "detector",
                                                            nested_cfg), True)
Esempio n. 14
0
 def test_config(self):
     modules.load_known_modules()
     detector = ImageObjectDetector.create("example_detector")
     # Verify that 6 config values are present in example_detector
     nose.tools.assert_equal(len(detector.get_configuration()), 6)
     test_cfg = _dummy_detector_cfg()
     # Verify that the detector has different configuration before setting to test
     nose.tools.assert_not_equal(detector.check_configuration(test_cfg), False)
     detector.set_configuration(test_cfg)
     # Verify that the config value is being set properly
     nose.tools.assert_equal(detector.check_configuration(test_cfg), True)
Esempio n. 15
0
 def test_config(self):
     modules.load_known_modules()
     detector = ImageObjectDetector.create("example_detector")
     # Verify that 6 config values are present in example_detector
     nose.tools.assert_equal(len(detector.get_configuration()), 6)
     test_cfg = _dummy_detector_cfg()
     # Verify that the detector has different configuration before setting to test
     nose.tools.assert_not_equal(detector.check_configuration(test_cfg),
                                 False)
     detector.set_configuration(test_cfg)
     # Verify that the config value is being set properly
     nose.tools.assert_equal(detector.check_configuration(test_cfg), True)
Esempio n. 16
0
 def test_bad_create(self):
     # Should fail to create an algorithm without a factory
     ImageObjectDetector.create("")
Esempio n. 17
0
 def test_registered_names(self):
     modules.load_known_modules()
     registered_detectors = ImageObjectDetector.registered_names()
     print("All registered image object detectors")
     for detectors in registered_detectors:
         print(" " + detectors)
 def __init__(self):
     ImageObjectDetector.__init__(self)
Esempio n. 19
0
 def test_bad_detect(self):
     modules.load_known_modules()
     detector = ImageObjectDetector.create("example_detector")
     detector.detect("Image")
Esempio n. 20
0
 def test_bad_detect(self):
     modules.load_known_modules()
     detector = ImageObjectDetector.create("example_detector")
     detector.detect("Image")
Esempio n. 21
0
 def test_create(self):
     modules.load_known_modules()
     registered_detector = ImageObjectDetector.registered_names()[0]
     nose.tools.ok_(registered_detector is not None,
                    "No instance returned from the factory method")
Esempio n. 22
0
 def test_bad_create(self):
     # Should fail to create an algorithm without a factory
     ImageObjectDetector.create("")
Esempio n. 23
0
 def test_registered_names(self):
     modules.load_known_modules()
     registered_detectors = ImageObjectDetector.registered_names()
     print("All registered image object detectors")
     for detectors in registered_detectors:
         print(" " + detectors)
Esempio n. 24
0
 def test_create(self):
     modules.load_known_modules()
     registered_detector = ImageObjectDetector.registered_names()[0]
     nose.tools.ok_(registered_detector is not None,
                     "No instance returned from the factory method")