GStreamer Video Analytics (GVA) Plugin
|
This class represents video frame - object for working with RegionOfInterest and Tensor objects which belong to this video frame (image). More...
Public Member Functions | |
def | __init__ (self, Gst.Buffer buffer, GstVideo.VideoInfo video_info=None, Gst.Caps caps=None) |
Construct VideoFrame instance from Gst.Buffer and GstVideo.VideoInfo or Gst.Caps. More... | |
GstVideo.VideoMeta | video_meta (self) |
Get video metadata of buffer. More... | |
GstVideo.VideoInfo | video_info (self) |
Get GstVideo.VideoInfo of this VideoFrame. More... | |
def | regions (self) |
Get RegionOfInterest objects attached to VideoFrame. More... | |
def | tensors (self) |
Get Tensor objects attached to VideoFrame. More... | |
RegionOfInterest | add_region (self, x, y, w, h, str label="", float confidence=0.0, bool normalized=False) |
Attach RegionOfInterest to this VideoFrame. More... | |
Tensor | add_tensor (self) |
Attach empty Tensor to this VideoFrame. More... | |
List[str] | messages (self) |
Get messages attached to this VideoFrame. More... | |
def | add_message (self, str message) |
Attach message to this VideoFrame. More... | |
def | remove_message (self, str message) |
Remove message from this VideoFrame. More... | |
None | remove_region (self, roi) |
Remove region with the specified index. More... | |
numpy.ndarray | data (self, Gst.MapFlags flag=Gst.MapFlags.READ) |
Get buffer data wrapped by numpy.ndarray. More... | |
This class represents video frame - object for working with RegionOfInterest and Tensor objects which belong to this video frame (image).
RegionOfInterest describes detected object (bounding boxes) and its Tensor objects (inference results on RegionOfInterest level). Tensor describes inference results on VideoFrame level. VideoFrame also provides access to underlying GstBuffer and GstVideoInfo describing frame's video information (such as image width, height, channels, strides, etc.). You also can get cv::Mat object representing this video frame.
def gstgva.video_frame.VideoFrame.__init__ | ( | self, | |
Gst.Buffer | buffer, | ||
GstVideo.VideoInfo | video_info = None , |
||
Gst.Caps | caps = None |
||
) |
Construct VideoFrame instance from Gst.Buffer and GstVideo.VideoInfo or Gst.Caps.
The preferred way of creating VideoFrame is to use Gst.Buffer and GstVideo.VideoInfo
buffer | Gst.Buffer to which metadata is attached and retrieved |
video_info | GstVideo.VideoInfo containing video information |
caps | Gst.Caps from which video information is obtained |
def gstgva.video_frame.VideoFrame.add_message | ( | self, | |
str | message | ||
) |
Attach message to this VideoFrame.
message | message to attach to this VideoFrame |
RegionOfInterest gstgva.video_frame.VideoFrame.add_region | ( | self, | |
x, | |||
y, | |||
w, | |||
h, | |||
str | label = "" , |
||
float | confidence = 0.0 , |
||
bool | normalized = False |
||
) |
Attach RegionOfInterest to this VideoFrame.
x | x coordinate of the upper left corner of bounding box |
y | y coordinate of the upper left corner of bounding box |
w | bounding box width |
h | bounding box height |
label | object label |
confidence | detection confidence |
region_tensor | base tensor for detection Tensor which will be added to this new |
normalized | if True, input coordinates are assumed to be normalized (in [0,1] interval). If False, input coordinates are assumed to be expressed in pixels (this is behavior by default) |
Tensor gstgva.video_frame.VideoFrame.add_tensor | ( | self | ) |
Attach empty Tensor to this VideoFrame.
numpy.ndarray gstgva.video_frame.VideoFrame.data | ( | self, | |
Gst.MapFlags | flag = Gst.MapFlags.READ |
||
) |
Get buffer data wrapped by numpy.ndarray.
List[str] gstgva.video_frame.VideoFrame.messages | ( | self | ) |
Get messages attached to this VideoFrame.
def gstgva.video_frame.VideoFrame.regions | ( | self | ) |
Get RegionOfInterest objects attached to VideoFrame.
def gstgva.video_frame.VideoFrame.remove_message | ( | self, | |
str | message | ||
) |
Remove message from this VideoFrame.
message | message to remove |
None gstgva.video_frame.VideoFrame.remove_region | ( | self, | |
roi | |||
) |
Remove region with the specified index.
roi | Region to remove |
def gstgva.video_frame.VideoFrame.tensors | ( | self | ) |
Get Tensor objects attached to VideoFrame.
GstVideo.VideoInfo gstgva.video_frame.VideoFrame.video_info | ( | self | ) |
Get GstVideo.VideoInfo of this VideoFrame.
This is preferrable way of getting any image information
GstVideo.VideoMeta gstgva.video_frame.VideoFrame.video_meta | ( | self | ) |
Get video metadata of buffer.