- 升级 ECharts 到 5.4.2,重构 lib/ 目录结构 - 新增 DataTables 2.x 和 FixedColumns 插件 - 新增 quant/ 宏观研究报告模块 - 重构图表页面:stock_trend、hkholdbycode 等采用 JS fetch API.doorcome.cn 模式 - 新增 CLAUDE.md 补充页面文档和新数据流说明 - 更新 inc/config.php TuShare API 配置 - 更新新闻联播分析模块 news/ 和相关研究报告 research/ - 新增 api_document/ 参考文档 - 清理 .gitignore,排除 uploads/xls/.mcp.json/ source maps 等非代码文件 - 所有 PHP 文件通过 php -l 语法检查 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
314 lines
9.5 KiB
Plaintext
314 lines
9.5 KiB
Plaintext
HailoRT Python API Reference
|
||
hailo_platform.pyhailort.hw_object
|
||
|
||
Hailo hardware API
|
||
|
||
class hailo_platform.pyhailort.hw_object.InferenceTargets[source]
|
||
|
||
Bases: object
|
||
|
||
Enum-like class with all inference targets supported by the HailoRT.
|
||
|
||
UNINITIALIZED = 'uninitialized'
|
||
|
||
UDP_CONTROLLER = 'udp'
|
||
|
||
PCIE_CONTROLLER = 'pcie'
|
||
|
||
exception hailo_platform.pyhailort.hw_object.HailoHWObjectException[source]
|
||
|
||
Bases: Exception
|
||
|
||
Raised in any error related to Hailo hardware.
|
||
|
||
class hailo_platform.pyhailort.hw_object.HailoHWObject[source]
|
||
|
||
Bases: object
|
||
|
||
Abstract Hailo hardware device representation (deprecated)
|
||
|
||
NAME = 'uninitialized'
|
||
|
||
IS_HARDWARE = True
|
||
|
||
__init__()[source]
|
||
|
||
Create the Hailo hardware object.
|
||
|
||
property name
|
||
|
||
The name of this target. Valid values are defined by InferenceTargets (deprecated)
|
||
|
||
Type
|
||
|
||
str
|
||
|
||
property is_hardware
|
||
|
||
Indicates this target runs on a physical hardware device. (deprecated)
|
||
|
||
Type
|
||
|
||
bool
|
||
|
||
property device_id
|
||
|
||
Getter for the device_id. :returns: A string ID of the device. BDF for PCIe devices, IP address for Ethernet devices, “Core” for core devices. :rtype: str
|
||
|
||
property sorted_output_layer_names
|
||
|
||
Getter for the property sorted_output_names (deprecated). :returns: Sorted list of the output layer names. :rtype: list of str
|
||
|
||
use_device(*args, **kwargs)[source]
|
||
|
||
A context manager that wraps the usage of the device. (deprecated)
|
||
|
||
get_output_device_layer_to_original_layer_map()[source]
|
||
|
||
Get a mapping between the device outputs to the layers’ names they represent (deprecated).
|
||
|
||
Returns
|
||
|
||
Keys are device output names and values are lists of layers’ names.
|
||
Return type
|
||
|
||
dict
|
||
|
||
get_original_layer_to_device_layer_map()[source]
|
||
|
||
Get a mapping between the layer names and the device outputs that contain them (deprecated).
|
||
|
||
Returns
|
||
|
||
Keys are the names of the layers and values are device outputs names.
|
||
Return type
|
||
|
||
dict
|
||
|
||
property device_input_layers
|
||
|
||
Get a list of the names of the device’s inputs. (deprecated)
|
||
|
||
property device_output_layers
|
||
|
||
Get a list of the names of the device’s outputs. (deprecated)
|
||
|
||
hef_loaded()[source]
|
||
|
||
Return True if this object has loaded the model HEF to the hardware device. (deprecated)
|
||
|
||
outputs_count()[source]
|
||
|
||
Return the amount of output tensors that are returned from the hardware device for every input image (deprecated).
|
||
|
||
property model_name
|
||
|
||
Get the name of the current model (deprecated).
|
||
|
||
Returns
|
||
|
||
Model name.
|
||
Return type
|
||
|
||
str
|
||
|
||
get_output_shapes()[source]
|
||
|
||
Get the model output shapes, as returned to the user (without any hardware padding) (deprecated).
|
||
|
||
Returns
|
||
|
||
Tuple of output shapes, sorted by the output names.
|
||
|
||
class hailo_platform.pyhailort.hw_object.HailoChipObject[source]
|
||
|
||
Bases: hailo_platform.pyhailort.hw_object.HailoHWObject
|
||
|
||
Hailo hardware device representation (deprecated)
|
||
|
||
__init__()[source]
|
||
|
||
Create the Hailo Chip hardware object.
|
||
|
||
property control
|
||
|
||
Returns the control object of this device, which implements the control API of the Hailo device. .. attention:: Use the low level control API with care.
|
||
|
||
Type
|
||
|
||
HailoControl
|
||
|
||
get_all_input_layers_dtype()[source]
|
||
|
||
Get the model inputs dtype (deprecated).
|
||
|
||
Returns
|
||
|
||
obj:’numpy.dtype’: where the key is model input_layer name, and the value is dtype as the device expect to get for this input.
|
||
Return type
|
||
|
||
dict of
|
||
|
||
get_input_vstream_infos(network_name=None)[source]
|
||
|
||
Get input vstreams information of a specific network group (deprecated).
|
||
|
||
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
|
||
|
||
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with all the information objects of all input vstreams
|
||
|
||
get_output_vstream_infos(network_name=None)[source]
|
||
|
||
Get output vstreams information of a specific network group (deprecated).
|
||
|
||
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
|
||
|
||
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with all the information objects of all output vstreams
|
||
|
||
get_all_vstream_infos(network_name=None)[source]
|
||
|
||
Get input and output vstreams information (deprecated).
|
||
|
||
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
|
||
|
||
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with all the information objects of all input and output vstreams
|
||
|
||
get_input_stream_infos(network_name=None)[source]
|
||
|
||
Get the input low-level streams information of a specific network group (deprecated).
|
||
|
||
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
|
||
|
||
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with information objects of all input low-level streams.
|
||
|
||
get_output_stream_infos(network_name=None)[source]
|
||
|
||
Get the output low-level streams information of a specific network group (deprecated).
|
||
|
||
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
|
||
|
||
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.VStreamInfo: with information objects of all output low-level streams.
|
||
|
||
get_all_stream_infos(network_name=None)[source]
|
||
|
||
Get input and output streams information of a specific network group (deprecated).
|
||
|
||
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
|
||
|
||
If there is exactly one configured network group, returns a list of hailo_platform.pyhailort._pyhailort.StreamInfo: with all the information objects of all input and output streams
|
||
|
||
property loaded_network_groups
|
||
|
||
Getter for the property _loaded_network_groups. :returns: List of the the configured network groups loaded on the device. :rtype: list of ConfiguredNetwork
|
||
|
||
get_input_shape(name=None)[source]
|
||
|
||
Get the input shape (not padded) of a network (deprecated).
|
||
|
||
Parameters
|
||
|
||
name (str, optional) – The name of the desired input. If a name is not provided, return the first input_dataflow shape.
|
||
Returns
|
||
|
||
Tuple of integers representing the input_shape.
|
||
|
||
get_index_from_name(name)[source]
|
||
|
||
Get the index in the output list from the name (deprecated).
|
||
|
||
Parameters
|
||
|
||
name (str) – The name of the output.
|
||
Returns
|
||
|
||
The index of the layer name in the output list.
|
||
Return type
|
||
|
||
int
|
||
|
||
release()[source]
|
||
|
||
Release the allocated resources of the device. This function should be called when working with the device not as context-manager. Note: After calling this function, the device will not be usable.
|
||
|
||
class hailo_platform.pyhailort.hw_object.EthernetDevice(remote_ip, remote_control_port=22401)[source]
|
||
|
||
Bases: hailo_platform.pyhailort.hw_object.HailoChipObject
|
||
|
||
Represents any Hailo hardware device that supports UDP control and dataflow (deprecated)
|
||
|
||
NAME = 'udp'
|
||
|
||
__init__(remote_ip, remote_control_port=22401)[source]
|
||
|
||
Create the Hailo UDP hardware object.
|
||
|
||
Parameters
|
||
|
||
remote_ip (str) – Device IP address.
|
||
|
||
remote_control_port (int, optional) – UDP port to which the device listens for control. Defaults to 22401.
|
||
|
||
static scan_devices(interface_name, timeout_seconds=3)[source]
|
||
|
||
Scans for all eth devices on a specific network interface.
|
||
|
||
Parameters
|
||
|
||
interface_name (str) – Interface to scan.
|
||
|
||
timeout_seconds (int, optional) – timeout for scan operation. Defaults to 3.
|
||
|
||
Returns
|
||
|
||
IPs of scanned devices.
|
||
Return type
|
||
|
||
list of str
|
||
|
||
property remote_ip
|
||
|
||
Return the IP of the remote device (deprecated).
|
||
|
||
class hailo_platform.pyhailort.hw_object.PcieDevice(device_info=None)[source]
|
||
|
||
Bases: hailo_platform.pyhailort.hw_object.HailoChipObject
|
||
|
||
Hailo PCIe production device representation (deprecated)
|
||
|
||
NAME = 'pcie'
|
||
|
||
__init__(device_info=None)[source]
|
||
|
||
Create the Hailo PCIe hardware object.
|
||
|
||
Parameters
|
||
|
||
device_info (hailo_platform.pyhailort.pyhailort.PcieDeviceInfo, optional) – Device info to create, call PcieDevice.scan_devices() to get list of all available devices.
|
||
|
||
static scan_devices()[source]
|
||
|
||
Scans for all pcie devices on the system (deprecated).
|
||
|
||
Returns
|
||
|
||
list of hailo_platform.pyhailort.pyhailort.PcieDeviceInfo
|
||
|