hailo_platform.pyhailort.pyhailort class hailo_platform.pyhailort.pyhailort.HailoRTException[source] Bases: Exception class hailo_platform.pyhailort.pyhailort.UdpRecvError[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.InvalidProtocolVersionException[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HailoRTFirmwareControlFailedException[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HailoRTInvalidFrameException[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HailoRTUnsupportedOpcodeException[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HailoRTTimeout[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HailoRTStreamAborted[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HailoRTStreamAbortedByUser[source] Bases: hailo_platform.pyhailort.pyhailort.HailoRTException class hailo_platform.pyhailort.pyhailort.HEF(hef_source)[source] Bases: object Python representation of the Hailo Executable Format, which contains one or more compiled models. __init__(hef_source)[source] Constructor for the HEF class. Parameters hef_source (str or bytes) – The source from which the HEF object will be created. If the source type is str, it is treated as a path to an hef file. If the source type is bytes, it is treated as a buffer. Any other type will raise a ValueError. get_networks_names(network_group_name=None)[source] Gets the names of all networks in a specific network group. Parameters network_group_name (str, optional) – The name of the network group to access. If not given, first network_group is addressed. Returns The names of the networks. Return type list of str property path HEF file path. get_network_group_names()[source] Get the names of the network groups in this HEF. get_network_groups_infos()[source] Get information about the network groups in this HEF. get_input_vstream_infos(name=None)[source] Get input vstreams information. Parameters name (str, optional) – The name of the network or network_group to access. In case network_group name is given, Address all networks of the given network_group. In case not given, first network_group is addressed. Returns with all the information objects of all input vstreams. Return type list of hailo_platform.pyhailort._pyhailort.VStreamInfo get_output_vstream_infos(name=None)[source] Get output vstreams information. Parameters name (str, optional) – The name of the network or network_group to access. In case network_group name is given, Address all networks of the given network_group. In case not given, first network_group is addressed. Returns with all the information objects of all output vstreams Return type list of hailo_platform.pyhailort._pyhailort.VStreamInfo get_all_vstream_infos(name=None)[source] Get input and output vstreams information. Parameters name (str, optional) – The name of the network or network_group to access. In case network_group name is given, Address all networks of the given network_group. In case not given, first network_group is addressed. Returns with all the information objects of all input and output vstreams Return type list of hailo_platform.pyhailort._pyhailort.VStreamInfo get_input_stream_infos(name=None)[source] Get the input low-level streams information. Parameters name (str, optional) – The name of the network or network_group to access. In case network_group name is given, Address all networks of the given network_group. In case not given, first network_group is addressed. Returns with information objects of all input low-level streams. Return type List of hailo_platform.pyhailort._pyhailort.StreamInfo get_output_stream_infos(name=None)[source] Get the output low-level streams information of a specific network group. Parameters name (str, optional) – The name of the network or network_group to access. In case network_group name is given, Address all networks of the given network_group. In case not given, first network_group is addressed. Returns with information objects of all output low-level streams. Return type List of hailo_platform.pyhailort._pyhailort.StreamInfo get_all_stream_infos(name=None)[source] Get input and output streams information of a specific network group. Parameters name (str, optional) – The name of the network or network_group to access. In case network_group name is given, Address all networks of the given network_group. In case not given, first network_group is addressed. Returns with all the information objects of all input and output streams Return type list of hailo_platform.pyhailort._pyhailort.StreamInfo get_sorted_output_names(network_group_name=None)[source] Get the names of the outputs in a network group. The order of names is determined by the SDK. If the network group is not given, the first one is used. get_vstream_name_from_original_name(original_name, network_group_name=None)[source] Get vstream name from original layer name for a specific network group. Parameters original_name (str) – The original layer name. network_group_name (str, optional) – The name of the network group to access. If not given, first network_group is addressed. Returns the matching vstream name for the provided original name. Return type str get_original_names_from_vstream_name(vstream_name, network_group_name=None)[source] Get original names list from vstream name for a specific network group. Parameters vstream_name (str) – The stream name. network_group_name (str, optional) – The name of the network group to access. If not given, first network_group is addressed. Returns all the matching original layers names for the provided vstream name. Return type list of str get_vstream_names_from_stream_name(stream_name, network_group_name=None)[source] Get vstream names list from their underlying stream name for a specific network group. Parameters stream_name (str) – The underlying stream name. network_group_name (str, optional) – The name of the network group to access. If not given, first network_group is addressed. Returns All the matching vstream names for the provided stream name. Return type list of str get_stream_names_from_vstream_name(vstream_name, network_group_name=None)[source] Get stream name from vstream name for a specific network group. Parameters vstream_name (str) – The name of the vstreams. network_group_name (str, optional) – The name of the network group to access. If not given, first network_group is addressed. Returns All the underlying streams names for the provided vstream name. Return type list of str class hailo_platform.pyhailort.pyhailort.PcieDeviceInfo(bus, device, func, domain=None)[source] Bases: hailo_platform.pyhailort._pyhailort.PcieDeviceInfo Represents pcie device info, includeing domain, bus, device and function. BOARD_LOCATION_HELP_STRING = 'Board location in the format of the command: "lspci -d 1e60: | cut -d\' \' -f1" ([]::.). If not specified the first board is taken.' __init__(self: hailo_platform.pyhailort._pyhailort.PcieDeviceInfo) → None[source] classmethod from_string(board_location_str)[source] Parse pcie device info BDF from string. The format is []::. classmethod argument_type(board_location_str)[source] PcieDeviceInfo Argument type for argparse parsers class hailo_platform.pyhailort.pyhailort.ConfiguredNetwork(configured_network)[source] Bases: object Represents a network group loaded to the device. __init__(configured_network)[source] get_networks_names()[source] activate(network_group_params=None)[source] Activate this network group in order to infer data through it. Parameters network_group_params (hailo_platform.pyhailort._pyhailort.ActivateNetworkGroupParams, optional) – Network group activation params. If not given, default params will be applied, Returns Context manager that returns the activated network group. Return type ActivatedNetworkContextManager Note Usage of activate when scheduler enabled is deprecated. On this case, this function will return None and print deprecation warning. wait_for_activation(timeout_ms=None)[source] Block until activated, or until timeout_ms is passed. Parameters timeout_ms (int, optional) – Timeout value in milliseconds to wait for activation. Defaults to HAILO_INFINITE. Raises HailoRTTimeout – In case of timeout. static create_params()[source] Create activation params for network_group. Returns hailo_platform.pyhailort._pyhailort.ActivateNetworkGroupParams. property name get_output_shapes()[source] get_sorted_output_names()[source] get_input_vstream_infos(network_name=None)[source] Get input vstreams information. Parameters network_name (str, optional) – The name of the network to access. In case not given, all the networks in the network group will be addressed. Returns with all the information objects of all input vstreams Return type list of hailo_platform.pyhailort._pyhailort.VStreamInfo get_output_vstream_infos(network_name=None)[source] Get output vstreams information. Parameters network_name (str, optional) – The name of the network to access. In case not given, all the networks in the network group will be addressed. Returns with all the information objects of all output vstreams Return type list of hailo_platform.pyhailort._pyhailort.VStreamInfo get_all_vstream_infos(network_name=None)[source] Get input and output vstreams information. Parameters network_name (str, optional) – The name of the network to access. In case not given, all the networks in the network group will be addressed. Returns with all the information objects of all input and output vstreams Return type list of hailo_platform.pyhailort._pyhailort.VStreamInfo get_input_stream_infos(network_name=None)[source] Get the input low-level streams information of a specific network group. Parameters network_name (str, optional) – The name of the network to access. In case not given, all the networks in the network group will be addressed. Returns with information objects of all input low-level streams. Return type List of hailo_platform.pyhailort._pyhailort.StreamInfo get_output_stream_infos(network_name=None)[source] Get the output low-level streams information of a specific network group. Parameters network_name (str, optional) – The name of the network to access. In case not given, all the networks in the network group will be addressed. Returns with information objects of all output low-level streams. Return type List of hailo_platform.pyhailort._pyhailort.StreamInfo get_all_stream_infos(network_name=None)[source] Get input and output streams information of a specific network group. Parameters network_name (str, optional) – The name of the network to access. In case not given, all the networks in the network group will be addressed. Returns with all the information objects of all input and output streams Return type list of hailo_platform.pyhailort._pyhailort.StreamInfo get_udp_rates_dict(fps, max_supported_rate_bytes)[source] get_stream_names_from_vstream_name(vstream_name)[source] Get stream name from vstream name for a specific network group. Parameters vstream_name (str) – The name of the vstreams. Returns All the underlying streams names for the provided vstream name. Return type list of str get_vstream_names_from_stream_name(stream_name)[source] Get vstream names list from their underlying stream name for a specific network group. Parameters stream_name (str) – The underlying stream name. Returns All the matching vstream names for the provided stream name. Return type list of str set_scheduler_timeout(timeout_ms, network_name=None)[source] Sets the maximum time period that may pass before receiving run time from the scheduler. This will occur providing at least one send request has been sent, there is no minimum requirement for send requests, (e.g. threshold - see ConfiguredNetwork.set_scheduler_threshold()). Parameters timeout_ms (int) – Timeout in milliseconds. set_scheduler_threshold(threshold)[source] Sets the minimum number of send requests required before the network is considered ready to get run time from the scheduler. If at least one send request has been sent, but the threshold is not reached within a set time period (e.g. timeout - see ConfiguredNetwork.set_scheduler_timeout()), the scheduler will consider the network ready regardless. Parameters threshold (int) – Threshold in number of frames. set_scheduler_priority(priority)[source] Sets the priority of the network. When the model scheduler will choose the next network, networks with higher priority will be prioritized in the selection. bigger number represent higher priority. Parameters priority (int) – Priority as a number between HAILO_SCHEDULER_PRIORITY_MIN - HAILO_SCHEDULER_PRIORITY_MAX. init_cache(read_offset)[source] update_cache_offset(offset_delta_entries)[source] get_cache_ids() → List[int][source] read_cache_buffer(cache_id: int) → bytes[source] write_cache_buffer(cache_id: int, buffer: bytes)[source] class hailo_platform.pyhailort.pyhailort.ActivatedNetworkContextManager(configured_network, activated_network)[source] Bases: object A context manager that returns the activated network group upon enter. __init__(configured_network, activated_network)[source] class hailo_platform.pyhailort.pyhailort.ActivatedNetwork(configured_network, activated_network)[source] Bases: object The network group that is currently activated for inference. __init__(configured_network, activated_network)[source] get_number_of_invalid_frames(clear=True)[source] Returns number of invalid frames. Parameters clear (bool) – If set, the returned value will be the number of invalid frames read since the last call to this function. Returns Number of invalid frames. Return type int validate_all_frames_are_valid()[source] Validates that all of the frames so far are valid (no invalid frames). class hailo_platform.pyhailort.pyhailort.FormatType Bases: pybind11_builtins.pybind11_object Data formats accepted by HailoRT. Members: AUTO : Chosen automatically to match the format expected by the device, usually UINT8. UINT8 UINT16 FLOAT32 AUTO = FLOAT32 = UINT16 = UINT8 = __init__(self: hailo_platform.pyhailort._pyhailort.FormatType, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.PowerMeasurementData Bases: pybind11_builtins.pybind11_object __init__(*args, **kwargs) property average_time_value_milliseconds float, Average time in milliseconds between sampels property average_value float, The average value of the samples that were sampled equals(self: hailo_platform.pyhailort._pyhailort.PowerMeasurementData, arg0: hailo_platform.pyhailort._pyhailort.PowerMeasurementData) → bool property max_value float, The maximun value of the samples that were sampled property min_value float, The minimum value of the samples that were sampled property total_number_of_samples uint, The number of samples that were sampled class hailo_platform.pyhailort.pyhailort.MeasurementBufferIndex Bases: pybind11_builtins.pybind11_object Enum-like class representing all FW buffers for power measurements storing. Members: MEASUREMENT_BUFFER_INDEX_0 MEASUREMENT_BUFFER_INDEX_1 MEASUREMENT_BUFFER_INDEX_2 MEASUREMENT_BUFFER_INDEX_3 MEASUREMENT_BUFFER_INDEX_0 = MEASUREMENT_BUFFER_INDEX_1 = MEASUREMENT_BUFFER_INDEX_2 = MEASUREMENT_BUFFER_INDEX_3 = __init__(self: hailo_platform.pyhailort._pyhailort.MeasurementBufferIndex, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.PowerMeasurementTypes Bases: pybind11_builtins.pybind11_object Enum-like class representing the different power measurement types. This determines what would be measured on the device. Members: AUTO : Choose the default value according to the supported features. SHUNT_VOLTAGE : Measure the shunt voltage. Unit is mV BUS_VOLTAGE : Measure the bus voltage. Unit is mV POWER : Measure the power. Unit is W CURRENT : Measure the current. Unit is mA AUTO = BUS_VOLTAGE = CURRENT = POWER = SHUNT_VOLTAGE = __init__(self: hailo_platform.pyhailort._pyhailort.PowerMeasurementTypes, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.DvmTypes Bases: pybind11_builtins.pybind11_object Enum-like class representing the different DVMs that can be measured. This determines the device that would be measured. Members: AUTO : Choose the default value according to the supported features. VDD_CORE : Perform measurements over the core. Exists only in Hailo-8 EVB. VDD_IO : Perform measurements over the IO. Exists only in Hailo-8 EVB. MIPI_AVDD : Perform measurements over the MIPI avdd. Exists only in Hailo-8 EVB. MIPI_AVDD_H : Perform measurements over the MIPI avdd_h. Exists only in Hailo-8 EVB. USB_AVDD_IO : Perform measurements over the IO. Exists only in Hailo-8 EVB. VDD_TOP : Perform measurements over the top. Exists only in Hailo-8 EVB. USB_AVDD_IO_HV : Perform measurements over the USB_AVDD_IO_HV. Exists only in Hailo-8 EVB. AVDD_H : Perform measurements over the AVDD_H. Exists only in Hailo-8 EVB. SDIO_VDD_IO : Perform measurements over the SDIO_VDDIO. Exists only in Hailo-8 EVB. OVERCURRENT_PROTECTION : Perform measurements over the OVERCURRENT_PROTECTION dvm. Exists only for Hailo-8 platforms supporting current monitoring (such as M.2 and mPCIe). AUTO = AVDD_H = MIPI_AVDD = MIPI_AVDD_H = OVERCURRENT_PROTECTION = SDIO_VDD_IO = USB_AVDD_IO = USB_AVDD_IO_HV = VDD_CORE = VDD_IO = VDD_TOP = __init__(self: hailo_platform.pyhailort._pyhailort.DvmTypes, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.SamplingPeriod Bases: pybind11_builtins.pybind11_object Enum-like class representing all bit options and related conversion times for each bit setting for Bus Voltage and Shunt Voltage. Members: PERIOD_140us : The sensor provides a new sampling every 140us. PERIOD_204us : The sensor provides a new sampling every 204us. PERIOD_332us : The sensor provides a new sampling every 332us. PERIOD_588us : The sensor provides a new sampling every 588us. PERIOD_1100us : The sensor provides a new sampling every 1100us. PERIOD_2116us : The sensor provides a new sampling every 2116us. PERIOD_4156us : The sensor provides a new sampling every 4156us. PERIOD_8244us : The sensor provides a new sampling every 8244us. PERIOD_1100us = PERIOD_140us = PERIOD_204us = PERIOD_2116us = PERIOD_332us = PERIOD_4156us = PERIOD_588us = PERIOD_8244us = __init__(self: hailo_platform.pyhailort._pyhailort.SamplingPeriod, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.AveragingFactor Bases: pybind11_builtins.pybind11_object Enum-like class representing all the AVG bit settings and related number of averages for each bit setting. Members: AVERAGE_1 : Each sample reflects a value of 1 sub-samples. AVERAGE_4 : Each sample reflects a value of 4 sub-samples. AVERAGE_16 : Each sample reflects a value of 16 sub-samples. AVERAGE_64 : Each sample reflects a value of 64 sub-samples. AVERAGE_128 : Each sample reflects a value of 128 sub-samples. AVERAGE_256 : Each sample reflects a value of 256 sub-samples. AVERAGE_512 : Each sample reflects a value of 512 sub-samples. AVERAGE_1024 : Each sample reflects a value of 1024 sub-samples. AVERAGE_1 = AVERAGE_1024 = AVERAGE_128 = AVERAGE_16 = AVERAGE_256 = AVERAGE_4 = AVERAGE_512 = AVERAGE_64 = __init__(self: hailo_platform.pyhailort._pyhailort.AveragingFactor, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.MipiDataTypeRx Bases: pybind11_builtins.pybind11_object Members: RGB_444 RGB_555 RGB_565 RGB_666 RGB_888 RAW_6 RAW_7 RAW_8 RAW_10 RAW_12 RAW_14 RAW_10 = RAW_12 = RAW_14 = RAW_6 = RAW_7 = RAW_8 = RGB_444 = RGB_555 = RGB_565 = RGB_666 = RGB_888 = __init__(self: hailo_platform.pyhailort._pyhailort.MipiDataTypeRx, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.MipiPixelsPerClock Bases: pybind11_builtins.pybind11_object Members: PIXELS_PER_CLOCK_1 PIXELS_PER_CLOCK_2 PIXELS_PER_CLOCK_4 PIXELS_PER_CLOCK_1 = PIXELS_PER_CLOCK_2 = PIXELS_PER_CLOCK_4 = __init__(self: hailo_platform.pyhailort._pyhailort.MipiPixelsPerClock, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.MipiClockSelection Bases: pybind11_builtins.pybind11_object Members: SELECTION_80_TO_100_MBPS SELECTION_100_TO_120_MBPS SELECTION_120_TO_160_MBPS SELECTION_160_TO_200_MBPS SELECTION_200_TO_240_MBPS SELECTION_240_TO_280_MBPS SELECTION_280_TO_320_MBPS SELECTION_320_TO_360_MBPS SELECTION_360_TO_400_MBPS SELECTION_400_TO_480_MBPS SELECTION_480_TO_560_MBPS SELECTION_560_TO_640_MBPS SELECTION_640_TO_720_MBPS SELECTION_720_TO_800_MBPS SELECTION_800_TO_880_MBPS SELECTION_880_TO_1040_MBPS SELECTION_1040_TO_1200_MBPS SELECTION_1200_TO_1350_MBPS SELECTION_1350_TO_1500_MBPS SELECTION_1500_TO_1750_MBPS SELECTION_1750_TO_2000_MBPS SELECTION_2000_TO_2250_MBPS SELECTION_2250_TO_2500_MBPS SELECTION_AUTOMATIC SELECTION_100_TO_120_MBPS = SELECTION_1040_TO_1200_MBPS = SELECTION_1200_TO_1350_MBPS = SELECTION_120_TO_160_MBPS = SELECTION_1350_TO_1500_MBPS = SELECTION_1500_TO_1750_MBPS = SELECTION_160_TO_200_MBPS = SELECTION_1750_TO_2000_MBPS = SELECTION_2000_TO_2250_MBPS = SELECTION_200_TO_240_MBPS = SELECTION_2250_TO_2500_MBPS = SELECTION_240_TO_280_MBPS = SELECTION_280_TO_320_MBPS = SELECTION_320_TO_360_MBPS = SELECTION_360_TO_400_MBPS = SELECTION_400_TO_480_MBPS = SELECTION_480_TO_560_MBPS = SELECTION_560_TO_640_MBPS = SELECTION_640_TO_720_MBPS = SELECTION_720_TO_800_MBPS = SELECTION_800_TO_880_MBPS = SELECTION_80_TO_100_MBPS = SELECTION_880_TO_1040_MBPS = SELECTION_AUTOMATIC = __init__(self: hailo_platform.pyhailort._pyhailort.MipiClockSelection, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.MipiIspImageInOrder Bases: pybind11_builtins.pybind11_object Members: B_FIRST GB_FIRST GR_FIRST R_FIRST B_FIRST = GB_FIRST = GR_FIRST = R_FIRST = __init__(self: hailo_platform.pyhailort._pyhailort.MipiIspImageInOrder, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.MipiIspImageOutDataType Bases: pybind11_builtins.pybind11_object Members: RGB_888 YUV_422 RGB_888 = YUV_422 = __init__(self: hailo_platform.pyhailort._pyhailort.MipiIspImageOutDataType, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.IspLightFrequency Bases: pybind11_builtins.pybind11_object Members: LIGHT_FREQ_60_HZ LIGHT_FREQ_50_HZ LIGHT_FREQ_50_HZ = LIGHT_FREQ_60_HZ = __init__(self: hailo_platform.pyhailort._pyhailort.IspLightFrequency, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.Endianness Bases: pybind11_builtins.pybind11_object Members: BIG_ENDIAN LITTLE_ENDIAN BIG_ENDIAN = LITTLE_ENDIAN = __init__(self: hailo_platform.pyhailort._pyhailort.Endianness, value: int) → None property name property value class hailo_platform.pyhailort.pyhailort.InputVStreamParams[source] Bases: object Parameters of an input virtual stream (host to device). static make(configured_network, quantized=None, format_type=None, timeout_ms=None, queue_size=None, network_name=None)[source] Create input virtual stream params from a configured network group. These params determine the format of the data that will be fed into the network group. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the params are created. quantized – Unused. format_type (FormatType) – The default format type of the data for all input virtual streams. The default is AUTO, which means the data is fed in the same format expected by the device (usually uint8). timeout_ms (int) – The default timeout in milliseconds for all input virtual streams. Defaults to DEFAULT_VSTREAM_TIMEOUT_MS. In case of timeout, HailoRTTimeout will be raised. queue_size (int) – The pipeline queue size. Defaults to DEFAULT_VSTREAM_QUEUE_SIZE. network_name (str) – Network name of the requested virtual stream params. If not passed, all the networks in the network group will be addressed. Returns The created virtual streams params. The keys are the vstreams names. The values are the params. Return type dict static make_from_network_group(configured_network, quantized=None, format_type=None, timeout_ms=None, queue_size=None, network_name=None)[source] Create input virtual stream params from a configured network group. These params determine the format of the data that will be fed into the network group. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the params are created. quantized – Unused. format_type (FormatType) – The default format type of the data for all input virtual streams. The default is AUTO, which means the data is fed in the same format expected by the device (usually uint8). timeout_ms (int) – The default timeout in milliseconds for all input virtual streams. Defaults to DEFAULT_VSTREAM_TIMEOUT_MS. In case of timeout, HailoRTTimeout will be raised. queue_size (int) – The pipeline queue size. Defaults to DEFAULT_VSTREAM_QUEUE_SIZE. network_name (str) – Network name of the requested virtual stream params. If not passed, all the networks in the network group will be addressed. Returns The created virtual streams params. The keys are the vstreams names. The values are the params. Return type dict class hailo_platform.pyhailort.pyhailort.OutputVStreamParams[source] Bases: object Parameters of an output virtual stream (device to host). static make(configured_network, quantized=None, format_type=None, timeout_ms=None, queue_size=None, network_name=None)[source] Create output virtual stream params from a configured network group. These params determine the format of the data that will be returned from the network group. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the params are created. quantized – Unused. format_type (FormatType) – The default format type of the data for all output virtual streams. The default is AUTO, which means the returned data is in the same format returned from the device (usually uint8). timeout_ms (int) – The default timeout in milliseconds for all output virtual streams. Defaults to DEFAULT_VSTREAM_TIMEOUT_MS. In case of timeout, HailoRTTimeout will be raised. queue_size (int) – The pipeline queue size. Defaults to DEFAULT_VSTREAM_QUEUE_SIZE. network_name (str) – Network name of the requested virtual stream params. If not passed, all the networks in the network group will be addressed. Returns The created virtual streams params. The keys are the vstreams names. The values are the params. Return type dict static make_from_network_group(configured_network, quantized=None, format_type=None, timeout_ms=None, queue_size=None, network_name=None)[source] Create output virtual stream params from a configured network group. These params determine the format of the data that will be returned from the network group. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the params are created. quantized – Unused. format_type (FormatType) – The default format type of the data for all output virtual streams. The default is AUTO, which means the returned data is in the same format returned from the device (usually uint8). timeout_ms (int) – The default timeout in milliseconds for all output virtual streams. Defaults to DEFAULT_VSTREAM_TIMEOUT_MS. In case of timeout, HailoRTTimeout will be raised. queue_size (int) – The pipeline queue size. Defaults to DEFAULT_VSTREAM_QUEUE_SIZE. network_name (str) – Network name of the requested virtual stream params. If not passed, all the networks in the network group will be addressed. Returns The created virtual streams params. The keys are the vstreams names. The values are the params. Return type dict static make_groups(configured_network, quantized=None, format_type=None, timeout_ms=None, queue_size=None)[source] Create output virtual stream params from a configured network group. These params determine the format of the data that will be returned from the network group. The params groups are splitted with respect to their underlying streams for multi process usges. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the params are created. quantized – Unused. format_type (FormatType) – The default format type of the data for all output virtual streams. The default is AUTO, which means the returned data is in the same format returned from the device (usually uint8). timeout_ms (int) – The default timeout in milliseconds for all output virtual streams. Defaults to DEFAULT_VSTREAM_TIMEOUT_MS. In case of timeout, HailoRTTimeout will be raised. queue_size (int) – The pipeline queue size. Defaults to DEFAULT_VSTREAM_QUEUE_SIZE. Returns Each element in the list represent a group of params, where the keys are the vstreams names, and the values are the params. The params groups are splitted with respect to their underlying streams for multi process usges. Return type list of dicts class hailo_platform.pyhailort.pyhailort.InputVStreams(configured_network, input_vstreams_params)[source] Bases: object Input vstreams pipelines that allows to send data, to be used as a context manager. __init__(configured_network, input_vstreams_params)[source] Constructor for the InputVStreams class. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the pipeline is created. input_vstreams_params (dict from str to InputVStreamParams) – Params for the input vstreams in the pipeline. get(name=None)[source] Return a single input vstream by its name. Parameters name (str) – The vstream name. If name=None and there is a single input vstream, that single (InputVStream) will be returned. Otherwise, if name=None and there are multiple input vstreams, an exception will be thrown. Returns The (InputVStream) that corresponds to the given name. Return type InputVStream clear()[source] Clears the vstreams’ pipeline buffers. class hailo_platform.pyhailort.pyhailort.OutputVStreams(configured_network, output_vstreams_params, tf_nms_format=False)[source] Bases: object Output virtual streams pipelines that allows to receive data, to be used as a context manager. __init__(configured_network, output_vstreams_params, tf_nms_format=False)[source] Constructor for the OutputVStreams class. Parameters configured_network (ConfiguredNetwork) – The configured network group for which the pipeline is created. output_vstreams_params (dict from str to OutputVStreamParams) – Params for the output vstreams in the pipeline. tf_nms_format (bool, optional) – indicates whether the returned nms outputs should be in Hailo format or TensorFlow format. Default is False (using Hailo format). Hailo format – list of numpy.ndarray. Each element represents th detections (bboxes) for the class, and its shape is [number_of_detections, BBOX_PARAMS] TensorFlow format – numpy.ndarray of shape [class_count, BBOX_PARAMS, detections_count] padded with empty bboxes. get(name=None)[source] Return a single output vstream by its name. Parameters name (str) – The vstream name. If name=None and there is a single output vstream, that single (OutputVStream) will be returned. Otherwise, if name=None and there are multiple output vstreams, an exception will be thrown. Returns The (OutputVStream) that corresponds to the given name. Return type OutputVStream clear()[source] Clears the vstreams’ pipeline buffers. class hailo_platform.pyhailort.pyhailort.InputVStream(send_object)[source] Bases: object Represents a single virtual stream in the host to device direction. __init__(send_object)[source] property shape property dtype property name property network_name send(input_data)[source] Send frames to inference. Parameters input_data (numpy.ndarray) – Data to run inference on. flush()[source] Blocks until there are no buffers in the input VStream pipeline. property info class hailo_platform.pyhailort.pyhailort.OutputVStream(configured_network, recv_object, name, tf_nms_format=False, net_group_name='')[source] Bases: object Represents a single output virtual stream in the device to host direction. __init__(configured_network, recv_object, name, tf_nms_format=False, net_group_name='')[source] property output_order property shape property dtype property name property network_name recv()[source] Receive frames after inference. Returns The output of the inference for a single frame. The returned tensor does not include the batch dimension. In case of nms output and tf_nms_format=False, returns list of numpy.ndarray. Return type numpy.ndarray property info set_nms_score_threshold(threshold)[source] Set NMS score threshold, used for filtering out candidates. Any box with score, measurement_type=)[source] Perform a single power measurement on an Hailo chip. It works with the default settings where the sensor returns a new value every 2.2 ms without averaging the values. Parameters dvm (DvmTypes) – Which DVM will be measured. Default (AUTO) will be different according to the board: Default (AUTO) for EVB is an approximation to the total power consumption of the chip in PCIe setups. It sums VDD_CORE, MIPI_AVDD and AVDD_H. Only POWER can measured with this option. Default (AUTO) for platforms supporting current monitoring (such as M.2 and mPCIe): OVERCURRENT_PROTECTION measurement_type – (PowerMeasurementTypes): The type of the measurement. Returns The measured power. For PowerMeasurementTypes: SHUNT_VOLTAGE: Unit is mV. BUS_VOLTAGE: Unit is mV. POWER: Unit is W. CURRENT: Unit is mA. Return type float Note This function can perform measurements for more than just power. For all supported measurement types, please look at PowerMeasurementTypes. start_power_measurement(averaging_factor=, sampling_period=)[source] Start performing a long power measurement. Parameters averaging_factor (AveragingFactor) – Number of samples per time period, sensor configuration value. sampling_period (SamplingPeriod) – Related conversion time, sensor configuration value. The sensor samples the power every sampling_period [ms] and averages every averaging_factor samples. The sensor provides a new value every: 2 * sampling_period * averaging_factor [ms]. The firmware wakes up every delay [ms] and checks the sensor. If there is a new` value to read from the sensor, the firmware reads it. Note that the average calculated by the firmware is “average of averages”, because it averages values that have already been averaged by the sensor. stop_power_measurement()[source] Stop performing a long power measurement. Deletes all saved results from the firmware. Calling the function eliminates the start function settings for the averaging the samples, and returns to the default values, so the sensor will return a new value every 2.2 ms without averaging values. set_power_measurement(buffer_index=, dvm=, measurement_type=)[source] Set parameters for long power measurement on an Hailo chip. Parameters buffer_index (MeasurementBufferIndex) – Index of the buffer on the firmware the data would be saved at. Default is MEASUREMENT_BUFFER_INDEX_0 dvm (DvmTypes) – Which DVM will be measured. Default (AUTO) will be different according to the board: Default (AUTO) for EVB is an approximation to the total power consumption of the chip in PCIe setups. It sums VDD_CORE, MIPI_AVDD and AVDD_H. Only POWER can measured with this option. Default (AUTO) for platforms supporting current monitoring (such as M.2 and mPCIe): OVERCURRENT_PROTECTION measurement_type – (PowerMeasurementTypes): The type of the measurement. Note This function can perform measurements for more than just power. For all supported measurement types view PowerMeasurementTypes get_power_measurement(buffer_index=, should_clear=True)[source] Read measured power from a long power measurement Parameters buffer_index (MeasurementBufferIndex) – Index of the buffer on the firmware the data would be saved at. Default is MEASUREMENT_BUFFER_INDEX_0 should_clear (bool) – Flag indicating if the results saved at the firmware will be deleted after reading. Returns Object containing measurement data For PowerMeasurementTypes: SHUNT_VOLTAGE: Unit is mV. BUS_VOLTAGE: Unit is mV. POWER: Unit is W. CURRENT: Unit is mA. Return type PowerMeasurementData Note This function can perform measurements for more than just power. For all supported measurement types view PowerMeasurementTypes. read_user_config()[source] Read the user configuration section as binary data. Returns User config as a binary buffer. Return type str write_user_config(configuration)[source] Write the user configuration. Parameters configuration (str) – A binary representation of a Hailo device configuration. read_board_config()[source] Read the board configuration section as binary data. Returns Board config as a binary buffer. Return type str write_board_config(configuration)[source] Write the static configuration. Parameters configuration (str) – A binary representation of a Hailo device configuration. identify()[source] Gets the Hailo chip identification. Returns BoardInformation core_identify()[source] Gets the Core Hailo chip identification. Returns CoreInformation set_fw_logger(level, interface_mask)[source] Configure logger level and interface of sending. Parameters level (FwLoggerLevel) – The minimum logger level. interface_mask (int) – Output interfaces (mix of FwLoggerInterface). set_throttling_state(should_activate)[source] Change throttling state of temperature protection and overcurrent protection components. In case that change throttling state of temperature protection didn’t succeed, the change throttling state of overcurrent protection is executed. Parameters should_activate (bool) – Should be true to enable or false to disable. get_throttling_state()[source] Get the current throttling state of temperature protection and overcurrent protection components. If any throttling is enabled, the function return true. Returns true if temperature or overcurrent protection throttling is enabled, false otherwise. Return type bool i2c_write(slave, register_address, data)[source] Write data to an I2C slave. Parameters slave (hailo_platform.pyhailort.i2c_slaves.I2CSlave) – I2C slave configuration. register_address (int) – The address of the register to which the data will be written. data (str) – The data that will be written. i2c_read(slave, register_address, data_length)[source] Read data from an I2C slave. Parameters slave (hailo_platform.pyhailort.i2c_slaves.I2CSlave) – I2C slave configuration. register_address (int) – The address of the register from which the data will be read. data_length (int) – The number of bytes to read. Returns Data read from the I2C slave. Return type str read_register(address)[source] Read the value of a register from a given address. Parameters address (int) – Address to read register from. Returns Value of the register Return type int set_bit(address, bit_index)[source] Set (turn on) a specific bit at a register from a given address. Parameters address (int) – Address of the register to modify. bit_index (int) – Index of the bit that would be set. reset_bit(address, bit_index)[source] Reset (turn off) a specific bit at a register from a given address. Parameters address (int) – Address of the register to modify. bit_index (int) – Index of the bit that would be reset. firmware_update(firmware_binary, should_reset=True)[source] Update firmware binary on the flash. Parameters firmware_binary (bytes) – firmware binary stream. should_reset (bool) – Should a reset be performed after the update (to load the new firmware) second_stage_update(second_stage_binary)[source] Update second stage binary on the flash Parameters second_stage_binary (bytes) – second stage binary stream. store_sensor_config(section_index, reset_data_size, sensor_type, config_file_path, config_height=0, config_width=0, config_fps=0, config_name=None)[source] Store sensor configuration to Hailo chip flash memory. Parameters section_index (int) – Flash section index to write to. [0-6] reset_data_size (int) – Size of reset configuration. sensor_type (SensorConfigTypes) – Sensor type. config_file_path (str) – Sensor configuration file path. config_height (int) – Configuration resolution height. config_width (int) – Configuration resolution width. config_fps (int) – Configuration FPS. config_name (str) – Sensor configuration name. store_isp_config(reset_config_size, isp_static_config_file_path, isp_runtime_config_file_path, config_height=0, config_width=0, config_fps=0, config_name=None)[source] Store sensor isp configuration to Hailo chip flash memory. Parameters reset_config_size (int) – Size of reset configuration. isp_static_config_file_path (str) – Sensor isp static configuration file path. isp_runtime_config_file_path (str) – Sensor isp runtime configuration file path. config_height (int) – Configuration resolution height. config_width (int) – Configuration resolution width. config_fps (int) – Configuration FPS. config_name (str) – Sensor configuration name. get_sensor_sections_info()[source] Get sensor sections info from Hailo chip flash memory. Returns Sensor sections info read from the chip flash memory. sensor_set_generic_i2c_slave(slave_address, register_address_size, bus_index, should_hold_bus, endianness)[source] Set a generic I2C slave for sensor usage. Parameters sequence (int) – Request/response sequence. slave_address (int) – The address of the I2C slave. register_address_size (int) – The size of the offset (in bytes). bus_index (int) – The number of the bus the I2C slave is behind. should_hold_bus (bool) – Hold the bus during the read. endianness (Endianness) – Big or little endian. set_sensor_i2c_bus_index(sensor_type, i2c_bus_index)[source] Set the I2C bus to which the sensor of the specified type is connected. Parameters sensor_type (SensorConfigTypes) – The sensor type. i2c_bus_index (int) – The I2C bus index of the sensor. load_and_start_sensor(section_index)[source] Load the configuration with I2C in the section index. Parameters section_index (int) – Flash section index to load config from. [0-6] reset_sensor(section_index)[source] Reset the sensor that is related to the section index config. Parameters section_index (int) – Flash section index to reset. [0-6] wd_enable(cpu_id)[source] Enable firmware watchdog. Parameters cpu_id (HailoCpuId) – 0 for App CPU, 1 for Core CPU. wd_disable(cpu_id)[source] Disable firmware watchdog. Parameters cpu_id (HailoCpuId) – 0 for App CPU, 1 for Core CPU. wd_config(cpu_id, wd_cycles, wd_mode)[source] Configure a firmware watchdog. Parameters cpu_id (HailoCpuId) – 0 for App CPU, 1 for Core CPU. wd_cycles (int) – number of cycles until watchdog is triggered. wd_mode (int) – 0 - HW/SW mode, 1 - HW only mode previous_system_state(cpu_id)[source] Read the FW previous system state. Parameters cpu_id (HailoCpuId) – 0 for App CPU, 1 for Core CPU. get_chip_temperature()[source] Returns the latest temperature measurements from the 2 internal temperature sensors of the Hailo chip. Returns Temperature in celsius of the 2 internal temperature sensors (TS), and a sample count (a running 16-bit counter) Return type TemperatureInfo get_extended_device_information()[source] Returns extended information about the device Returns Return type ExtendedDeviceInformation set_pause_frames(rx_pause_frames_enable)[source] Enable/Disable Pause frames. Parameters rx_pause_frames_enable (bool) – False for disable, True for enable. test_chip_memories()[source] test all chip memories using smart BIST set_notification_callback(callback_func, notification_id, opaque)[source] Set a callback function to be called when a notification is received. Parameters callback_func (function) – Callback function with the parameters (device, notification, opaque). Note that throwing exceptions is not supported and will cause the program to terminate with an error! notification_id (NotificationId) – Notification ID to register the callback to. opauqe (object) – User defined data. Note The notifications thread is started and closed in the use_device() context, so notifications can only be received there. remove_notification_callback(notification_id)[source] Remove a notification callback which was already set. Parameters notification_id (NotificationId) – Notification ID to remove the callback from. class hailo_platform.pyhailort.pyhailort.Device(device_id=None)[source] Bases: object Hailo device object representation (for inference use VDevice) classmethod scan()[source] Scans for all devices on the system. Returns list of str, device ids. __init__(device_id=None)[source] Create the Hailo device object. Parameters device_id (str) – Device id string, can represent several device types: [-] for pcie devices - pcie bdf (XXXX:XX:XX.X) [-] for ethernet devices - ip address (xxx.xxx.xxx.xxx) release()[source] Release the allocated resources of the device. This function should be called when working with the device not as context-manager. property device_id Getter for the device_id. Returns A string ID of the device. BDF for PCIe devices, IP address for Ethernet devices, “Integrated” for integrated nnc devices. Return type str property control Returns the control object of this device, which implements the control API of the Hailo device. Return type Control Attention Use the low level control API with care. read_log(count, cpu_id)[source] Returns Returns buffer with debug log data. Parameters count (int) – bytes count to read cpu_id (HailoCpuId) – cpu id property loaded_network_groups Getter for the property _loaded_network_groups. Returns List of the the configured network groups loaded on the device. Return type list of ConfiguredNetwork class hailo_platform.pyhailort.pyhailort.VDevice(params=None, *, device_ids=None)[source] Bases: object Hailo virtual device representation. __init__(params=None, *, device_ids=None)[source] Create the Hailo virtual device object. Parameters params (hailo_platform.pyhailort.pyhailort.VDeviceParams, optional) – VDevice params, call VDevice.create_params() to get default params. Excludes ‘device_ids’. device_ids (list of str, optional) – devices ids to create VDevice from, call Device.scan() to get list of all available devices. Excludes ‘params’. Cannot be used together with device_id. release()[source] Release the allocated resources of the device. This function should be called when working with the device not as context-manager. static create_params()[source] configure(hef, configure_params_by_name={})[source] Configures target vdevice from HEF object. Parameters hef (HEF) – HEF to configure the vdevice from configure_params_by_name (dict, optional) – Maps between each net_group_name to configure_params. If not provided, default params will be applied get_physical_devices()[source] Gets the underlying physical devices. Returns The underlying physical devices. Return type list of Device get_physical_devices_ids()[source] Gets the physical devices ids. Returns The underlying physical devices infos. Return type list of str create_infer_model(hef_source, name='')[source] Creates the infer model from an hef. Parameters hef_source (str or bytes) – The source from which the HEF object will be created. If the source type is str, it is treated as a path to an hef file. If the source type is bytes, it is treated as a buffer. Any other type will raise a ValueError. name (str, optional) – The string of the model name. Returns The infer model object. Return type InferModel Raises HailoRTException – In case the infer model creation failed. Note create_infer_model must be called from the same process the VDevice is created in, otherwise an HailoRTException will be raised. Note as long as the InferModel object is alive, the VDevice object is alive as well. property loaded_network_groups Getter for the property _loaded_network_groups. Returns List of the the configured network groups loaded on the device. Return type list of ConfiguredNetwork class hailo_platform.pyhailort.pyhailort.InferModel(infer_model, hef_path)[source] Bases: object Contains all of the necessary information for configuring the network for inference. This class is used to set up the model for inference and includes methods for setting and getting the model’s parameters. By calling the configure function, the user can create a ConfiguredInferModel object, which is used to run inference. class InferStream(infer_stream)[source] Bases: object Represents the parameters of a stream. In default, the stream’s parameters are set to the default values of the model. The user can change the stream’s parameters by calling the setter functions. __init__(infer_stream)[source] property name Returns: name (str): the name of the edge. property shape Returns: shape (list[int]): the shape of the edge. property format Returns: format (_pyhailort.hailo_format_t): the format of the edge. set_format_type(type)[source] Set the format type of the stream. Parameters type (_pyhailort.hailo_format_type_t) – the format type set_format_order(order)[source] Set the format order of the stream. Parameters order (_pyhailort.hailo_format_order_t) – the format order property quant_infos Returns: quant_infos (list[_pyhailort.hailo_quant_info_t]): List of the quantization information of the edge. property is_nms Returns: is_nms (bool): whether the stream is NMS. set_nms_score_threshold(threshold)[source] Set NMS score threshold, used for filtering out candidates. Any box with score