Coder Social home page Coder Social logo

Comments (6)

glenn-jocher avatar glenn-jocher commented on September 26, 2024

@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:

  1. Dataset Preparation: Combine your custom dataset with a dataset containing the default YOLO classes. Ensure each class is properly labeled.

  2. 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.

  3. 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.

b4u365 avatar b4u365 commented on September 26, 2024

from yolov5.

glenn-jocher avatar glenn-jocher commented on September 26, 2024

@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.

b4u365 avatar b4u365 commented on September 26, 2024

from yolov5.

glenn-jocher avatar glenn-jocher commented on September 26, 2024

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.

github-actions avatar github-actions commented on September 26, 2024

πŸ‘‹ 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 ⭐

from yolov5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.