ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.45k stars 16.28k forks source link

About ultralytics CLI and Python commands #11621

Closed penguin1109 closed 1 year ago

penguin1109 commented 1 year ago

Search before asking

Question

Is it possible that the training results or strategies can be different from when we used the (1) Python commands, like model = YOLO("yolov8n.pt") and (2) CLI commands like python train.py, when I am using the cloned github repository??

I am currently working on a computer vision task for object detection using ColabPRO. The validation accuracy was similar while training, but the test accuracy scored differently. - Using the Python commands were higher.

Is this actually possible? Might there be any different features behind the two commands?

Thank you.

Additional

No response

github-actions[bot] commented 1 year ago

👋 Hello @penguin1109, 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.7.0 with all requirements.txt installed including PyTorch>=1.7. 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):

Status

YOLOv5 CI

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
glenn-jocher commented 1 year ago

@penguin1109 hello!

Yes, there is a possibility that the training results or strategies can be different when using the Python commands versus the CLI commands, even when using the cloned Github repository. This is because the Python commands and the CLI commands can have different default settings and arguments, and the behavior of the two commands can vary slightly.

Regarding the difference in test accuracy that you observed, it's hard to say exactly what may be causing the difference without more information. However, one possibility is that the Python command you used might have set different training parameters or performed extra training steps that affected the test accuracy.

For more information about the difference between the Python commands and the CLI commands, you might want to review the YOLOv5 documentation or post a more specific question in our discussions.

Thank you for using YOLOv5 and please let us know if you have any other questions!

penguin1109 commented 1 year ago

Thanks for your response!

But the reason I wish to use yolo by cloning the github repository is because Inwish to customize the classifier, loss function, or the augmentations.

Is it still possible when installing the library?

glenn-jocher commented 1 year ago

@penguin1109 yes, you can still customize the classifier, loss function, or augmentations even if you clone the YOLOv5 Github repository. In fact, cloning the repository and modifying the code can give you even more flexibility and control over the training process.

When you clone the repository, you have access to all the source code and can edit it as needed. You can modify the existing loss functions or create your own custom ones. Similarly, you can customize the existing augmentations or add your own transformations.

Overall, cloning the YOLOv5 Github repository gives you more freedom and control over the training process than simply installing the library.

Please let us know if you have any other questions or concerns.

penguin1109 commented 1 year ago

Oh, I was asking if it is possible to customize even when I use the ultryatics library by 'pip install ultyratics', not cloning the git repo!

i apologize for the confusion.

glenn-jocher commented 1 year ago

@penguin1109 hello!

Yes, you can still customize the classifier, loss function or augmentations when using the YOLOv5 library installed via pip install ultralytics. You can use the parameters and options provided by the functions and classes in the library to modify the training process. Additionally, the library has a flexible API that allows you to use custom data loaders, augmentations and loss functions which can be specified during the training process.

Please let us know if you have any other questions or concerns.

Thank you.

github-actions[bot] commented 1 year ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐