Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6018 Discussions

Running Yolov4 model with Object Detection Python Model

Mostafa-
Employee
727 Views

After converting yolo-v4-tf model to IR and also changed the input shape to ([1,416,224,3] shape)

 

I tried that converted model with object detection Python demo;

https://github.com/openvinotoolkit/open_model_zoo/blob/master/demos/object_detection_demo/python/REA...

 

You can see the entire downloaded video from https://www.pexels.com/video/people-wearing-face-mask-in-public-area-4562551/

 

I used the following command (CPU device), but I got an error!

 

python3 object_detection_demo.py \
--model /opt/intel/openvino_2021/deployment_tools/tools/model_downloader/public/yolo-v4-tf/FP16/yolo-v4-tf.xml \
-at yolo \
-i /home/mostafa/video/people.mp4 \
-t 0.5 \
-d CPU \
-o /home/mostafa/video/peolpe_fp16_output.mp4

 

Mostafa_0-1638969126779.png

also there're an error when trying GPU;

Mostafa_1-1638969242256.png

Thanks,

Mostafa

0 Kudos
6 Replies
Hairul_Intel
Moderator
704 Views

Hi Mostafa,

Thank you for reaching out to us.

 

Referring to your output command -o people_fp16_output.mp4, please be noted that the Object Detection Python Demo can only save processed results in Motion JPEG AVI file or separate JPEG or PNG files as mentioned here.

 

To save processed results as video, specify the name of the output file with avi extension, for example: -o output.avi.

 

As for the error when running the demo on GPU device, can you confirm that you have followed the steps to configure Intel Processor Graphics(GPU)?

 

 

Regards,

Hairul


Mostafa-
Employee
694 Views

Hi Hairul,

 

I changed the output to avi extension, but I got the same error.

 

I posted here the IR files to test it yourself, may be there's another thing.

https://drive.google.com/drive/folders/1KnGLnfpE73HtESeYPDouxWcUAWCguxhX?usp=sharing

 

Regarding the GPU part, I followed the steps again, and this what I got;

Mostafa_0-1639036675911.png

 

BR,

Mostafa

Hairul_Intel
Moderator
662 Views

Hi Mostafa,

I have managed to successfully run the Object Detection Python Demo on CPU using the sample video and IR files that you have provided. The Object Detection Python Demo was performed using OpenVINO 2021.4.2 on Intel Core i7 10th Generation with Ubuntu 20.04 OS.

 

demo_ubuntu20.png

 

I share the demo command here:

command_demo.jpg

 

Moving on to your issue, are you using Ubuntu on WSL2? If that's the case, I suggest you install MobaXterm and launch WSL2 Ubuntu from the MobaXterm application.

 

MobaXterm.PNG

 

MobaXTerm is available for download on the following page:

https://mobaxterm.mobatek.net/download.html

 

Also, WSL2 subsystem doesn't support GPU plugin. You can check the available plugins on your WSL2 subsystem using Hello Query Device Python* Sample.

 

hello_query_device.png

 

 

 

Regards,

Hairul

Mostafa-
Employee
646 Views

Thank you Hairul, I used the MobaXTerm, and it successfully works. 

 

The result not the same as yours - as you see below - I means the prediction percent on the top of bounding box not shown.

 

Also the FPS is way smaller than yours, although I am using (Intel® Core™ i7-10610U CPU @ 1.80GHz)

 

Mostafa_0-1639218282725.png

 

Seeking your support, please as usual.

 

Many Thanks,

Mostafa

Hairul_Intel
Moderator
621 Views

Hi Mostafa,

Please ensure that your demo command is -at yolov4 instead of -at yolo as the latter will result in the bounding box and prediction percentage not displaying correctly.

 

I share the demo command here:

python3 /opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos/object_detection_demo/python/object_detection_demo.py --model /home/<username>/Demo/object_detection_demo/userModel/yolo-v4-tf.xml -at yolov4 -i /home/<username>/Demo/object_detection_demo/people.mp4 -o /home/<username>/Demo/object_detection_demo/output.avi

 

xterm_umodel_desired.JPG

 

I obtained similar low FPS results when running the demo on WSL2. The reason is that WSL2 have significant difference in performance when working with APIs or compiling source code between WSL and Linux. Here is the findings for the WSL2 performance in Windows 10.

 

Other than that, we do not recommend using OpenVINO on WSL2 as the OpenVINO Toolkit is validated only on Ubuntu 18.04 (LTS) and Ubuntu 20.04 (LTS) for the Ubuntu Linux distribution. You can refer to the Install and Configure Intel® Distribution of OpenVINO™ toolkit for Linux*.

 

 

Regards,

Hairul

 

Hairul_Intel
Moderator
540 Views

Hi Mostafa,

This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.

 

 

Regards,

Hairul


Reply