-
-
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
Setup.py and / or pypi package #2525
Comments
👋 Hello @Leon0402, 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. |
Perfect! As I said, personally it would also be a a lot easier if you just provide a setup.py -> This allows including the project in for example poetry by url. No need for pypi, although it is a nice extra :-)
Might look like this. I think that's all I need to use it with poetry (at least yolov5 version4 I think?). I can make a PR, but I thought it might make more sense if you do it. |
@Leon0402 hmm interesting. I hadn't thought of creating a setup.py other than for pypi. https://github.com/python-poetry looks interesting. Your setup.py file is very simple, are you sure that would be enough? We've been working on a similar one that's a bit more detailed here (for the TODO |
@Leon0402 also could you submit a PR for your idea? I think that would be helpful to understand it better. |
I'm not very experienced with setup.py or in general packaging in python. I pretty much did the minimal config I could come up with, so poetry would install all dependencies and find the packages. It's pretty much a subset of yours. I see just a few differences:
My poetry setup for yolov5 is just:
in pyproject.toml So I've cloned the project and added the setup.py in the root. The develop flag is so that poetry picks up changes I do for instance switching branches on yolov5. That's also why I didn't need a version in the setup.py If you consider using poetry: From my personal experience, poetry is a great idea and I use it in all my projects. The specification of dependencies along with automatic virtual environments just make it a lot easier for me. But it's not always super easy. It has some bugs. I also had problems with making my stuff cross plattform, especially with pytorch. It's not (completly) poetrys fault. It's mainly because different machines, different os, different python versions need different python packages and too often python packages for a specific os or python version are just missing on pypi. For instance pytorch (used to be) not available on pypi for Windows, but for all other platforms. But poetry doesn't do a good job at failing fast, giving good error messages and stuff like that. |
@Leon0402 interesting, thanks for the ideas! |
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
Add a setup.py or / and publish a package on pypi for easier use.
Motivation
It is often required in ordner to load the model to have the original source code. Furthermore, there are some useful scripts in here.
It would be a lot easier to set up a project using yolov5 if there were at least a setup.py file. Best case you would also upload it to pypi obviously.
For example: You could then use yolov5 with the package manager poetry, where you can specify a github repository.
Pitch
Alternatives
An alternative to uploading it to pypi is just using only a setup.py. That would be a huge improvement already and it's easy to implement.
You could obviously also use a package manager like poetry instead of a setup.py, which is easy to implement as well and can also do the uploading to pypi.
Additional context
The text was updated successfully, but these errors were encountered: