-
Notifications
You must be signed in to change notification settings - Fork 320
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
Add features to the YOLO model from the latest YOLO variants #817
Add features to the YOLO model from the latest YOLO variants #817
Conversation
* Supports several algorithms for matching targets to anchors. * Added support for DIoU and CIoU losses. * Target for confidence can be selected between 1.0 and the overlap between the target and the predicted box. * Target classes may be specified as a matrix of class probabilities, allowing multiple classes per object. * Fixed rounding of maxpool layer size. * Weight decay is applied only to convolutional layer weights. * Command line interface is now using LightningCLI.
* Calculates MAP metric using TorchMetrics. * Convolutional and max pooling layers automatically add the correct amount of padding. * Added YOLOv4 network.
Loading a checkpoint with a different number of output classes is possible with strict=False.
…ities.rank_zero is not available
* Added the deeper P6 variant of YOLOv4. * Width of each backbone stage can be configured freely. * The number of input channels in the PyTorch architectures can be changed. * Added predict_step().
0d6f4b8
to
64a3e47
Compare
@senarvi we have fixed master a few munites ago, so shall be 🟢 could you pls merge it here 🐿️ |
Great. Seems like the tests are passing now. |
perfect, it just sai about some conflicts, but I can't see them, mind check it? |
Head branch was pushed to by a user without write access
mypy doesn't understand "= ... if ... else ..." and ruff doesn't accept the longer form.
@Borda managed to fix it finally. ruff formatted the code in a way that caused mypy to fail. Formatting in a way that mypy accepts caused ruff to fail. In the end I added a "type: ignore" comment. It wasn't merged automatically, but all the tests have passed. |
@@ -0,0 +1,59 @@ | |||
# YOLO | |||
|
|||
The YOLO model has evolved quite a bit, since the original publication in 2016. The original source code was written in C, using a framework called [Darknet](https://github.com/pjreddie/darknet). The final revision by the original author was called YOLOv3 and described in an [arXiv paper](https://arxiv.org/abs/1804.02767). Later various other authors have written implementations that improve different aspects of the model or the training procedure. [YOLOv4 implementation](https://github.com/AlexeyAB/darknet) was still based on Darknet and [YOLOv5](https://github.com/ultralytics/yolov5) was written using PyTorch. Most other implementations are based on these. |
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.
cc: @lantiga
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.
Very cool contribution, thank you @senarvi
What does this PR do?
The YOLO model has been largely refactored, so that it's easy to incorporate new features from different YOLO variants, such as different algorithms for assigning targets to anchors. It also supports defining the network structure as a PyTorch module, in addition to loading a Darknet configuration file. The implementation now supports the most important features of YOLOv3, YOLOv4, YOLOv5, YOLOv7, Scaled-YOLOv4, and YOLOX.
Fixes #816
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃