AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.73k stars 7.96k forks source link

performance of the model deployed in openvino is low #5560

Closed andeyeluguo closed 4 years ago

andeyeluguo commented 4 years ago

Hi AlexeyAB,

I try to deploy the yolov3-tiny in openvino according to theofficial tutorial of openvino but the performance is bad , I also try to get the reason why, and found lots of people meet this problem.

The question is:

Regards

andeyeluguo commented 4 years ago

@AlexeyAB I see your results https://github.com/AlexeyAB/darknet/issues/5079#issue-585403577

the performance of the yolov3-tiny on coco is 33.1% Would you please give the procedure how you process.

AlexeyAB commented 4 years ago

but the performance is bad

andeyeluguo commented 4 years ago

the links now is available

  • I just use an video tested on darknet_alexey and openvino(converted from darknet), the openvino can not detect anything
  • I try your suggetion to change the anchors, find it did not work in my case, may it will get anchors from the json file and replace the initial anchors
AlexeyAB commented 4 years ago

Try to use OpenCV-dnn + OpenVINO-backend: https://github.com/AlexeyAB/darknet/wiki/Converting-Yolo-v3-models-to-TensorFlow-and-OpenVINO(IR)-models#run-yolo-v3-models-on-opencv-dnn-with-openvino-dl-ie-backend

andeyeluguo commented 4 years ago

I have worked on flatform of the openvino toolkit for a month, do many research and solved many problems.

AlexeyAB commented 4 years ago
andeyeluguo commented 4 years ago

your detections looks good

  • Will you please give me the pictures(or videos) and results you test, I want to compare with you, and try to debug what's wrong with me
andeyeluguo commented 4 years ago

Hi AlexeyAB,

andeyeluguo commented 4 years ago

not ony the resize mode cause it

  • I have notice your code does not use the letterbox
  • the same video on darknet_alexyAB is good, but on openvino it can't detect anything. Cropped a ROI with a size(416, 416), openvino will detect some boxes, but still not so good as on darknet.
AlexeyAB commented 4 years ago
  • what this article describe is right, the resize mode really have a big effect on performance

Yes, resizing in TF was broken, but it isn't related to OpenVINO.

Current yolo models use resize instad of letter_box.

But using letterbox for models which was trained with resizing should not spoil detection much. OpenCV-dnn uses letterbox, but all yolo models works well with OpenCV-dnn.

I think the issue is in anchors: https://github.com/opencv/open_model_zoo/blob/master/demos/object_detection_demo_yolov3_async/main.cpp#L118-L119

andeyeluguo commented 4 years ago

the issue about anchor

  • I have debugged, found this function will obtain the anchors from the xml file when I change
    std::vector<float> anchors = {10.0, 13.0, 16.0, 30.0, 33.0, 23.0, 30.0, 61.0, 62.0, 45.0, 59.0, 119.0, 116.0, 90.0,156.0, 198.0, 373.0, 326.0};

    into

    std::vector<float> anchors;

    or initial it to be other value, it does't affect the result.

andeyeluguo commented 4 years ago

I just compare one video processed by yolov3 in darknet and openvino respectively, many boxes is missed in openvino .

andeyeluguo commented 4 years ago

sorry, I change the threshold, then the result of detecting a video using yolov3 and yolov3-tiny on darknet and openvino is very likely

  • what bad performance is my one-class model based yolov3-tiny.
  • Maybe something is wrong with my process, or my model is hard to be quantized to FP32(I am wondering if it needs to be quantized here, or it is simple float)
  • some people meet the same question, this issue trained a model based yolov3 drops a lot.
  • my model trained based on your darknet, all setting is default, while the yolov3.weights and yolov3-tiny.weights is from the pjreddie. Does the train platform affect the result ?
gganduu commented 4 years ago

sorry, I change the threshold, then the result of detecting a video using yolov3 and yolov3-tiny on darknet and openvino is very likely

  • what bad performance is my one-class model based yolov3-tiny.
  • Maybe something is wrong with my process, or my model is hard to be quantized to FP32(I am wondering if it needs to be quantized here, or it is simple float)
  • some people meet the same question, this issue trained a model based yolov3 drops a lot.
  • my model trained based on your darknet, all setting is default, while the yolov3.weights and yolov3-tiny.weights is from the pjreddie. Does the train platform affect the result ?

Hi, I met the same problem, and you have closed this issue. Have you solve this problem already?