TNTWEN / OpenVINO-YOLOV4

This is implementation of YOLOv4,YOLOv4-relu,YOLOv4-tiny,YOLOv4-tiny-3l,Scaled-YOLOv4 and INT8 Quantization in OpenVINO2021.3
MIT License
239 stars 66 forks source link

Convert Scaled YoloV4 #39

Open at1993 opened 3 years ago

at1993 commented 3 years ago

Hi TNTWEN,

As an enhancement request. Will you be supporting Scaled Yolo V4? This will be nice thanks.

TNTWEN commented 3 years ago

@at1993 yolov4-csp I have finished the adaptation of yolov4-csp,But the usage is very different from the previous one. I'll publish it in a new branch later. And more models are also comming

TNTWEN commented 3 years ago

@at1993 https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4

yolov4-csp AND yolov4x-mish have been uploaded

When darknet support yolov4-P5,yolov4-P6,yolov4-P7 ,i will also update them

at1993 commented 3 years ago

Awesome! Thanks.

at1993 commented 3 years ago

Hi TNTWEN, I got the following error when running the script

python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/

D:\Programming\Python\OpenVINO-YOLOV4-Scaled\yolov4-csp>python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/ Model Optimizer arguments: Common parameters:

TNTWEN commented 3 years ago

python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd/

you should delete the last /

TNTWEN commented 3 years ago

python "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo.py" --input_model frozen_darknet_yolov4_model.pb --batch 1 --reverse_input_channels --output detector/yolo-v4/Conv_94/BiasAdd,detector/yolo-v4/Conv_104/BiasAdd,detector/yolo-v4/Conv_114/BiasAdd

This is correct

at1993 commented 3 years ago

Thanks, it works now. The python program is running OK, However, when I run it with the C++ object_detection_demo program, it returns an error.

\Documents\Intel\OpenVINO\omz_demos_build\intel64\Release>object_detection_demo -m "D:\Programming\Python\OpenVINO-YOLOV4-Scaled\yolov4-csp\frozen_darknet_yolov4_model.xml" -i "waikikibeach.mp4" -d GPU -at yolo [ INFO ] InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Parsing input parameters [ INFO ] Reading input MFX: Can't initialize session [ INFO ] Loading Inference Engine [ INFO ] Device info: [ INFO ] GPU clDNNPlugin version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 Loading network files [ INFO ] Batch size is forced to 1. [ INFO ] Checking that the inputs are as the demo expects [ INFO ] Checking that the outputs are as the demo expects [ ERROR ] Invalid output type: Add. RegionYolo expected

TNTWEN commented 3 years ago

This is the difference between Scaled-yolov4 and yolov4 . Model conversion and inference demo need special treatment. So it is not compatible with openvino's official C + + demo

at1993 commented 3 years ago

Do you have any sample code in C++ for this "special treatment" as my library is written in C++? Would love to be able to run it in C++.

TNTWEN commented 3 years ago

I'm not familiar with C++ demo,but i will try

at1993 commented 3 years ago

Thank you.

RohitKeshari commented 2 years ago

Any one find any solution for openvino version of Scaled-yolov4?

TNTWEN commented 2 years ago

@RohitKeshari This repo already supports Scaled-yolov4 https://github.com/TNTWEN/OpenVINO-YOLOV4/tree/ScaledYOLOv4