ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.57k stars 16.31k forks source link

Yolov5 classifier ,some training images are being centre cropped #12756

Closed humairaneha closed 7 months ago

humairaneha commented 8 months ago

Search before asking

Question

I don't want this behaviour. I have resized my image to 224*224,but during training the images are being cropped ,so most information of the images are being lost. what to do?

Additional

No response

glenn-jocher commented 8 months ago

@humairaneha hello! Thanks for reaching out. If you're observing that your images are being center-cropped during training, it's likely due to the data augmentation settings in the YOLOv5 data pipeline.

To prevent center-cropping, you can adjust the augmentation settings in your dataset's YAML file. Specifically, you'll want to look at the augment section and modify the parameters related to cropping, such as mosaic, mixup, and random crop settings. Set these to false or adjust their probabilities to 0 to disable them.

For more detailed guidance on how to configure your data augmentations, please refer to the documentation at https://docs.ultralytics.com/yolov5/.

Remember, any changes to the augmentation settings can affect the model's ability to generalize, so it's a good idea to monitor your model's performance on a validation set after making adjustments.

Happy training! 😊

github-actions[bot] commented 7 months ago

👋 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 ⭐