I built mediapipe facemesh solution with gpu support on Jetson Xavier AGX with reference to https://forums.developer.nvidia.com/t/mediapipe/121120/33
After obtaining desired landmarks I also used OpenCV with CUDA support to develop my own code to detect iris of the eye.
However despite using GPU support and CUDA accelerated OpenCV, the maximum FPS I have attained is around 14. I am using an USB camera which can give me maximum 30 fps for image size 640*480. How do I optimise my code?
Thank you for the prompt reply!
After changing the power mode to maximize device performance, no change was observed.
This is the output of tegrastats while running the code. We can clearly see the GPU being utilized.
Yes I am reading the camera using cv2.VideoCapture(0).
I am calculating exponentially decaying average of fps using time module by python.
For reference -
In the above code
tic = time at the start of the code
toc = time after processing (at the end of the code)
current_fps = fps for this frame
fps = decaying average of fps
I followed this method to give us an idea of the overall average, instead of just the current frame.
Still there was no significant improvement.
Do you mean using gstreamer with OpenCV? Because I even tried that, again no significant improvement.
It will be very helpful if you could provide links for implementing gstreamer or jetson_multimedia_api.
Thanks!