-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
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
yolov5 Python package? #2481
Comments
👋 Hello @sheromon, 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 screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at [email protected]. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm sad that my issue is stale. No one wants to talk about the pip package? :-( |
@sheromon hi buddy, yes we wanted to create a yolov5 pip package, but the yolov5 package name was actually taken by another unrelated party before we were able to register a package, so we've gone ahead and registered the In the meantime I've advised the yolov5 package author that it would be ideal if they could mirror as closely as possible the PyTorch Hub usage and workflow with the pip package. @fcakyon @sheromon if it were up to me, the yolov5 pip package would essentially be line-replaceable with torch.hub (for single-codebase maintenance and documentation, among other reasons) i.e.: PyTorch Hubimport torch
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
# Image
img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
# Inference
results = model(img) ideal
|
@glenn-jocher Sorry for the delay, I will make the interface similar to this as soon as possible. |
Thanks for the response, @glenn-jocher and @fcakyon. I'll be honest and say that I'm actually not familiar with PyTorch Hub. My primary suggestion/request is just to include I can submit a PR to just add |
@glenn-jocher new release supports hub-like interface https://github.com/fcakyon/yolov5-pip/releases/tag/5.0.0 |
@fcakyon wow awesome, nice work! Fast response too. |
@sheromon sure, PR is always welcome, and that way it makes it clear what update you are suggesting! |
Wow, very nice, @fcakyon! @glenn-jocher, I hopped over to https://github.com/fcakyon/yolov5-pip/tree/5.0.0 and took a quick look, and it looks like what I'd wanted to add is already incorporated over there. Uhh... It is a bit confusing that the fcakyon/yolov5-pip repo has those changes, and the ultralytics/yolov5 repo doesn't. Any plans to consolidate or reasons why it makes sense to have them be separate? |
@sheromon hey buddy, feel free to submit PRs for any features or bug fixes you have in mind! |
I mean... I could submit a PR with the changes in fcakyon/yolov5-pip to this repo... It feels like a weird thing to do, so I figured I'd ask about it first. |
But yeah, I'll definitely submit a PR for a straightforward bug or enhancement. |
@sheromon sure sounds good! What changes did you have in mind exactly? If it's something specific and short a PR is probably a great idea. If it's more complex probably raising a feature request issue is a better idea to discuss. |
@glenn-jocher, right, so what I was hoping for when I opened this issue is to have yolov5 be a Python package with its own namespace. I see that this has already been done in fcakyon/yolov5-pip. If you are not incorporating all of the changes from fcakyon/yolov5-pip into this repo, then I'd like to suggest at least a small subset of those changes, specifically including the yolov5 directory and namespace for import statements. I'm working on the changes and can open a PR soon. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🚀 Feature
First of all, thanks for your great work on this object detector! I have started using it recently, and I found it very easy to get started with training and testing.
It would be nice to be able to pip install the yolov5 code and import yolov5 modules without having to add the code directory to the path, in the way that many Python packages work. I was going to request that this repo become a Python package on PyPI, but I found that now there is a yolov5 Python package there associated with this repo, and then I was confused that it appears to be maintained by someone who is not a contributor to this repo. Then I found #2240 where you tell someone that you were working on a PyPI package, but someone else did it first. That seems like not an appropriate thing to do without collaborating with the repository owners?
Were you all still planning to release a PyPI package? I was originally going to offer to help, which is why I checked PyPI first, and then I fell down this rabbit hole.
Motivation
I would like to be able to import modules without having to do custom set up steps like modifying EVs. I saw from past issues like #134 and #353 that other people have had the same issue. In addition to removing the requirement to update the path, another benefit is that if there were a yolov5 Python package with its own namespace, it would prevent potential collisions when importing, like if someone had a "models" or "utils" directory in their Python path. It would be clear if imports were something like "from yolov5.models.experimental import ..." instead of "from models.experimental import ...".
Pitch
I would like to have the yolov5 repository be its own Python package with its own namespace for importing modules.
Alternatives
I suppose the alternative is to leave things as they are.
The text was updated successfully, but these errors were encountered: