Exemple #1
0
class Capsule(BaseCapsule):
    name = "classifier_mask_openvino"
    description = "OpenVINO face mask classifier."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(
        size=NodeDescription.Size.SINGLE,
        detections=["face"])
    output_type = NodeDescription(
        size=NodeDescription.Size.SINGLE,
        detections=["face"],
        attributes={"mask": Backend.LABELS},
        extra_data=["mask_confidence"])
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files["face_mask.xml"],
        weights_bin=capsule_files["face_mask.bin"],
        device_name=device
    )
    options = {
        "threshold": FloatOption(
            description="Scores under this value are deemed to not be not "
                        "wearing a mask.",
            default=0.3,
            min_val=None,
            max_val=None
        )
    }
Exemple #2
0
class Capsule(BaseCapsule):
    name = "detector_face_openvino"
    description = "✨ OpenVINO fast face detector."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(size=NodeDescription.Size.NONE)
    output_type = NodeDescription(size=NodeDescription.Size.ALL,
                                  detections=["face"])
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files["face-detection-adas-0001.xml"],
        weights_bin=capsule_files["face-detection-adas-0001.bin"],
        device_name=device)
    options = common_detector_options
Exemple #3
0
class Capsule(BaseCapsule):
    name = "detector_person_overhead_openvino"
    description = "OpenVINO fast person detector. Works best in " \
                  "surveillance perspectives from a downwards facing point " \
                  "of view."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(size=NodeDescription.Size.NONE)
    output_type = NodeDescription(
        size=NodeDescription.Size.ALL,
        detections=["person"])
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files["person-detection-retail-0013.xml"],
        weights_bin=capsule_files["person-detection-retail-0013.bin"],
        device_name=device
    )
    options = common_detector_options
Exemple #4
0
class Capsule(BaseCapsule):
    name = "classifier_face_age_gender_openvino"
    description = "OpenVINO face age/gender classifier."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(size=NodeDescription.Size.SINGLE,
                                 detections=["face"])
    output_type = NodeDescription(size=NodeDescription.Size.SINGLE,
                                  detections=["face"],
                                  attributes={
                                      "gender": config.genders,
                                      "age": list(config.age_bins.values())
                                  },
                                  extra_data=["age", "gender_confidence"])
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files["age-gender-recognition-retail-0013.xml"],
        weights_bin=capsule_files["age-gender-recognition-retail-0013.bin"],
        device_name=device)
Exemple #5
0
class Capsule(BaseCapsule):
    name = "classifier_vehicle_color_openvino"
    description = "OpenVINO vehicle color classifier."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(
        size=NodeDescription.Size.SINGLE,
        detections=config.vehicle_types)
    output_type = NodeDescription(
        size=NodeDescription.Size.SINGLE,
        detections=config.vehicle_types,
        attributes={"color": config.colors})
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files[
            "vehicle-attributes-recognition-barrier-0039.xml"],
        weights_bin=capsule_files[
            "vehicle-attributes-recognition-barrier-0039.bin"],
        device_name=device
    )
Exemple #6
0
class Capsule(BaseCapsule):
    name = "detector_person_vehicle_bike_openvino"
    description = ("OpenVINO person, vehicle, and bike detector. Optimized "
                   "for surveillance camera scenarios.")
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(size=NodeDescription.Size.NONE)
    output_type = NodeDescription(size=NodeDescription.Size.ALL,
                                  detections=["vehicle", "person", "bike"])
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files[
            "person-vehicle-bike-detection-crossroad-1016-fp32.xml"],
        weights_bin=capsule_files[
            "person-vehicle-bike-detection-crossroad-1016-fp32.bin"],
        device_name=device)
    options = {
        **common_detector_options, "only_person_detections":
        BoolOption(
            default=False,
            description="Filter out anything that's not a person detection")
    }
Exemple #7
0
class Capsule(BaseCapsule):
    name = "classifier_face_emotion_openvino"
    description = "OpenVINO face emotion classifier."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(
        size=NodeDescription.Size.SINGLE,
        detections=["face"])
    output_type = NodeDescription(
        size=NodeDescription.Size.SINGLE,
        detections=["face"],
        attributes={"emotion": EMOTION_TYPES},
        extra_data=["emotion_confidence"]
    )
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files[
            "emotions-recognition-retail-0003.xml"],
        weights_bin=capsule_files[
            "emotions-recognition-retail-0003.bin"],
        device_name=device
    )
Exemple #8
0
class Capsule(BaseCapsule):
    name = "detector_safety_gear_openvino"
    description = "OpenVino's safety gear detector (safety vest and safety " \
                  "hat)"
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(size=NodeDescription.Size.NONE)
    output_type = NodeDescription(
        size=NodeDescription.Size.ALL,
        detections=["safety vest", "safety hat"]
    )
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files["worker_safety_mobilenet_FP16.xml"],
        weights_bin=capsule_files["worker_safety_mobilenet_FP16.bin"],
        device_name=device
    )
    options = {
        "threshold": FloatOption(
            default=0.5,
            min_val=0.0,
            max_val=None
        )
    }
Exemple #9
0
class Capsule(BaseCapsule):
    name = "classifier_safety_gear_openvino"
    description = "Roughly identify if person is wearing safety hat " \
                  "and safety vest."
    version = 1
    device_mapper = DeviceMapper.map_to_openvino_devices()
    input_type = NodeDescription(
        size=NodeDescription.Size.ALL,
        detections=["person"])
    output_type = NodeDescription(
        size=NodeDescription.Size.ALL,
        detections=["person"],
        attributes={safety_hat: with_safety_hat,
                    safety_vest: with_safety_vest},
        extra_data=["safety_hat_iou", "safety_hat_confidence",
                    "safety_vest_iou", "safety_vest_confidence"],
    )
    backend_loader = lambda capsule_files, device: BackendRpcProcess(
        Backend,
        model_xml=capsule_files["worker_safety_mobilenet_FP16.xml"],
        weights_bin=capsule_files["worker_safety_mobilenet_FP16.bin"],
        device_name=device
    )
    options = capsule_options