Open unraxesy opened 2 weeks ago
👋 Hello @unraxesy, 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.
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
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
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.
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
@unraxesy hello!
Thank you for your detailed questions regarding running YOLOv5 inference on a Raspberry Pi 4 Model B. Let's address each of your queries:
Repository Setup on Raspberry Pi:
git clone https://github.com/ultralytics/yolov5
cd yolov5
pip install -r requirements.txt
This ensures you have the latest version of YOLOv5 and all necessary dependencies. You can then copy your custom model (best.pt
), data.yaml
, and any other custom files to the appropriate directories within this cloned repository.
Updating Local Repository:
git pull origin master
pip install -r requirements.txt
This will fetch and integrate the latest changes from the YOLOv5 GitHub repository.
Model Loading for Inference:
model = torch.hub.load("ultralytics/yolov5", "custom", path="path/to/best.pt")
or
model = torch.hub.load("path/to/yolov5", "custom", path="path/to/best.pt", source="local")
The first command loads the model from the Ultralytics GitHub repository, while the second command loads it from your local repository. If you have made custom modifications to the YOLOv5 code, you should use the local source option.
Handling Custom Files (data.yaml
and custom_yolov5s.yaml
):
data.yaml
or custom model configuration files unless explicitly specified in your training or inference commands. Ensure that your data.yaml
and custom model configuration files are correctly referenced in your scripts. For example, during training, you would specify the path to data.yaml
:
python train.py --data path/to/data.yaml --cfg path/to/custom_yolov5s.yaml --weights path/to/best.pt
For more detailed guidance on exporting and using YOLOv5 models, you can refer to the YOLOv5 Model Export Tutorial.
If you encounter any issues or have further questions, please provide a minimum reproducible example as outlined here. This will help us better understand and address your concerns.
Best of luck with your project on the Raspberry Pi! 😊
Search before asking
Question
Hi everyone and @glenn-jocher ! I have my own custom model
best.pt
that have been trained with my custom dataset. The dataset is done using Roboflow and the model is trained with Google Colab (local). All the data after training was saved on my PC. Now, I want to try inference on my Raspberry Pi, but I got some questions.QUESTIONS
model = torch.hub.load("ultralytics/yolov5", "custom", path="path/to/best.pt")
ormodel = torch.hub.load("path/to/yolov5", "custom", path="path/to/best.pt", source="local")
if I want to try inference on Raspberry Pi? What is the difference between using local resource and ultralytics/yolov5?data.yaml
(/yolov5/datasets/data.yaml) andcustom_yolov5s.yaml
(/yolov5/models/custom_yolov5s.yaml). Is YOLOv5 automatically called them? Because we don't define them unlikebest.pt
.Thank you!
Additional
No response