I use python app. There is a function :“def osd_sink_pad_buffer_probe(pad,info,u_data)” used to display object detection results. How could I modify this function to add FPS to the display?
• Hardware Platform (Jetson / GPU) Titan V • DeepStream Version 5.0 • JetPack Version (valid for Jetson only) • TensorRT Version 7.0.11 • NVIDIA GPU Driver Version (valid for GPU only) 410.33
You may refer to deepstream-imagedata-multistream python sample, for how to get fps, get fps function defined in common module, python/apps/common/
then insert the value got into the code
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])
@Amycao. I have explored the multimedia app you suggested. The code is like this:
# Get frame rate through this probe
fps_streams["stream{0}".format(frame_meta.pad_index)].get_fps()
So, I need to modify and insert it as:
fps_stream=GETFPS(0)
FPS = fps_stream.get_fps() #I have only one source stream, indexed as 0.
py_nvosd_text_params.display_text = “Frame Number={} Number of Objects={} Vehicle_count={} Person_count={} FPS={}”.
format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON], FPS)
Hey @HIVE , I was wondering if you were able to print your FPS on screen.
In my case, I have only 1 stream as well, but your code gives the following output:
fps = GETFPS(0).get_fps() #I have only one source stream, as well.
py_nvosd_text_params.display_text = “FPS={}”.format(fps)
Hello happened to me also.
If you go look at the FPS.py in common folder it does not return FPS instead it measures FPS every 5 seconds and prints it. You can add this function to FPS.py file to return FPS every time its called.