Class vart::PreProcess#
-
class PreProcess
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. Application can also incorporate custom pre processing by overriding base class methods.
Public Functions
-
PreProcess() = delete#
PreProcess() - Constructor with implementation type and json data.
- Parameters:
type – PreProcessImplType based on which implementaion need to be used.
json_data – Additional preprocessing/user related information in JSON Format which can be used by implementations.
device – Device handle to be used by implementations.
PreProcess() - Constructor for using user defined implementation.
- Parameters:
ptr – Pointer to user’s implementation instance
-
~PreProcess() = default#
-
void process(std::vector<PreProcessOp> &preprocess_ops)#
process() - Perform pre-processing based on the specified parameters.
- Parameters:
preprocess_ops – Vector of PreProcessOp to be performed. PreProcessOp contains input/output frame and their corresponding ROI.
-
void 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:
height – Height of the input frame.
width – Width of the input frame.
fmt – Video format of the input frame.
vinfo – VideoInfo which can be filled by API. Filled VideoInfo can be used to construct input videoframe. User must provide valid pointer.
-
const VideoInfo &get_output_vinfo()#
get_output_vinfo() - Get the output video info.
- Returns:
Returns VideoInfo which can be used to construct output video frame.
-
void set_preprocess_info(PreProcessInfo &preprocess_info)#
set_preprocess_info() - Set the required Preprocess parameters.
- Parameters:
preprocess_info – Struture with pre processing parameters.
-
const PreProcessInfo &get_preprocess_info()#
get_preprocess_info() - Get the preprocess info
- Returns:
Returns struture of pre processing parameters.
-
const std::shared_ptr<PreProcessImplBase> &get_pimpl_handle() const#
get_pimpl_handle() - Gives pointer to implementation class.
- Returns:
Returns a constant reference of pointer to implementation class.
Private Members
-
std::shared_ptr<PreProcessImplBase> pimpl#
-
PreProcess() = delete#