ultralytics / yolov5

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

How to off the augmentation function??? #5421

Closed LEEGILJUN closed 2 years ago

LEEGILJUN commented 2 years ago

Hello

I'd like to experiment with the augmentation function turned off.

Also, I want to experiment with the augmente function turned on and the mosaic function off.

This is because I want to know the performance difference between the use of the augmentation method and the mosaic in the data I use.

I know to control hyp in hyp.yaml. if I changed "mosaic: 1.0 # image mosaic (probability)" to "mosaic: 0.0 # image mosaic (probability)". it is turned off the mosaic function??????

or

like below photo, if i change this function augment=True -> augment=False, it is turned off the augmentation???

image

Thanks

glenn-jocher commented 2 years ago

@LEEGILJUN 👋 Hello! Thanks for asking about image augmentation. YOLOv5 🚀 applies online imagespace and colorspace augmentations in the trainloader (but not the testloader) to present a new and unique augmented Mosaic (original image + 3 random images) each time an image is loaded for training. Images are never presented twice in the same way.

YOLOv5 augmentation

The hyperparameters used to define these augmentations are in your hyperparameter file (default data/hyp.scratch.yaml) defined when training:

python train.py --hyp hyp.scratch.yaml

https://github.com/ultralytics/yolov5/blob/90b7895d652c3bd3d361b2d6e9aee900fd67f5f7/data/hyp.scratch.yaml#L1-L33

You can view the effect of your augmentation policy in your train_batch*.jpg images once training starts. These images will be in your train logging directory, typically yolov5/runs/train/exp:

train_batch0.jpg shows train batch 0 mosaics and labels:

Good luck and let us know if you have any other questions!

github-actions[bot] commented 2 years ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

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 YOLOv5 🚀 and Vision AI ⭐!