|
VART-X
0.3.0
|
Interface class for post-processing inference results. More...
#include <vart_postprocess.hpp>
Public Member Functions | |
| PostProcess ()=delete | |
| PostProcess (PostProcessType postprocess_type, std::string &json_data, std::shared_ptr< Device > device) | |
| PostProcess() - Constructor for using existing post-process implementations. More... | |
| PostProcess (std::shared_ptr< PostProcessImplBase > ptr) | |
| PostProcess() - Constructor for using user defined implementation (Legacy) More... | |
| ~PostProcess () | |
| const std::shared_ptr< PostProcessImplBase > & | get_pimpl_handle () const |
| get_pimpl_handle() - Gives pointer to implementation class. More... | |
| void | set_config (std::vector< TensorInfo > &info, uint32_t batch_size) |
| set_config() - Set PostProcessInfo config data before start doing the post-process. More... | |
| std::vector< std::vector< std::shared_ptr< InferResult > > > | process (std::vector< int8_t * > data, uint32_t current_batch_size) |
| process() - Process/parse tensors data from ML network output to create infer results. More... | |
| std::vector< std::vector< std::shared_ptr< InferResult > > > | process (std::vector< std::vector< std::shared_ptr< vart::Memory >>> tensor_memory, uint32_t current_batch_size) |
| process() - Process/parse tensors data from ML network output to create infer results. More... | |
Interface class for post-processing inference results.
This module performs additional computations on output tensor data from NPU to generate more meaningful interpretation.
The framework supports two modes of operation:
PostProcessImplBase.PostProcessFunctionBase.Users can integrate custom post-processing algorithms by inheriting from vart::PostProcessFunctionBase and selecting them through the modular PostProcessType dispatch performed inside the constructor (no external registration step is required at the public API level).
Please check API documentation on usage and additional information.
|
delete |
| vart::PostProcess::PostProcess | ( | PostProcessType | postprocess_type, |
| std::string & | json_data, | ||
| std::shared_ptr< Device > | device | ||
| ) |
PostProcess() - Constructor for using existing post-process implementations.
| [in] | postprocess_type |
| [in] | json_data | JSON config string based on the implementation class |
| [in] | device | Device handle. Required by legacy backends as described above. May be null only when the selected postprocess_type does not need a device. See vart::Device for more details. |
| vart::PostProcess::PostProcess | ( | std::shared_ptr< PostProcessImplBase > | ptr | ) |
PostProcess() - Constructor for using user defined implementation (Legacy)
| [in] | ptr | Pointer to user's implementation instance |
| vart::PostProcess::~PostProcess | ( | ) |
~PostProcess() - Destructor
| const std::shared_ptr<PostProcessImplBase>& vart::PostProcess::get_pimpl_handle | ( | ) | const |
get_pimpl_handle() - Gives pointer to implementation class.
RESNET50, YOLOV2, SSDRESNET34). For every modular PostProcessType value the returned pointer is empty (nullptr). | std::vector<std::vector<std::shared_ptr<InferResult> > > vart::PostProcess::process | ( | std::vector< int8_t * > | data, |
| uint32_t | current_batch_size | ||
| ) |
process() - Process/parse tensors data from ML network output to create infer results.
| [in] | data | Vector of tensors data. Each tensor will have the data for the entire batch of images. |
| [in] | current_batch_size | Number of inputs in the current batch. |
shared_ptr was injected via the pimpl constructor), this call silently returns an empty vector rather than throwing. data must point to a buffer large enough for the configured model, and data.size() must be at least current_batch_size (legacy paths) or current_batch_size * num_output_tensors (modular paths). | std::vector<std::vector<std::shared_ptr<InferResult> > > vart::PostProcess::process | ( | std::vector< std::vector< std::shared_ptr< vart::Memory >>> | tensor_memory, |
| uint32_t | current_batch_size | ||
| ) |
process() - Process/parse tensors data from ML network output to create infer results.
| [in] | tensor_memory | Outer vector indexed by batch element, inner vector listing the output tensor buffers for that element. Must be non-empty, must contain at least current_batch_size rows, and every inner row must have the same length as tensor_memory[0] — the implementation indexes tensor_memory[0] for layout and does not re-validate per row. |
| [in] | current_batch_size | Number of inputs in the current batch. |
Memory to be backed by MemoryImplVvas; modular backends call map() / unmap() on the public interface and emit a printPostProcessResult() log after execution. | void vart::PostProcess::set_config | ( | std::vector< TensorInfo > & | info, |
| uint32_t | batch_size | ||
| ) |
set_config() - Set PostProcessInfo config data before start doing the post-process.
| [in] | info | TensorInfo to be set. |
| [in] | batch_size | Supported batch size. |
Use this method to set batch size per tensor and tensor information required to parse/process the ML network output. Call this method before the first call to "process" method.