“get_nvds_buf_surface” is said to be absent in pyds.
I want to get the array in numpy format via “pyds.get_nvds_buf_surface()” according to the following documentation.
URL:https://docs.nvidia.com/metropolis/deepstream/5.0/python-api/Methods/methodsdoc.html?highlight=nvds_buf_surface
However, the following error occurs.
Error
frame_rgba = pyds.get_nvds_buf_surface(gst_buffer, g_count)
AttributeError: module 'pyds' has no attribute 'get_nvds_buf_surface'
Code
def osd_sink_pad_buffer_probe(pad,info,u_data):
global g_count
print(f "gcount:{g_count}")
frame_number=0
#Intiallizing object counter with 0.
obj_counter = {
PGIE_CLASS_ID_NO_MASK:0,
PGIE_CLASS_ID_MASK:0
# PGIE_CLASS_ID_VEHICLE:0, PGIE_CLASS_ID_VEHICLE:0,
# PGIE_CLASS_ID_PERSON:0,
# PGIE_CLASS_ID_BICYCLE:0, # PGIE_CLASS_ID_PERSON:0, # PGIE_CLASS_ID_PERSON:0, # PGIE_CLASS_ID_BICYCLE:0,
# PGIE_CLASS_ID_ROADSIGN:0, # PGIE_CLASS_ID_PERSON:0, # PGIE_CLASS_ID_BICYCLE:0, # PGIE_CLASS_ID_BICYCLE:0, # PGIE_CLASS_ID_ROADSIGN:0
}
num_rects=0
gst_buffer = info.get_buffer()
If not gst_buffer. print("Unable import pydsto get GstBuffer ")
print("Unable import pydsto get GstBuffer ")
return
# show img
frame_rgba = pyds.get_nvds_buf_surface(gst_buffer, g_count)
cv2.imshow("Streamk",frame_rgba)