AlexeyAB / darknet

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

yolo2_light vs yolo3 - video output difference #1883

Open kmsravindra opened 5 years ago

kmsravindra commented 5 years ago

Hi @AlexeyAB,

When we run the same video through yolo2_light (quantized) and yolov3, we observe the following difference :

Even though yolo3 fps is giving only 36 with live capture, the video motion is much smoother than yolo2_light (quantized version that gives 49 FPS) . The irregularity in frame rate is much less pronounced in yolo3. Could you let me know what could be the reason behind this?

AlexeyAB commented 5 years ago

@kmsravindra Hi,


kmsravindra commented 5 years ago

@kmsravindra Hi,

  • Do you get this difference without -quantized flag?

comparing the output of the models ran

  1. with "-quantized" flag for yolo2_light and
  2. yolov3 model
  • Are you about frame-rate variation or about non-stable detection on the video?

There is irregularity in the frame rate that makes the video motion not so smooth at times...So, yes, it is more about frame rate variation.

  • What GPU do you use?

GTX 1080Ti

  • Do you run something on this GPU in parallel?

No. But the same GPU is used for both detection and rendering...The incoming video stream is at 1920 x 1080 resolution...But this is the same case while running yolov3 as well...

  • Do you use yolov3.cfg-based cfg-file or what cfg-file do you use?

Yes.=, it is yolov3 based cfg file and the config file is exactly the same in both cases except the input_calibration values added to take care of -quantized flag for yolo2_light.

  • Do you use http-mjpeg or rtsp videostream?

It is http stream

  • What OpenCV version do you use? And did you compile OpenCV with GStreamer? -DWITH_GSTREAMER=ON

Would this makes a difference? I am not sure if it was installed using GStreamer...Do you recommend to give it a try? But the question is again comparing yolov3 and yolo2_light on the same machine.

Yes.

AlexeyAB commented 5 years ago

There can be 2 reasons:

To understand what is the reason - you should do:


comparing the output of the models ran

  1. with "-quantized" flag for yolo2_light and
  2. yolov3 model
  1. Try to use yolo2_light without -quantized, will be there unstable frame rate in the https://github.com/AlexeyAB/yolo2_light ?

No. But the same GPU is used for both detection and rendering...The incoming video stream is at 1920 x 1080 resolution...But this is the same case while running yolov3 as well...

It can be a reason too, because https://github.com/AlexeyAB/darknet uses CUDA-streams, while https://github.com/AlexeyAB/yolo2_light doesn't use CUDA-streams.

  1. Try to use Darknet without steams: Add these 2 lines:
        cudaError_t status = cudaSuccess;
        streamsArray[i] = 0;

    instead of this line: https://github.com/AlexeyAB/darknet/blob/25f65f6878f713a7d0b7faabe94a7564d9a1ec08/src/cuda.c#L70

, will be there unstable frame rate in the https://github.com/AlexeyAB/darknet ?

kmsravindra commented 5 years ago

Sure. Will try those and let you know...Thanks much @AlexeyAB

kmsravindra commented 5 years ago

@AlexeyAB, Is there any limitation that cuda streams cannot be used with yolo2_light?

AlexeyAB commented 5 years ago

@kmsravindra No, there is no any limitation. I just didn't add it yet.

davehelsley commented 5 years ago

Regarding the two suggestions above: 1) The presence or absence of "-quantized" for yolo2 does not affect the visibly unstable frame rate. 2) Removing the CUDA-streams support in yolo3 did not cause the visibly unstable frame rate.