openvinotoolkit / open_model_zoo

Pre-trained Deep Learning models and demos (high quality and extremely fast)
https://docs.openvino.ai/latest/model_zoo.html
Apache License 2.0
4.1k stars 1.37k forks source link

Crossroad demo does not fully process video #3961

Closed ashnair1 closed 5 months ago

ashnair1 commented 5 months ago

Having followed the instructions provided, I have been able to setup the Crossroad C++ demo. Though while running inference on videos I've noticed that the demo does not fully process the videos.

For example, running inference on a 1 min long video results in an output video containing only 20 sec. For some reason, the remaining 40 seconds of the video was not processed. Not really sure why it stops early and would like some pointers as to why this seems to be the case.

Wovchena commented 5 months ago

Can you share to command you used to run the demo?

ashnair1 commented 5 months ago

Command used:

./crossroad_camera_demo -no_show -i /home/ashwin/Downloads/lourve_paris_tour.mp4 -m /media/ashwin/DATA2/open_model_zoo/models/crossroad/intel/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml -m_reid /media/ashwin/DATA2/open_model_zoo/models/crossroad/intel/person-reidentification-retail-0277/FP16/person-reidentification-retail-0277.xml -d GPU -o /home/ashwin/Downloads/output_lourve_paris_tour.mp4

Only using the detection and re-identification here

Wovchena commented 5 months ago

If the video is sped up, it can be caused by OpenCV extracting FPS incorrectly: https://github.com/openvinotoolkit/open_model_zoo/blob/a14ddee21bd2ecb85e1ee3f89ce17dbf1dc9343f/demos/common/cpp/utils/src/images_capture.cpp#L181 If the video is truncated, it may be caused by -limit "<num>" Optional. Number of frames to store in output. If 0 is set, all frames are stored. having non zero default value. It may also be that the processing algorithm is incorrect. You are on your own in that situation, alternatively you can compare the result with a different demo to exclude algo problem.

ashnair1 commented 5 months ago

The truncation was indeed caused by the -limit parameter. I had assumed its default value was 0. Setting -limit 0 fully processes the video as expected.