NvMOT_Process takes 40ms to run but objectDetector_YOLO displays 60fps perf?

I have implemented a custom low-level tracker and I time then print how long NvMOT_Process takes.
I get 40ms on average, yet the demo app prints 60FPS perf. It prints 0FPS for a brief moment and only after that does the video playback start. How is this possible?

Warn: 'threshold' parameter has been deprecated. Use 'pre-cluster-threshold' instead.

Using winsys: x11 
gstnvtracker: Loading low-level lib at /home/Projects/tracker/lib/libtracker.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF
Deserialize yoloLayerV3 plugin: yolo_83
Deserialize yoloLayerV3 plugin: yolo_95
Deserialize yoloLayerV3 plugin: yolo_107
0:00:04.855423366 25431     0x3b57c0f0 INFO                 nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1577> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/model_b1_gpu0_int8.engine
INFO: [Implicit Engine Info]: layers num: 4
0   INPUT  kFLOAT data            3x320x320       
1   OUTPUT kFLOAT yolo_83         255x10x10       
2   OUTPUT kFLOAT yolo_95         255x20x20       
3   OUTPUT kFLOAT yolo_107        255x40x40       

0:00:04.855738408 25431     0x3b57c0f0 INFO                 nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1681> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/model_b1_gpu0_int8.engine
0:00:04.870896920 25431     0x3b57c0f0 INFO                 nvinfer gstnvinfer_impl.cpp:311:notifyLoadModelStatus:<primary_gie> [UID 1]: Load new model:/opt/nvidia/deepstream/deepstream-5.0/sources/objectDetector_Yolo/config_infer_primary_yoloV3.txt sucessfully

Runtime commands:
h: Print this help
q: Quit

p: Pause
r: Resume

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.

** INFO: <bus_callback:181>: Pipeline ready

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 

**PERF: FPS 0 (Avg)
**PERF: 0.00 (0.00)
** INFO: <bus_callback:167>: Pipeline running

• Hardware Platform (Jetson / GPU) Jetson Xavier NX
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.0
• NVIDIA GPU Driver Version (valid for GPU only)

Hi @roulbac
Sorry for delay!
Seems there are two questions below, right?

  1. I get 40ms on average, yet the demo app prints 60FPS perf.
  2. It prints 0FPS for a brief moment and only after that does the video playback start.

For the first one, what’s your batch number?
For the 2nd one, what “perf-measurement-interval-sec” value do you set? The perf measurement call back is called every “perf-measurement-interval-sec”, in the first call after pipeline just starts, the FPS is 0, after “perf-measurement-interval-sec”,e.g. 5, seconds, it can get the real FPS.

FAQ - https://docs.nvidia.com/metropolis/deepstream/plugin-manual/index.html#page/DeepStream%20Plugins%20Development%20Guide/deepstream_plugin_faq.html

How can I interpret frames per second (FPS) display information on console?

The FPS number shown on the console when deepstream-app runs is an average over the most recent five seconds. The number in brackets is average FPS over the entire run. The numbers are displayed per stream. The performance measurement interval is set by the perf-measurement-interval-sec setting in the configuration file.

I have perf-measurement-interval-sec to 5 and a batch size of 1.
I also implemented NvMOT_Query to declare it doesn’t support batch processing.

gstnvtracker: Batch processing is OFF

did you set “interval=” in [primary-gie] which will skip the frames with the interval and cause higher FPS?

That did it for me, thank you very much.
I had interval=2, and since the fps was measured over an interval of 5seconds, the displayed fps was three times what I was expecting.