This module is used to represent inference results. Built-in supported types are ROOT, CLASSIFICATION, DETECTION and SEGMENTATION. Custom types can be integrated by deriving from InferResultImplBase and passing the shared pointer to the pimpl constructor; the CUSTOM_RESULT_* enum values are NOT accepted by the type-enum constructor below.
More...
#include <vart_inferresult.hpp>
This module is used to represent inference results. Built-in supported types are ROOT, CLASSIFICATION, DETECTION and SEGMENTATION. Custom types can be integrated by deriving from InferResultImplBase and passing the shared pointer to the pimpl constructor; the CUSTOM_RESULT_* enum values are NOT accepted by the type-enum constructor below.
- See also
- InferResultImplBase
◆ InferResult() [1/3]
| vart::InferResult::InferResult |
( |
| ) |
|
|
delete |
◆ InferResult() [2/3]
InferResult() - Constructor for using supported infer result type implementations.
- Parameters
-
| [in] | infer_res_type | Enum class to specify which implementation to instantiate. Accepted values are ROOT, CLASSIFICATION, DETECTION, SEGMENTATION. See InferResultType for all supported types. |
- Exceptions
-
| std::invalid_argument | If infer_res_type is CUSTOM_RESULT_1, CUSTOM_RESULT_2 or CUSTOM_RESULT_3 — those must be supplied via the pimpl constructor below, not this factory. |
◆ InferResult() [3/3]
InferResult() - Constructor for using user defined implementation.
- Parameters
-
| [in] | ptr | Pointer 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. |
◆ add_child()
| void vart::InferResult::add_child |
( |
std::shared_ptr< InferResult > |
child | ) |
|
add_child() - Add a child to this infer result node.
- Parameters
-
| [in] | child | Child node to be added |
User can use this method to build cascade infer result tree by adding child nodes to the previous inference level starting with a dummy root node.
◆ add_children()
| void vart::InferResult::add_children |
( |
std::vector< std::shared_ptr< InferResult >> |
arg_children | ) |
|
add_children() - Add all children at once.
- Parameters
-
| [in] | arg_children | Child nodes to install. The internal children vector is overwritten with this list (it does NOT append). Use add_child() repeatedly if you want to grow the list instead. |
Each entry has its parent updated to this node.
◆ get_children()
| std::vector<std::shared_ptr<InferResult> > vart::InferResult::get_children |
( |
| ) |
|
get_children() - Returns all children of the node.
- Returns
- vector of child nodes.
◆ get_depth()
| size_t vart::InferResult::get_depth |
( |
| ) |
|
get_depth() - Returns depth of the current node
- Returns
- Depth of the current node.
◆ get_infer_result()
get_infer_result() - Get the inference result data held by this node.
- Returns
- Inference result object for the requested frame.
◆ get_parent()
| std::shared_ptr<InferResult> vart::InferResult::get_parent |
( |
| ) |
|
get_parent() - Returns parent of the given inference result node.
- Returns
- Parent result node.
◆ get_pimpl_handle()
get_pimpl_handle() - Gives pointer to implementation class.
- Returns
- Returns a constant reference of pointer to implementation class.
◆ get_root()
| std::shared_ptr<InferResult> vart::InferResult::get_root |
( |
| ) |
|
get_root() - Returns root of the given inference result node.
- Returns
- Root result node.
◆ transform()
transform() - Transforms the infer results to the input frame resolution.
- Parameters
-
| [in] | info | Resolution information to be used for transformation (see InferResScaleInfo). |
Typically, in video pipelines, the original input resolution differs from the resolution of the input to the machine learning model. If we have inference results, like detection from may be 200x200 resolution (input resolution to ML model) and if we want to transform the bounding box results to the original input resolution, which may be 1920x1080. In such cases, one can use this function to transform the bounding box dimensions in the infer results to the resolution of input image.
◆ traverse()
| void vart::InferResult::traverse |
( |
const std::function< void(std::shared_ptr< InferResult >, void *)> & |
callback, |
|
|
TraversalOrder |
order, |
|
|
void * |
user_data |
|
) |
| |
traverse() - Traverse through the tree nodes in a given order.
- Parameters
-
| [in] | callback | User callback function to be called for each node as per the order chosen. |
| [in] | order | Order in which the tree nodes to be traversed:
PREORDER: visit each node once before recursing into children.
POSTORDER: visit each node once after recursing into children.
INORDER: visit the current node once per child edge while recursing. For n-ary trees this means a node with k children is visited k times (and a leaf 0 times); this is NOT the classical binary-tree in-order traversal.
|
| [in] | user_data | User data to be passed to the callback function. |
The documentation for this class was generated from the following file: