Comments (6)
@b4u365 hello! It sounds like you want to expand your model's capabilities to detect both new and existing classes. To achieve this, you'll need to train on a dataset that includes all desired classes β both the default ones like cars and pedestrians, and your custom classes like road signs and traffic barrels.
Hereβs a quick guide:
-
Dataset Preparation: Combine your custom dataset with a dataset containing the default YOLO classes. Ensure each class is properly labeled.
-
Training: When setting up your training configuration in YOLOv5, update the
*.yaml
file to include all classes (default and custom). This means adjusting the number of classes and providing the names of each class. -
Model Training: Use the command to start training, ensuring to specify the path to your combined dataset and updated
*.yaml
file.
This approach ensures that the model learns to detect both old and new classes together. Good luck with your training! π
from yolov5.
from yolov5.
@b4u365 hi Bharath,
Glad to hear the previous advice was helpful! Regarding your question about freezing layers:
-
Option A (Freezing Layers): Freezing most of the layers and only training the last few can indeed help in transferring the learned features from the large dataset used in yolov5s.pt. This approach is faster and consumes less computational resources. However, it might limit the model's ability to adapt to the new classes in your custom dataset.
-
Option B (Training All Layers): This option allows the model to better adapt to the new data, potentially improving accuracy for your custom classes at the expense of more extensive computation and training time.
Given your goal of retaining the original quality of yolov5s.pt while adding new capabilities, I'd recommend starting with Option A to leverage the pre-trained features and then, if necessary, fine-tuning with Option B based on the performance and results you observe.
Best of luck with your training! π
from yolov5.
from yolov5.
Hi Bharath,
It sounds like freezing the layers might be too restrictive for adapting to your new classes while maintaining performance on the original ones. I recommend gradually unfreezing some of the earlier layers to allow more flexibility in learning features relevant to both new and existing classes. You can start by unfreezing earlier layers incrementally and observing the impact on performance.
Here's a modified command to unfreeze some earlier layers:
python train.py --freeze 10 11 12 13 14 15 16 18 19 21 22
This approach strikes a balance between leveraging pre-trained features and adapting to new data. Let's see how this adjustment works out! π
from yolov5.
π 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:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
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 β
from yolov5.
Related Issues (20)
- What prevents me from using the AMP functionοΌ HOT 1
- Background annotation HOT 6
- Hi @7rkMnpl, HOT 2
- Multiple GPU Hyperparameter evolution HOT 5
- Marking YOLOv5 Detection Text Outputs with TP or FP HOT 4
- Multiple threads using yolov5 model concurrent inference failed HOT 4
- Detect head structure differs HOT 4
- runs\train\exp10 is not a directory HOT 12
- Similar mAP when splitting data into train, val and test HOT 4
- Syntax and understanding questions about reading tensorflow lite results HOT 1
- A Error which blast my mind.... HOT 1
- Yolov5 Int8 export in PyTorch HOT 10
- Video inference with YOLOv5 model in python HOT 3
- How to disable or add new scales of prediction? HOT 5
- Installation on Windows 7 32 bits HOT 3
- Artificial Neural Network - interpreting model.save output HOT 1
- Origin of warmup_bias_lr? HOT 3
- Silicon Mac GPU Support for training HOT 1
- Split features map of data HOT 1
- incorrect detections for cars after fine-tuning yolov5l HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5.