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

problem about YOLOv4 implement on openivno2021.X #32

Open ermubuzhiming opened 3 years ago

ermubuzhiming commented 3 years ago

Honor to know about your work about YOLOv4 implement on openivno2021.X . What I am doing is similar to yours but doesnot as well as your. I am not familiar with the detailed Python implement about the model and just use the openvino to do the model transfermation and inference. I scaned your file named OpenVINO-YOLO-Automatic-Generation/yolov4parse/cfg/yolov4.cfg. So I wonder how to check which part of YOLOv4 is suppported by openvino2021.2? Or what I need to learn? In the .cfg file,I find you use SPP,CIOU, MISH,MOSAIC and GREEDYNMS metioned in YOLOv4 paper.

TNTWEN commented 3 years ago

This repos implements .weights->.pb->OpenVINO IR OpenVINO-YOLO-Automatic-Generation is prepared for https://github.com/TNTWEN/Pruned-OpenVINO-YOLO which convert pruned yolov3-SPP,yolov4,yolov4tiny to OpenVINO.

As far as I am concerned,there are two ways to convert yolo model to OpenVINO ," .weights->.pb->OpenVINO IR" and ".weights->onnx-> OpenVINO IR". But the latter requires you to write openvino reasoning programs yourself. My " .weights->.pb->OpenVINO IR" could use official yolov3 inference demo directly.

This is OpenVINO yolov3 guide:https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html Compared with yolov3, the biggest change in yolov4 is mish activation function.Openvino supports all the network layers involved in yolov3,You just need to test whether the new network layer in yolov4 can be used in OpenVINO on the basis of yolov3.And CIOU,MOSAIC and GREEDYNMS are just used for training.

ermubuzhiming commented 3 years ago

THANKS for your reply in time. I know how to convert models successfully. I wonder how to test "whether the new network layer in yolov4 can be used in OpenVINO on the basis of yolov3" befor I building the network model? THANKS!

TNTWEN commented 3 years ago

By trying. OpenVINO has its rules to convert other model to IR. Or you could refer to OpenVINO Guide Book, it will tell you which tf layer could be converted to IR,which onnx layer could be converted to IR. But in my experience, a lot of information in the guidebook is not completely correct. So try is the best way. If an unsupported layer is encountered, mo.py will tell you the corresponding error layer.

ermubuzhiming commented 3 years ago

THANKS!It IS HELPFUL! I want to make sure if it is right in this link https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_Supported_Frameworks_Layers.html

TNTWEN commented 3 years ago

YES!

ermubuzhiming commented 3 years ago

HHH! and I want to make sure that if openvino2021.2 does not support yolov4 . I have seen your disscussion in the Issues and it have not been updated for several days.

TNTWEN commented 3 years ago

2020.4 support all models and all devices

2021.1 2021.2 have bug when using GPU+FP16+yolov4. Other models and devices are normal.

Waiting for 2021.3~~

ermubuzhiming commented 3 years ago

That means openvino2021.2+yolov4+FP16+NCS2 is also ok?

TNTWEN commented 3 years ago

YES!

ermubuzhiming commented 3 years ago

OK! I will try! thanks for your reply in time! If there are some problem in my process , I will learn from you! Wish I have some new findings to share with you! Thanks again!