Skip to content
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

Lcy yolov5 #11386

Closed
wants to merge 15 commits into from
Closed

Lcy yolov5 #11386

wants to merge 15 commits into from

Conversation

cityrainflow
Copy link

@cityrainflow cityrainflow commented Apr 19, 2023

🤖 Generated by Copilot at f115ef9

Summary

🚀🧠📝

This pull request enhances the object detection functionality and performance of YOLOv5 by adding support for ODConv-based backbone models, modifying detect.py and yolo.py to handle different feature maps, changing the dataset path in VisDrone.yaml, adding a demo script and a custom model definition, and improving the stream loader and the comments in train.py and experimental.py.

There once was a coder named Lou
Who wanted to try something new
He added ODConv
To YOLOv5's front
And tweaked some dataloaders too

Walkthrough

  • Add support for ODConv backbone models and their variants to YOLOv5 (link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Define the ODConv2d layer and its attention mechanism in odconv.py (link)
  • Define the ODConv-based ResNet and MobileNetV2 models and their variants in od_resnet.py and od_mobilenetv2.py (link, link)
  • Modify the logic of saving the detection results to text files, images, or videos in detect.py, to handle multiple video sources or streams (link, link)
  • Add comments to the arguments and functions of detect.py, yolo.py, and train.py, to explain their meaning and usage (link, link, link, link, link, link, link)
  • Show how to use the torch.hub.load function to load a pretrained YOLOv5 model and run inference on an image in demo.py (link)
  • Change the path of the dataset root dir from a relative path to an absolute path in data/VisDrone.yaml, to avoid potential errors when running the code from different directories (link)

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Integration of ODConv architecture and MobileNetV2 backbone into YOLOv5.

📊 Key Changes

  • Added ODConv (Object-aware Dynamic Convolution) modules and integrated MobileNetV2 as a new backbone option for the YOLOv5 model.
  • Introduced new YAML configuration file yolov5-custom.yaml to utilize the ODConv and MobileNetV2 backbone.
  • Modified the models/yolo.py to adapt to the new ODConv structures and backbones.
  • Included necessary files for the ODConv architecture such as od_mobilenetv2.py, od_resnet.py, and odconv.py.
  • Incorporated pretrained weights for MobileNetV2 by adding odconv1x_mobilenetv2_050.pth.tar and odconv4x_mobilenetv2_050.pth.tar.
  • Adjusted the train.py script and related files to support the new changes.

🎯 Purpose & Impact

  • Enhances the YOLOv5 model with a more efficient and dynamic backbone, potentially improving performance on various detection tasks.
  • Provides users with additional options for model architectures, allowing for more flexible and tailored usage.
  • Could lead to better accuracy and speed trade-offs in real-world applications.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

👋 Hello @cityrainflow, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with ultralytics/yolov5 master branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

@cityrainflow
Copy link
Author

Accidentally submitted, please ignore

@glenn-jocher
Copy link
Member

@cityrainflow no problem, let me know if you have any questions or need any assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants