-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
code for the yaml file #13515
Comments
👋 Hello @rmarkovic00, thank you for your interest in YOLOv5 🚀 and for your question regarding custom dataset configuration! It looks like you're trying to set up your YAML file for training YOLOv5 on a custom dataset. Here's some general guidance:
If this is a 🐛 Bug Report, we kindly ask you to provide a minimum reproducible example (MRE), including details on reproducible YAML configurations, relevant code snippets, debugging logs, and any other information to help us diagnose the issue more effectively 🚀. Additional ResourcesPlease also refer to our ⭐️ Tutorials for more guidance:
RequirementsYour environment should meet the following:
To verify installation, run: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install Verified EnvironmentsYOLOv5 supports the following environments for training and running models:
StatusTo check current CI status, click below: An Ultralytics engineer will assist you as soon as possible. Let us know if you have additional questions in the meantime! 😊 |
Thank you very much! |
@rmarkovic00 When creating a custom dataset, there is no need to align your custom classes with COCO classes. You can define your own class names and structure, such as: nc: 3
names: [person, car, truck] # or [car, person, truck] or [truck, person, car] – the order doesn't matter However, you must ensure that the labeling data is correctly aligned with the class names in your dataset. For example, if your labels are:
Then, the names: [person, car, truck] Any CNN or ML model does not directly deal with class names—it only uses them for one-hot encoding and for human readability. |
Search before asking
Question
Hi, I'm trying to pre-train the yolov5m model downloaded from the ultralitics site on my custom dataset which has 3 classes: car,truck person. Is it necessary to match the class ID with the class ID of the coco dataset in yaml file? For example:
yaml file:
train: /path_to_train_images/
val: /path_to_val_images/
nc: 8 # Broj klasa od 0 do 7 (moraš uključiti sve klase do najvećeg ID-a!)
names: ["Person", "Unknown", "Car", "Unknown", "Unknown", "Unknown", "Unknown", "Truck"]
or its just okej like this:
yaml file:
train: /path_to_train_images/
val: /path_to_val_images/
nc: 8
names: ["Person", "Unknown", "Car", "Unknown", "Unknown", "Unknown", "Unknown", "Truck"]
because in coco dataset person has ID=0 car=2 and truck=7.
Additional
No response
The text was updated successfully, but these errors were encountered: