GStreamer Video Analytics (GVA) Plugin
|
This class represents region of interest - object describing detection result (bounding box) and containing multiple Tensor objects (inference results) attached by multiple models. More...
Public Member Functions | |
def | rect (self) |
Get bounding box of the RegionOfInterest as pixel coordinates in original image. More... | |
def | normalized_rect (self) |
Get bounding box of the RegionOfInterest as normalized coordinates in the range [0, 1]. More... | |
str | label (self) |
Get class label of this RegionOfInterest. More... | |
float | confidence (self) |
Get confidence from detection Tensor, last added to this RegionOfInterest. More... | |
int | object_id (self) |
Get object id. More... | |
def | tensors (self) |
Get all Tensor instances added to this RegionOfInterest. More... | |
Tensor | detection (self) |
Returns detection Tensor, last added to this RegionOfInterest. More... | |
int | label_id (self) |
Get label_id from detection Tensor, last added to this RegionOfInterest. More... | |
Tensor | add_tensor (self, str name="") |
Add new Tensor (inference result) to the RegionOfInterest. More... | |
VideoRegionOfInterestMeta | meta (self) |
Get VideoRegionOfInterestMeta containing bounding box information and tensors (inference results). More... | |
def | __init__ (self, VideoRegionOfInterestMeta roi_meta) |
Construct RegionOfInterest instance from VideoRegionOfInterestMeta. More... | |
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
def gstgva.region_of_interest.RegionOfInterest.__init__ | ( | self, | |
VideoRegionOfInterestMeta | roi_meta | ||
) |
Construct RegionOfInterest instance from VideoRegionOfInterestMeta.
After this, RegionOfInterest will obtain all tensors (detection & inference results) from VideoRegionOfInterestMeta
roi_meta | VideoRegionOfInterestMeta containing bounding box information and tensors |
Tensor gstgva.region_of_interest.RegionOfInterest.add_tensor | ( | self, | |
str | name = "" |
||
) |
Add new Tensor (inference result) to the RegionOfInterest.
name | Name for the tensor. This function does not take ownership of tensor passed, but only copies its contents |
float gstgva.region_of_interest.RegionOfInterest.confidence | ( | self | ) |
Get confidence from detection Tensor, last added to this RegionOfInterest.
Tensor gstgva.region_of_interest.RegionOfInterest.detection | ( | self | ) |
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 VideoRegionOfInterestMeta 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
str gstgva.region_of_interest.RegionOfInterest.label | ( | self | ) |
Get class label of this RegionOfInterest.
int gstgva.region_of_interest.RegionOfInterest.label_id | ( | self | ) |
Get label_id from detection Tensor, last added to this RegionOfInterest.
VideoRegionOfInterestMeta gstgva.region_of_interest.RegionOfInterest.meta | ( | self | ) |
Get VideoRegionOfInterestMeta containing bounding box information and tensors (inference results).
Tensors are represented as GstStructures added to GstVideoRegionOfInterestMeta.params
def gstgva.region_of_interest.RegionOfInterest.normalized_rect | ( | self | ) |
Get bounding box of the RegionOfInterest as normalized coordinates in the range [0, 1].
int gstgva.region_of_interest.RegionOfInterest.object_id | ( | self | ) |
Get object id.
def gstgva.region_of_interest.RegionOfInterest.rect | ( | self | ) |
Get bounding box of the RegionOfInterest as pixel coordinates in original image.
def gstgva.region_of_interest.RegionOfInterest.tensors | ( | self | ) |
Get all Tensor instances added to this RegionOfInterest.