Comments (10)
👋 Hello @jackwolfey, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.
Requirements
Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
Environments
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
Introducing YOLOv8 🚀
We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!
Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.
Check out our YOLOv8 Docs for details and get started with:
pip install ultralytics
from yolov5.
Hello,
Thank you for bringing this to our attention and for your thoughtful suggestion! The issue of label names and confidence thresholds running outside the image boundary is indeed a valid concern, especially for improving the clarity of detection results.
To address your query:
-
Feature Proposal: Expanding the image or adjusting the label placement to ensure visibility is a valuable feature. It can enhance the user experience by ensuring that all relevant information is clearly visible. Introducing a command-line parameter to enable or disable this feature would provide flexibility to users who may or may not need this functionality.
-
Implementation: If you are willing to contribute, we would greatly appreciate a Pull Request (PR) with this enhancement. You could consider implementing a mechanism that checks the position of the label and adjusts it accordingly if it is too close to the image boundary. Alternatively, expanding the image canvas slightly to accommodate the labels could also be a solution.
Here's a basic idea of how you might start implementing this:
# Pseudo-code for adjusting label position
def adjust_label_position(label, image_width, image_height):
label_x, label_y = label.position
label_width, label_height = label.size
if label_x + label_width > image_width:
label_x = image_width - label_width
if label_y + label_height > image_height:
label_y = image_height - label_height
return label_x, label_y
Feel free to refine this approach and integrate it into the detect.py
script. We encourage you to submit a PR, and our team will be happy to review it.
If you have any further questions or need assistance with the implementation, please don't hesitate to ask. We appreciate your willingness to contribute to the YOLOv5 project!
from yolov5.
Hi @glenn-jocher , thanks for your reply. I am happy to do some contribute to this project. After carefully reading the source code, I found that in the current version of the code, the logic of drawing the rectangle box and labels is implemented in ultralytics.utils.Annotator.box_label()
. Should I try to contribute code in ultralytics instead of this project?
from yolov5.
Hello @jackwolfey,
Thank you for your enthusiasm and willingness to contribute to the YOLOv5 project! We truly appreciate your support and initiative.
You are correct that the logic for drawing the rectangle box and labels is implemented in the ultralytics.utils.Annotator.box_label()
function. If you are looking to enhance the visualization by ensuring that labels and confidence thresholds do not run outside the image boundary, this would indeed be the appropriate place to make your changes.
To proceed, you can fork the YOLOv5 repository, make your modifications, and then submit a Pull Request (PR) for review. Here are some steps to guide you:
- Fork the Repository: Fork the YOLOv5 repository to your GitHub account.
- Clone the Repository: Clone your fork to your local machine.
- Create a New Branch: Create a new branch for your feature.
- Implement the Changes: Modify the
ultralytics.utils.Annotator.box_label()
function to adjust label positions or expand the image canvas as needed. - Test Your Changes: Ensure that your changes work as expected and do not introduce any new issues.
- Submit a PR: Push your changes to your fork and submit a PR to the main YOLOv5 repository.
Here's a basic example of how you might adjust the label position within the box_label
function:
def box_label(self, box, label='', color=(128, 128, 128), txt_color=(255, 255, 255)):
# Existing code to draw the box and label
# ...
# Adjust label position if it is too close to the image boundary
label_x, label_y = box[:2]
label_width, label_height = self.get_text_size(label)
if label_x + label_width > self.img.shape[1]:
label_x = self.img.shape[1] - label_width
if label_y + label_height > self.img.shape[0]:
label_y = self.img.shape[0] - label_height
# Draw the adjusted label
self.draw_text((label_x, label_y), label, txt_color, color)
Feel free to refine this approach based on your understanding and the specific requirements.
If you encounter any issues or need further assistance, please don't hesitate to ask. We look forward to your contribution and thank you again for helping improve the YOLOv5 project!
from yolov5.
@glenn-jocher I understand, but the source code of ultralytics.utils.Annotator.box_label()
is not in this repository, ultralytics
is a dependency library of this project. Do you mean i should rewrite the Annotator
class and put it in this repository then replace the one which currently used in detect.py
?
from yolov5.
Hello @jackwolfey,
Thank you for your insightful question and for your willingness to contribute to the YOLOv5 project!
You are correct that the ultralytics.utils.Annotator.box_label()
function is part of the ultralytics
library, which is a dependency of the YOLOv5 project. Given this, it would be more appropriate to contribute your enhancements directly to the ultralytics
repository rather than modifying the YOLOv5 repository itself.
Here’s how you can proceed:
- Fork the Ultralytics Repository: Fork the Ultralytics repository to your GitHub account.
- Clone the Repository: Clone your fork to your local machine.
- Create a New Branch: Create a new branch for your feature.
- Implement the Changes: Modify the
Annotator
class, specifically thebox_label
method, to ensure that labels and confidence thresholds do not run outside the image boundary. - Test Your Changes: Ensure that your changes work as expected and do not introduce any new issues.
- Submit a PR: Push your changes to your fork and submit a Pull Request (PR) to the main Ultralytics repository.
Here’s a basic example of how you might adjust the label position within the box_label
function:
def box_label(self, box, label='', color=(128, 128, 128), txt_color=(255, 255, 255)):
# Existing code to draw the box and label
# ...
# Adjust label position if it is too close to the image boundary
label_x, label_y = box[:2]
label_width, label_height = self.get_text_size(label)
if label_x + label_width > self.img.shape[1]:
label_x = self.img.shape[1] - label_width
if label_y + label_height > self.img.shape[0]:
label_y = self.img.shape[0] - label_height
# Draw the adjusted label
self.draw_text((label_x, label_y), label, txt_color, color)
By contributing directly to the ultralytics
repository, your improvements will benefit all projects that depend on this library, including YOLOv5.
If you encounter any issues or need further assistance, please don't hesitate to ask. We look forward to your contribution and thank you again for helping improve the Ultralytics ecosystem!
from yolov5.
@glenn-jocher Thanks for your reply, related pr see ultralytics/ultralytics#13959 (comment)
from yolov5.
Hello @jackwolfey,
Thank you for your proactive engagement and for referencing the related PR. We appreciate your initiative to contribute to the project!
To ensure we can effectively address the issue, could you please provide a minimum reproducible code example? This will help us understand the context and reproduce the bug on our end. You can find guidelines for creating a minimum reproducible example here. This step is crucial for us to investigate and resolve the issue accurately.
Additionally, please verify that you are using the latest versions of torch
and the YOLOv5 repository. Sometimes, updating to the latest versions can resolve unexpected issues.
Thank you again for your contribution and for helping us improve the YOLOv5 project. If you have any further questions or need additional assistance, feel free to ask. We're here to help!
from yolov5.
Closing this issue as it has been resolved.
from yolov5.
Hello @jackwolfey,
Thank you for your proactive engagement and for referencing the related PR. We appreciate your initiative to contribute to the project!
To ensure we can effectively address the issue, could you please provide a minimum reproducible code example? This will help us understand the context and reproduce the bug on our end. You can find guidelines for creating a minimum reproducible example here. This step is crucial for us to investigate and resolve the issue accurately.
Additionally, please verify that you are using the latest versions of torch
and the YOLOv5 repository. Sometimes, updating to the latest versions can resolve unexpected issues.
Thank you again for your contribution and for helping us improve the YOLOv5 project. If you have any further questions or need additional assistance, feel free to ask. We're here to help!
from yolov5.
Related Issues (20)
- 关于yolov5在mac设备上使用mps加速出现的各种问题 HOT 2
- RuntimeError: Caught RuntimeError in replica 0 on device 0 HOT 2
- How to modify the network structure of the YOLOv5 classification model HOT 4
- 'RandomSampler' object has no attribute 'set_epoch' HOT 2
- Hyperparameters explanation HOT 4
- Suppress torch.hub.load() Output HOT 8
- How can I save the detections Yolov5 makes when he's working with a camera source? HOT 4
- How to specify yolov5 to train multiple folders? HOT 1
- pulling out model's layer intermediates HOT 2
- Continuous training of a Ultralytics Model HOT 4
- Exporting trained yolov5 model (trained on custom dataset) to 'saved model' format changes the no. of classes and the name of classes to default coco128 values HOT 2
- more details about training procedure HOT 4
- divide the objects into small and large categories based on the size of the bonding boxes HOT 8
- Request for YOLOv5 v6.2 Source Code under GPL-3.0 License HOT 4
- What prevents me from using the AMP function? HOT 4
- What prevents me from using the AMP function? HOT 1
- What prevents me from using the AMP function? HOT 1
- Background annotation HOT 6
- Hi @7rkMnpl, HOT 2
- Multiple GPU Hyperparameter evolution HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5.