General Description
Currently, Python V2 APIs support only Python 3.9.
For the open classes described in this section, the same class instance is used in a single thread or process. Do not use the same class instance in different threads or processes.
The Python APIs of mxBase and mxStream are encapsulated based on pybind11. The main classes and modules are as follows:
- Tensor class: input/output structure for Python model inference and can be converted with NumPy data, host, and device.
- Image class: input/output structure of DVPP, which can be converted into tensors.
- Model class: used for model loading and inference.
- ImageProcessor class: image processing class, which opens APIs for image encoding, decoding, resizing, cropping, and pasting.
- VideoDecoder class: video decoding class, which opens video decoding APIs.
- VideoEncoder class: video encoding class, which opens video encoding APIs.
- PluginNode class: plugin node, which is used to store basic plugin information, such as the name and type.
- SequentialStream class: stream implementation class, which allows streams to be constructed by adding PluginNode.
- FunctionalStream class: stream implementation class, which allows streams to be constructed using functional image composition mode.
- DVPP module: decodes, reads, and resizes DVPP images, which will be discarded soon. You are advised to use the ImageProcessor class.
- Log module: prints logs of different levels.
- Post module: contains multiple model post-processing classes, such as ResNet-50 and YOLOv3.
Parent topic: API Reference (Python) V2