NvDsDisplayMeta¶
- class pyds.NvDsDisplayMeta¶
Holds information of display metadata that user can specify in the frame.
- Variables:
base_meta –
NvDsBaseMeta
, base_metanum_rects – int, Number of rectangles present in display meta.
num_labels – int, Number of labels/strings present in display meta.
num_lines – int, Number of lines present in display meta.
rect_params – List of
NvOSD_RectParams
, Holds a list of positional parameters for rectangles. Used to overlay borders or semi-transparent rectangles, as required by the application. SeeNvOSD_RectParams
.text_params – List of
NvOSD_TextParams
, Holds a list of text parameters for user-defined strings that can be overlayed using this structure. SeeNvOSD_TextParams
.line_params – List of
NvOSD_LineParams
, Holds a list of line parameters that the user can use to draw polygons in the frame, e.g. to show a RoI in the frame. SeeNvOSD_LineParams
.num_arrows – int, Holds the number of arrows described.
num_circles – int, Holds the number of circles described.
arrow_params – List of
NvOSD_ArrowParams
, Holds a list of arrow parameters that the user can use to draw arrows in the frame. SeeNvOSD_ArrowParams
:circle_params – List of
NvOSD_CircleParams
, Holds a list of circle parameters that the user can use to draw circle in the frame. SeeNvOSD_CircleParams
.misc_osd_data – np.array of int, Holds an np.array of user-defined OSD metadata.
reserved – list of int, Reserved for internal use.
Example usage:
display_meta=pyds.nvds_acquire_display_meta_from_pool(batch_meta) #Retrieve NvDsDisplayMeta object from pool in given NvDsBatchMeta object display_meta.num_labels = 1 py_nvosd_text_params = display_meta.text_params[0] #Retrieve NvOSD_TextParams object from list in display meta. See NvOSD docs for more details. # Setting display text to be shown on screen # Note that the pyds module allocates a buffer for the string, and the # memory will not be claimed by the garbage collector. # Reading the display_text field here will return the C address of the # allocated string. Use pyds.get_string() to get the string content. py_nvosd_text_params.display_text = "Frame Number={} Number of Objects={} Vehicle_count={} Person_count={}".format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON]) print(pyds.get_string(py_nvosd_text_params.display_text)) pyds.nvds_add_display_meta_to_frame(frame_meta, display_meta) #Use method to add display_meta to frame_meta.
- cast(*args, **kwargs)¶
Overloaded function.
cast(self: capsule) -> pyds.NvDsDisplayMeta
cast given object/data to
NvDsDisplayMeta
, call pyds.NvDsDisplayMeta.cast(data)cast(self: int) -> pyds.NvDsDisplayMeta
cast given object/data to
NvDsDisplayMeta
, call pyds.NvDsDisplayMeta.cast(data)