NvDsDisplayMeta

class pyds.NvDsDisplayMeta

Holds information of display metadata that user can specify in the frame.

Variables:
  • base_metaNvDsBaseMeta, base_meta

  • num_rectsint, Number of rectangles present in display meta.

  • num_labelsint, Number of labels/strings present in display meta.

  • num_linesint, 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. See NvOSD_RectParams.

  • text_params – List of NvOSD_TextParams, Holds a list of text parameters for user-defined strings that can be overlayed using this structure. See NvOSD_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. See NvOSD_LineParams.

  • num_arrowsint, Holds the number of arrows described.

  • num_circlesint, 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. See NvOSD_ArrowParams:

  • circle_params – List of NvOSD_CircleParams, Holds a list of circle parameters that the user can use to draw circle in the frame. See NvOSD_CircleParams.

  • misc_osd_datanp.array of int, Holds an np.array of user-defined OSD metadata.

  • reservedlist 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.

  1. cast(self: capsule) -> pyds.NvDsDisplayMeta

cast given object/data to NvDsDisplayMeta, call pyds.NvDsDisplayMeta.cast(data)

  1. cast(self: int) -> pyds.NvDsDisplayMeta

cast given object/data to NvDsDisplayMeta, call pyds.NvDsDisplayMeta.cast(data)