This class represents region of interest - object describing detection result (bounding box) and containing multiple Tensor objects (inference results) attached by multiple models. For example, it can be region of interest with detected face and recognized age and sex of a person. It can be produced by a pipeline with gvadetect with detection model and two gvaclassify elements with two classification models. Such RegionOfInterest will have bounding box coordinates filled and will have 3 Tensor objects attached - 1 Tensor object with detection result and 2 Tensor objects with classification results coming from 2 classifications.
More...
#include <region_of_interest.h>
|
Rect< uint32_t > | rect () const |
| Get bounding box of the RegionOfInterest as pixel coordinates in original image. More...
|
|
Rect< double > | normalized_rect () |
| Get bounding box of the RegionOfInterest as normalized coordinates in the range [0, 1]. More...
|
|
std::string | label () const |
| Get RegionOfInterest label. More...
|
|
double | confidence () const |
| Get RegionOfInterest detection confidence (set by gvadetect) More...
|
|
int32_t | object_id () const |
| Get unique id of the RegionOfInterest. The id typically created by gvatrack element. More...
|
|
std::vector< Tensor > | tensors () const |
| Get all Tensor instances added to this RegionOfInterest. More...
|
|
Tensor | add_tensor (const std::string &name) |
| Add new tensor (inference result) to this RegionOfInterest with name set. To add detection tensor, set name to "detection". More...
|
|
Tensor | detection () |
| Returns detection Tensor, last added to this RegionOfInterest. As any other Tensor, returned detection Tensor can contain arbitrary information. If you use RegionOfInterest based on GstVideoRegionOfInterestMeta attached by gvadetect by default, then this Tensor will contain "label_id", "confidence", "x_min", "x_max", "y_min", "y_max" fields. If RegionOfInterest doesn't have detection Tensor, it will be created in-place. More...
|
|
int | label_id () const |
| Get label_id from detection Tensor, last added to this RegionOfInterest. More...
|
|
| RegionOfInterest (GstVideoRegionOfInterestMeta *meta) |
| Construct RegionOfInterest instance from GstVideoRegionOfInterestMeta. After this, RegionOfInterest will obtain all tensors (detection & inference results) from GstVideoRegionOfInterestMeta. More...
|
|
void | set_label (std::string label) |
| Set RegionOfInterest label. More...
|
|
void | set_object_id (int32_t id) |
| Set object ID. More...
|
|
GstVideoRegionOfInterestMeta * | _meta () const |
| Internal function, don't use or use with caution. More...
|
|
|
GstVideoRegionOfInterestMeta * | _gst_meta |
| GstVideoRegionOfInterestMeta containing fields filled with detection result (produced by gvadetect element in Gstreamer pipeline) and all the additional tensors, describing detection and other inference results (produced by gvainference, gvadetect, gvaclassify in Gstreamer pipeline)
|
|
std::vector< Tensor > | _tensors |
| vector of Tensor objects added to this RegionOfInterest (describing detection & inference results), obtained from GstVideoRegionOfInterestMeta
|
|
Tensor * | _detection |
| last added detection Tensor instance, defined as Tensor with name set to "detection"
|
|
This class represents region of interest - object describing detection result (bounding box) and containing multiple Tensor objects (inference results) attached by multiple models. For example, it can be region of interest with detected face and recognized age and sex of a person. It can be produced by a pipeline with gvadetect with detection model and two gvaclassify elements with two classification models. Such RegionOfInterest will have bounding box coordinates filled and will have 3 Tensor objects attached - 1 Tensor object with detection result and 2 Tensor objects with classification results coming from 2 classifications.
◆ RegionOfInterest()
GVA::RegionOfInterest::RegionOfInterest |
( |
GstVideoRegionOfInterestMeta * |
meta | ) |
|
|
inline |
Construct RegionOfInterest instance from GstVideoRegionOfInterestMeta. After this, RegionOfInterest will obtain all tensors (detection & inference results) from GstVideoRegionOfInterestMeta.
- Parameters
-
meta | GstVideoRegionOfInterestMeta containing bounding box information and tensors |
◆ _meta()
GstVideoRegionOfInterestMeta* GVA::RegionOfInterest::_meta |
( |
| ) |
const |
|
inline |
Internal function, don't use or use with caution.
- Returns
- pointer to underlying GstVideoRegionOfInterestMeta
◆ add_tensor()
Tensor GVA::RegionOfInterest::add_tensor |
( |
const std::string & |
name | ) |
|
|
inline |
Add new tensor (inference result) to this RegionOfInterest with name set. To add detection tensor, set name to "detection".
- Parameters
-
name | name for the tensor. If name is set to "detection", detection Tensor will be created and set for this RegionOfInterest |
- Returns
- just created Tensor object, which can be filled with tensor information further
◆ confidence()
double GVA::RegionOfInterest::confidence |
( |
| ) |
const |
|
inline |
Get RegionOfInterest detection confidence (set by gvadetect)
- Returns
- last added detection Tensor confidence if exists, otherwise 0.0
◆ detection()
Tensor GVA::RegionOfInterest::detection |
( |
| ) |
|
|
inline |
Returns detection Tensor, last added to this RegionOfInterest. As any other Tensor, returned detection Tensor can contain arbitrary information. If you use RegionOfInterest based on GstVideoRegionOfInterestMeta attached by gvadetect by default, then this Tensor will contain "label_id", "confidence", "x_min", "x_max", "y_min", "y_max" fields. If RegionOfInterest doesn't have detection Tensor, it will be created in-place.
- Returns
- detection Tensor, empty if there were no detection Tensor objects added to this RegionOfInterest when this method was called
◆ label()
std::string GVA::RegionOfInterest::label |
( |
| ) |
const |
|
inline |
◆ label_id()
int GVA::RegionOfInterest::label_id |
( |
| ) |
const |
|
inline |
◆ normalized_rect()
Rect<double> GVA::RegionOfInterest::normalized_rect |
( |
| ) |
|
|
inline |
◆ object_id()
int32_t GVA::RegionOfInterest::object_id |
( |
| ) |
const |
|
inline |
Get unique id of the RegionOfInterest. The id typically created by gvatrack element.
- Returns
- Unique id, or zero value if not found
◆ rect()
Rect<uint32_t> GVA::RegionOfInterest::rect |
( |
| ) |
const |
|
inline |
◆ set_label()
void GVA::RegionOfInterest::set_label |
( |
std::string |
label | ) |
|
|
inline |
◆ set_object_id()
void GVA::RegionOfInterest::set_object_id |
( |
int32_t |
id | ) |
|
|
inline |
Set object ID.
- Parameters
-
◆ tensors()
std::vector<Tensor> GVA::RegionOfInterest::tensors |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: