基本数据枚举类型
使用须知
备注
须知
本章节开放的类,请遵循同一个类实例在单一线程中使用的原则,请勿将同一个类实例在不同的线程中使用。
Python推理数据流程图
图1 推理数据流图

父主题: API参考(Python)
依赖列表说明
表1 依赖列表
| 依赖名称 | 用途 |
|---|---|
| Tensor | 与Numpy数据换转,Host/Device换转,Python模型推理的输入输出统一结构。 |
| Image | 是DVPP输入输出统一结构,能转换为Tensor。 |
| Model | 用于模型加载推理 |
| ImageProcessor | 图像处理类,主要开放图像编解码、缩放和抠贴图等接口。 |
| VideoDecoder | 视频解码类,主要开放视频解码接口。 |
| dvpp | 含DVPP图像解码读取和缩放功能,即将废弃,建议使用ImageProcessor类。 |
| log | 用于不同级别的日志打印。 |
| post | 包含多种模型后处理类(ResNet-50、YoloV3等)。 |
依赖使用方法如下:
from mindx.sdk import base
from mindx.sdk.base import Image, Model, ImageProcessor, Size, post
父主题: API参考(Python)
基本数据枚举类型
表1 数据格式枚举类型
| 数据类型 | 说明 |
|---|---|
| base.undefined | 未定义类型。 |
| base.int8 | int8类型。 |
| base.uint8 | uint8类型。 |
| base.int16 | int16类型。 |
| base.uint16 | uint16类型。 |
| base.int32 | int32类型。 |
| base.uint32 | uint32类型。 |
| base.int64 | int64类型。 |
| base.uint64 | uint64类型。 |
| base.float16 | float16类型。 |
| base.float32 | float32类型。 |
| base.double | double类型。 |
| base.bool | bool类型。 |
父主题: 通用枚举类型/数据类
ModelLoadType模型加载方式枚举类型
表1 模型加载方式
| 参数名 | 说明 |
|---|---|
| base.load_model_from_file | 从文件加载离线模型数据,由系统内部管理内存。 |
| base.load_model_from_mem | 从内存加载离线模型数据,由系统内部管理内存。 |
| base.load_model_from_file_with_mem | 从文件加载离线模型数据,由用户自行管理模型运行的内存。 |
| base.load_model_from_mem_with_mem | 从内存加载离线模型数据,由用户自行管理模型运行的内存。 |
父主题: 通用枚举类型/数据类
ModelType模型枚举类型
表1 模型类型
| 参数名 | 说明 |
|---|---|
| base.model_type_om | OM模型。 |
| base.model_type_mindir | MindIR模型(对于MindIR模型,仅支持静态Shape和动态Batch。)。 |
父主题: 通用枚举类型/数据类
在线提单