I am doing masking on every frame of Real time video on Nvidia GPU by using dnn . I had loaded weights in dnn object using cv2.dnn.readNetFromTensorflow(weightsPath, configPath)
and executing masks from it using net.forward
but it is giving 1 fps speed for masking with only one thread.
I have two questions:-
- As I know Nvidia support is not present. So is this possible that in future it can give more fps?
- I need atleast 10 fps speed (I can drop some frame in real time video). So, I had tried threading by initializing net in every new thread but its speed is much less than 1fps. I know, It is because I am calling a new thread on each frame with initializing net (as net can't be shared in between thread and also I can't restart thread which has done processing) which take much more time to initialize. I can't even pass a batch of frame as I want a real time show of mask too (even this can't take care of net initializing problem, as I have to initialize net in every new thread). So any ideas how to resolve this?