-
-
Notifications
You must be signed in to change notification settings - Fork 16k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to cancel the data augmentation of letterbox during training? #6122
Comments
@jayer95 letterboxing is a method for fitting an image within a constrained space dictated by the model requirements. You can modify the arguments into the function here: Lines 91 to 122 in db6ec66
|
Hi @glenn-jocher , Do you mean to make this function an "argument" and add "--letterbox false" to the instruction during training? Can I just delete this "letterbox" function (yolov5/utils/augmentations.py)? I'm currently training with "--rect" and I don't need "letterbox". |
@jayer95 letterbox function adapts input images to meet minimum stride length constraints. It is required. |
@glenn-jocher In order to make up the remainder of the width and height for multiple of 32. |
@glenn-jocher |
Hi @glenn-jocher , |
@jayer95 you can customize the letterbox arguments or code if you'd like. |
Hi author, after our in-depth research, we understand the mosaic parameters and letterbox practices you use during training. I would like to ask you about letterbox when inference (detect.py), python detect.py --source demo_h264.mp4 --weights runs/train/exp7/weights/last.pt --imgsz 320 demo_h264.mp4 ---> 1920x1080, landscape video 1/1 (136/140) /home/gvsai/yolov5/demo_h264.mp4: 192x320 1 license plate, Done. (0.008s) I looked at your code, you are filling the gray border of (114,114,114) up and down to make up the multiple of 32, as shown below, May I ask why you don't fill all of them on the top, or all of them on the bottom, as shown in the image below? May I ask whether you have proved through experiments that fill the top and bottom are the best because of the mosaic parameters during training? |
@jayer95 the current letterbox implementation provides the best results compared to the alternatives, i.e. the decision making process was informed via empirical results. |
@glenn-jocher Thanks for your quick reply. |
👋 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 ⭐! |
Search before asking
Question
I know that yolov5 introduced "letterbox" data augmentation and many hyperparameters to increase the strength of the model, but I need to do an experiment.
As title, how can I cancel the data augmentation of "letterbox" during training?
The images size of my training dataset is all 1920x1080. I want to do an experiment to cancel the data augmentation "letterbox" made by yolov5 during training, and resize all 1920x1080 images to 640x640, even if the images are distorted due to resizing.
I checked the argument options and hyperparameters before training, but it did not have the switch of "letterbox", or I missed an important code, please guide me, thank you.
I know that one argument is "--rect", and I don't mean rectangular training.
Additional
No response
The text was updated successfully, but these errors were encountered: