Skip to content
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

Regarding the application establishment of preprocessing functions #13305

Open
1 task done
K011-17 opened this issue Sep 11, 2024 · 1 comment
Open
1 task done

Regarding the application establishment of preprocessing functions #13305

K011-17 opened this issue Sep 11, 2024 · 1 comment
Labels
question Further information is requested

Comments

@K011-17
Copy link

K011-17 commented Sep 11, 2024

Search before asking

Question

YOLOv5 has various preprocessing functions, such as the Albumations library, mosaic, mixup, random_perspective, etc. If you look at the hyp file, you will see the parameters for each preprocessing function as shown below.

lr0: 0.01 # initial learning rate (SGD=1E-2, Adam=1E-3)
lrf: 0.01 # final OneCycleLR learning rate (lr0 * lrf)
momentum: 0.937 # SGD momentum/Adam beta1
weight_decay: 0.0005 # optimizer weight decay 5e-4
warmup_epochs: 3.0 # warmup epochs (fractions ok)
warmup_momentum: 0.8 # warmup initial momentum
warmup_bias_lr: 0.1 # warmup initial bias lr
box: 0.05 # box loss gain
cls: 0.5 # cls loss gain
cls_pw: 1.0 # cls BCELoss positive_weight
obj: 1.0 # obj loss gain (scale with pixels)
obj_pw: 1.0 # obj BCELoss positive_weight
iou_t: 0.20 # IoU training threshold
anchor_t: 4.0 # anchor-multiple threshold
# anchors: 3  # anchors per output layer (0 to ignore)
fl_gamma: 0.0 # focal loss gamma (efficientDet default gamma=1.5)
hsv_h: 0.015 # image HSV-Hue augmentation (fraction)
hsv_s: 0.7 # image HSV-Saturation augmentation (fraction)
hsv_v: 0.4 # image HSV-Value augmentation (fraction)
degrees: 0.0 # image rotation (+/- deg)
translate: 0.1 # image translation (+/- fraction)
scale: 0.5 # image scale (+/- gain)
shear: 0.0 # image shear (+/- deg)
perspective: 0.0 # image perspective (+/- fraction), range 0-0.001
flipud: 0.0 # image flip up-down (probability)
fliplr: 0.5 # image flip left-right (probability)
mosaic: 1.0 # image mosaic (probability)
mixup: 0.0 # image mixup (probability)
copy_paste: 0.0 # segment copy-paste (probability)

I think this represents the parameters of each preprocessing.
But are preprocessing processes themselves applied definite? For example, are random_perspective and mosaic applied 100% to all images in each epoch? Or is there some probability of application?
I would be grateful for your reply. Thanks in advance.

Additional

No response

@K011-17 K011-17 added the question Further information is requested label Sep 11, 2024
@glenn-jocher
Copy link
Member

@K011-17 preprocessing functions like random_perspective and mosaic in YOLOv5 are applied based on the probabilities specified in the hyperparameters file. For example, if mosaic is set to 1.0, it will be applied to all images, while a lower value indicates a reduced probability. You can adjust these probabilities to control the application frequency. For more details, refer to the YOLOv5 documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants