-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Yolov4 #17185
Support Yolov4 #17185
Conversation
dbb3524
to
856b1f5
Compare
Can you please describe what "before" and "after" means? |
Have you used |
βBeforeβ means the results of running performance tests before this PR changes (without Yolov4 support) |
Yes, I used |
cfa41e6
to
4bbb21d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Well done!
Great to see that this is in the 3.4.11 milestone. Will this reach the 4.x branch as well? |
Thank you for your interest @rgov, @wooseokyourself! These PR changes will be merged into master branch next week. |
@sqiprasanna, please read all the messages carefully - you're trying to use OpenCV 4.2.0. We just merged the changes yesterday. |
@l-bat Thanks for the reply. I just used this yolov4 for training on my custom dataset. It really worked well on detecting images. I'm more excited to test this model on real-time detection using OpenCV. As I see here you're trying to include yolov4 in OpenCV dnn. I just want to really appreciate the work you've done and would like to see adding yolov4 into OpenCV. Thank you again for your hard work. Have a nice day. |
@AlexeyAB, it might be, yes. I'd like to recommend to open an issue for YOLOv4 optimization (some research with per-layer performance will be very helpful). Thanks! |
Hello,
I'm buildin OpenCV 3.4.10 from source on a docker container. I'm cloning this repository: I'm not very familiar with this, so can someone please give me a simple answer like "It's not working yet" or "It's already working, you can git clone this link", instead of referencing another one confused thread. |
It's not working yet, wait for the next release or get latest master or 3.4 branch version and build it manually. |
Hi, Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
Merge with extra: opencv/opencv_extra#753
resolves: #17148
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.
Performance tests
CPU: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz x8
Mish activation function
Mish activation function in origin paper
π(π₯) = π₯ * π‘ππβ(softplus(π₯)) where softplus (π₯) = ln(1 + πxp(π₯))
Darknet implementation softplus
We can use the original softplus function for darknet.
Proof:
x < -20: let's compare ln (1 + exp( π₯ )) with exp(x). exp (x) - > 0 and ln(1 + exp(x)) - > 0 when x - > -infinity. The maximum difference between ln (1 + exp ( π₯ )) and x at the maximum value of x (x=-20). exp (-20)= 2.061153622438558e-09 vs ln(1 + exp (-20)) = 2.0611536900435727e-09. both values are very close.
x > 20: let's compare ln(1 + πxp(π₯)) with x. ln(1 + πxp(π₯)) -> ln(πxp(π₯)) = x at X->infinity
The maximum difference between ln (1 + exp( π₯ )) and x with a minimum of x (x=20). ln(1 + exp(20)) = 20.000000002061153. So the difference is lower than 10e-8.