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
238 stars 66 forks source link

-reverse input channel flag needed #8

Closed GotG closed 4 years ago

GotG commented 4 years ago

Hello

When converting to xml wondering whether reverse input channel is needed?

In my experience, tf models do require this.

Thanks

TNTWEN commented 4 years ago

Hi, @GotG Darknet:https://github.com/pjreddie/darknet/issues/427 Tensorflow(my project is based on mystic123 Tensorflow YOLOV3):https://github.com/mystic123/tensorflow-yolo-v3/issues/2 OpenVINOYOLOV3:https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html `python3 mo_tf.py --input_model /path/to/yolo_v3.pb --tensorflow_use_custom_operations_config $MO_ROOT/extensions/front/tf/yolo_v3.json --batch Since YOLOV3 ,OpenVINO didn't use --reverse_input_channels. I checked object_detection_demo_yolov3_async.py and i didn't found this demo converts BGR(OpenCV) to RGB(darknet and tf) So i did some tests: YOLOV4 original: oldyolov4 YOLOV4 channels reversed: yolov4 YOLOV4 tiny original: oldv4tiny416 YOLOV4 tiny channels reversed: V4tiny

I also do some video tests,the results are the same. Using --reverse_input_channels will be better So i agree with you. My conclusion is that this may be a mistake made by OpenVINO since YOLOv3

Thanks a lot!!

GotG commented 4 years ago

Thanks for checking. My results are also very close when tested on yolov3. I did mention this at some point on their forums.

TNTWEN commented 4 years ago

Great job!! Thanks a lot!

GotG commented 4 years ago

Well done with your repo! Very useful! Do you happen to know for tiny yolo v4 which function prevents it from working in OpenVINO 20.01 or .02? Thanks

TNTWEN commented 4 years ago

@GotG yolov4 tiny need this :

[route] layers=-1 groups=2 group_id=1

In Tensorflow,we could use https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/534cca38d1e3bf95dce98daa216a57f62a2f83ce/yolo_v4_tiny.py#L21 or https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/534cca38d1e3bf95dce98daa216a57f62a2f83ce/yolo_v4_tiny.py#L22 But they are not supported by OpenVINO before 2020R4(In fact, I used the 2019 version before ,so the exact version which began to support v4 tiny may not be accurate) Now OpenVINO 2020R4 supports the second operation but it still doesn't support the first operation.But anyway, that's enough for us to implement OpenVINO v4tiny