ultralytics / yolov5

YOLOv5 πŸš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
51.02k stars 16.41k forks source link

close mosaic in yolov5 #13324

Open ChenJian7578 opened 2 months ago

ChenJian7578 commented 2 months ago

Search before asking

Question

in v8, ultralytics/cfg/default.yaml. there have the parameter close_mosaic to close the mosaic in the last few epochs of training, so how can i Implement this functionality in v5?

Additional

No response

UltralyticsAssistant commented 2 months ago

πŸ‘‹ Hello @ChenJian7578, thank you for your interest in YOLOv5 πŸš€! This is an automated response, and an Ultralytics engineer will assist you soon.

To address your question about the mosaic augmentation parameter available in YOLOv8, and how to implement similar functionality in YOLOv5, please refer to our ⭐️ YOLOv5 Tutorials. These guides cover various topics such as Custom Data Training which might help you adapt augmentations to your needs.

If this is a πŸ› Bug Report, please provide a minimum reproducible example to assist us in troubleshooting.

For custom training or ❓ questions, include as much info as possible, like dataset examples and training logs, and verify you’re following our Training Tips.

Requirements

Ensure that Python>=3.8.0 is installed with all dependencies from requirements.txt, including PyTorch>=1.8. To set up, you can run:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 can run in diverse environments, such as:

Status

Check the CI status here: YOLOv5 CI If it's green, all tests are passing.

Introducing YOLOv8 πŸš€

Explore our latest model, YOLOv8, designed for enhanced accuracy and efficiency. Check our YOLOv8 Docs to start:

pip install ultralytics

Happy exploring! 😊

pderrenger commented 1 week ago

@ChenJian7578 to disable mosaic augmentation in YOLOv5 during the last few epochs, you can modify the training script to adjust the mosaic parameter in the data augmentation settings. You can manually set it to False in the hyp.scratch-low.yaml file or adjust it dynamically in the training loop. For more detailed guidance, you might want to explore the training scripts and augmentation settings in the repository.