AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.57k stars 7.95k forks source link

Reduce FPS processing multiple video concurrently #5551

Open ALGO8DS opened 4 years ago

ALGO8DS commented 4 years ago

I have trained a custom object detection using yolov3. When I test this with a single video I get speed of ~33 FPS. However If I test for 4 videos separately but concurrently I get speed of ~8 FPS in each of them so combining them all I can say its same as ~33. However ~50% GPU power is not being used.

Its because while testing for one video. Its using all the available CPU cores and when I start increasing the number of process this gets equally distributed?

AlexeyAB commented 4 years ago
ALGO8DS commented 4 years ago

I am using 4 core CPU and 1 Tesla P4 on Google cloud .

image

1 darknet instance CPU and GPU usage: image image

4 darknet instance CPU and GPU usage: image image

ALGO8DS commented 4 years ago

I think I can increase the GPU usage by increasing batch? But how do I increase it for prediction? This is something I can change for training.

AlexeyAB commented 4 years ago

However ~50% GPU power is not being used.

On your screenshot there are 94% and 100% GPU usage. You can't increase it higher than 100%.

ALGO8DS commented 4 years ago

When I use tiny yolo I get ~110 FPS on one process.

image

if I run two process concurrently then also same thing is happening . However Volatile GPU-UTIL is 34-40%

image

AlexeyAB commented 4 years ago

if I run two process concurrently then also same thing is happening .

ALGO8DS commented 4 years ago

How many FPS for each instance?

55

What command do you use?

./darknet detector demo cfg/obj.data cfg/yolo-obj.cfg backup/yolo-obj_last.weights input_vid.mp4 -out_filename res.avi -dont_show

What GPU and CPU usage?

GPU usage 30-40% shared in last comment, CPU usage 99-100%

AlexeyAB commented 4 years ago

There is a performacnce bottleneck on your CPU during saving results to video-file. Buy better CPU.