Exemplo n.º 1
0
    def __init__(self, config, source):
        self.config = config
        camera_id = self.config.get_section_dict(source)["Id"]
        device = self.config.get_section_dict("Detector")["Device"]
        model_data = get_model_json_file_or_return_default_values(self.config, device, camera_id)

        self.name = model_data["model_name"]

        if self.name == 'mobilenet_ssd_v2':
            from libs.detectors.x86 import mobilenet_ssd
            self.net = mobilenet_ssd.Detector(self.config, self.name, model_data["variables"])
        elif self.name == "openvino":
            from libs.detectors.x86 import openvino
            self.net = openvino.Detector(self.config, self.name, model_data["variables"])
        elif self.name == "openpifpaf":
            from libs.detectors.x86 import openpifpaf
            self.net = openpifpaf.Detector(self.config, self.name, model_data["variables"])
        elif self.name == "openpifpaf_tensorrt":
            from libs.detectors.x86.openpifpaf_tensorrt import openpifpaf_tensorrt
            self.net = openpifpaf_tensorrt.Detector(self.config, self.name, model_data["variables"])
        elif self.name == "yolov3":
            from libs.detectors.x86 import yolov3
            self.net = yolov3.Detector(self.config, self.name, model_data["variables"])

        else:
            raise ValueError('Not supported network named: ', self.name)
Exemplo n.º 2
0
    def __init__(self, config):
        self.config = config
        self.name = self.config.get_section_dict('Detector')['Name']

        if self.name == 'mobilenet_ssd_v2':
            from libs.detectors.x86 import mobilenet_ssd
            self.net = mobilenet_ssd.Detector(self.config)
        elif self.name == "openvino":
            from libs.detectors.x86 import openvino
            self.net = openvino.Detector(self.config)
        else:
            raise ValueError('Not supported network named: ', self.name)