VART-X  0.3.0
vart::MetaConvert Class Reference

This module facilitates the conversion of Infer metadata into a format compatible with the overlay module. Metaconvert also accepts configuration parameters as JSON string, which provide further flexibility on configuring overlay information such as line thickness, font size, font type ., etc. Please check API documentation for more information. Additionally, if users have a custom meta data then they can integrate customized functions to convert them into a format suitable for processing by the overlay module by overriding base class. More...

#include <vart_metaconvert.hpp>

Public Member Functions

 MetaConvert ()=delete
 
 MetaConvert (InferResultType infer_res_type, std::string &json_data, std::shared_ptr< Device > device)
 MetaConvert() - Constructor for using existing metaconvert implementations. More...
 
 MetaConvert (std::shared_ptr< MetaConvertImplBase > ptr)
 MetaConvert() - Constructor for using user defined implementation. More...
 
const std::shared_ptr< MetaConvertImplBase > & get_pimpl_handle () const
 get_pimpl_handle() - Gives pointer to implementation class. More...
 
std::shared_ptr< OverlayShapeInfoprepare_overlay_meta (std::shared_ptr< InferResult > root_infer_res)
 prepare_overlay_meta() - Converts inference results to data structures needed for overlay Overlay More...
 

Detailed Description

This module facilitates the conversion of Infer metadata into a format compatible with the overlay module. Metaconvert also accepts configuration parameters as JSON string, which provide further flexibility on configuring overlay information such as line thickness, font size, font type ., etc. Please check API documentation for more information. Additionally, if users have a custom meta data then they can integrate customized functions to convert them into a format suitable for processing by the overlay module by overriding base class.

See also
MetaConvertImplBase

Constructor & Destructor Documentation

◆ MetaConvert() [1/3]

vart::MetaConvert::MetaConvert ( )
delete

◆ MetaConvert() [2/3]

vart::MetaConvert::MetaConvert ( InferResultType  infer_res_type,
std::string &  json_data,
std::shared_ptr< Device device 
)

MetaConvert() - Constructor for using existing metaconvert implementations.

Parameters
[in]infer_res_typeEnum class to specify which implementation to instantiate. The dispatcher currently accepts CLASSIFICATION, DETECTION and SEGMENTATION. Any other value throws std::invalid_argument.
[in]json_dataJSON config string based on the implementation class
[in]deviceDevice handle. Must be non-null. See vart::Device for more details.

◆ MetaConvert() [3/3]

vart::MetaConvert::MetaConvert ( std::shared_ptr< MetaConvertImplBase ptr)

MetaConvert() - Constructor for using user defined implementation.

Parameters
[in]ptrPointer to user's implementation instance. Must be non-null; the constructor stores it as the pimpl and subsequent method calls dereference it without an additional null check.

Member Function Documentation

◆ get_pimpl_handle()

const std::shared_ptr<MetaConvertImplBase>& vart::MetaConvert::get_pimpl_handle ( ) const

get_pimpl_handle() - Gives pointer to implementation class.

Returns
Returns a constant reference of pointer to implementation class.

◆ prepare_overlay_meta()

std::shared_ptr<OverlayShapeInfo> vart::MetaConvert::prepare_overlay_meta ( std::shared_ptr< InferResult root_infer_res)

prepare_overlay_meta() - Converts inference results to data structures needed for overlay Overlay

Parameters
[in]root_infer_resRoot node of the inference-result tree to be interpreted and converted. Must be non-null; the implementation does not null-check the shared pointer before traversing its children, so a null or empty handle is undefined behavior.
Returns
Shared pointer to an OverlayShapeInfo describing the conversion result. The returned object carries a custom deleter that free()s each text param's disp_text before releasing the heap-allocated struct; lifetime is tied to the shared ownership.

The documentation for this class was generated from the following file: