Skip to content

dnn: updated YOLOv4-tiny model and tests#23008

Merged
opencv-pushbot merged 1 commit intoopencv:4.xfrom
mshabunin:fix-yolov4-tiny-hash
Dec 23, 2022
Merged

dnn: updated YOLOv4-tiny model and tests#23008
opencv-pushbot merged 1 commit intoopencv:4.xfrom
mshabunin:fix-yolov4-tiny-hash

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

Merge with opencv/opencv_extra#1026

  • All tests now use yolov4-tiny-2022-12 instead of yolov4-tiny
  • I had to update test reference data, because results were different, I didn't check how previous bounding boxes look like, but updated boxes looks well:

First image:
img0-2

Second image:
img1-2

@asmorkalov
Copy link
Copy Markdown
Contributor

Failed test on Mac: Test_Int8_nets.YOLOv4_tiny/0, where GetParam() = OCV/CPU

@fengyuentau
Copy link
Copy Markdown
Member

traffic lights in the second image may be detected

@mshabunin mshabunin force-pushed the fix-yolov4-tiny-hash branch from e121be5 to a158aaa Compare December 21, 2022 17:10
@mshabunin
Copy link
Copy Markdown
Contributor Author

Does the CI run updated download_models.py script? Or should it be done manually? Because the model has changed and should be updated on CI.

@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 22, 2022

CI failure comes from mess with .cfg file.

@fengyuentau
Copy link
Copy Markdown
Member

fengyuentau commented Dec 22, 2022

image

There is a step checking and downloading new models in download_models.py.

image

Looks like it cannot find the .cfg file though.

Update:
Honestly speaking, I checked the merge step of opencv_extra and it seems working well. There is an download error on the Windows host while others failed at finding .cfg file. Does it need a manually update?

@mshabunin
Copy link
Copy Markdown
Contributor Author

mshabunin commented Dec 22, 2022

I've updated the cfg file.
There is still something wrong with the int8 test, it returns different results depending quantize mode and the test can not handle it.

Batch size 1:
res_2-0

Batch size 1 with per-tensor quantize:
res_1-0

*updated images
*updated text

@mshabunin mshabunin force-pushed the fix-yolov4-tiny-hash branch 2 times, most recently from ca92fe0 to 46fd591 Compare December 22, 2022 11:27
@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 22, 2022

Lets disable int8 test with comment.

@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 22, 2022

Or left it as is (restore .cfg file in opencv_extra and revert test changes).

@mshabunin
Copy link
Copy Markdown
Contributor Author

I've fixed int8 test by slight increase of IoU match threshold and similarly for CUDA FP16 (check has not passed yet) by increasing confidence match threshold. There are sporadic problems with model download on CI.

@mshabunin
Copy link
Copy Markdown
Contributor Author

I can see one more failure in Linux Debug build on buildbot, it can be fixed by increasing IoU difference threshold too (0.082 -> 0.118). I'll update the PR after successful CUDA test run.

@mshabunin mshabunin force-pushed the fix-yolov4-tiny-hash branch from 46fd591 to d35fbe6 Compare December 22, 2022 12:50
@zihaomu
Copy link
Copy Markdown
Member

zihaomu commented Dec 22, 2022

Hi @fengyuentau, the download script of the Windows server always fails, I think manual upload to windows host is necessary.

@fengyuentau
Copy link
Copy Markdown
Member

Uploaded yolov4-tiny-2020-12.weights and yolov4-tiny-2020-12.cfg to the Windows host. Re-triggered the job and lets see what happens.

@asmorkalov
Copy link
Copy Markdown
Contributor

@zihaomu @fengyuentau @alalek Can we merge the PR?

Copy link
Copy Markdown
Member

@fengyuentau fengyuentau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Apart from changes for inference engine which I cannot handle, others look good to me.

Copy link
Copy Markdown
Member

@zihaomu zihaomu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@opencv-pushbot opencv-pushbot merged commit 1f41d06 into opencv:4.x Dec 23, 2022
@mshabunin mshabunin deleted the fix-yolov4-tiny-hash branch December 23, 2022 11:18
@alalek alalek mentioned this pull request Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants