The preprocessing module handles data preparation tasks such as normalization, scaling, and video format conversion. This module supports software-based pre-processing as well as hardware-accelerated pre-processing for optimized performance. It ensures that input data is appropriately formatted for inference. Applications can also supply a custom pre-processing implementation via the PreProcessImplBase constructor.
More...
#include <vart_preprocess.hpp>
The preprocessing module handles data preparation tasks such as normalization, scaling, and video format conversion. This module supports software-based pre-processing as well as hardware-accelerated pre-processing for optimized performance. It ensures that input data is appropriately formatted for inference. Applications can also supply a custom pre-processing implementation via the PreProcessImplBase constructor.
- See also
- PreProcessImplBase
◆ PreProcess() [1/3]
| vart::PreProcess::PreProcess |
( |
| ) |
|
|
delete |
◆ PreProcess() [2/3]
PreProcess() - Constructor with implementation type and json data.
- Parameters
-
| [in] | type | PreProcessImplType based on which implementation need to be used. |
- See also
- PreProcessImplType for currently supported implementations.
- Parameters
-
| [in] | json_data | JSON-formatted configuration or additional user data passed to the implementation. |
| [in] | device | Device handle, must be non-null. See vart::Device for more details. |
◆ PreProcess() [3/3]
PreProcess() - Constructor for using user defined implementation.
- Parameters
-
| [in] | ptr | Pointer to user's implementation instance |
◆ ~PreProcess()
| vart::PreProcess::~PreProcess |
( |
| ) |
|
|
default |
◆ get_input_vinfo()
| void vart::PreProcess::get_input_vinfo |
( |
int32_t |
height, |
|
|
int32_t |
width, |
|
|
VideoFormat |
fmt, |
|
|
VideoInfo & |
vinfo |
|
) |
| |
get_input_vinfo() - Fills the input video info from input params.
- Parameters
-
| [in] | height | Height of the input frame. |
| [in] | width | Width of the input frame. |
| [in] | fmt | Video format of the input frame. |
| [out] | vinfo | VideoInfo to be filled by this API. The filled VideoInfo can be used to construct the input VideoFrame. User must provide a valid reference. |
- Note
- Throws
std::runtime_error if:
height or width is outside the supported range.
fmt is not a supported input colour format.
◆ get_output_vinfo()
| const VideoInfo& vart::PreProcess::get_output_vinfo |
( |
| ) |
|
get_output_vinfo() - Get the output video info.
- Returns
- The output
VideoInfo describing the format and dimensions of the pre-processed output frame. Can be used to construct the output VideoFrame.
◆ get_pimpl_handle()
◆ get_preprocess_info()
◆ process()
| void vart::PreProcess::process |
( |
std::vector< PreProcessOp > & |
preprocess_ops | ) |
|
process() - Perform pre-processing based on the specified parameters.
- Parameters
-
| [in] | preprocess_ops | Vector of PreProcessOp to be performed. PreProcessOp contains input/output frame and their corresponding ROI. |
- Note
- Throws
std::runtime_error if:
◆ set_preprocess_info()
| void vart::PreProcess::set_preprocess_info |
( |
PreProcessInfo & |
preprocess_info | ) |
|
set_preprocess_info() - Set the required Preprocess parameters.
- Parameters
-
| [in] | preprocess_info | Structure with pre-processing parameters to validate and store. |
- Note
- Throws
std::runtime_error if any of the following constraints are violated:
height or width is outside the supported range.
colour_format is not a supported output colour format.
mean_r, mean_g, or mean_b is outside [0.0, 128.0].
scale_r, scale_g, or scale_b is outside [0.0, 1.0].
The documentation for this class was generated from the following file: