apply data augmentations on specific classs #1005
Open
+43
β5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
apply data augmentations while model training, lets say I want to add flip-up effect to id 2,5,7 & other class with other effects we can do this easily
π€ Generated by Copilot at 777fb93
Summary
π΄ββοΈπΆββοΈπ§
Modified
Albumentations
class to enable class-specific augmentations for COCO dataset. This aims to enhance the YOLO model's detection of person and bicycle classes.Walkthrough
aug_ids
toAlbumentations
class to specify class IDs for specific augmentations (link)T_0_1
for person and bicycle, andT_other
for the rest (link)Compose
objects for the two sets of augmentations and assign them totransform_0_1
andtransform_other
attributes (link)__call__
method (link)LOGGER.info
statements to print the augmentations for each set separately (link)π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Key Changes
__init__
method now accepts anaug_ids
parameter for specifying which class IDs to apply specific augmentations to.__call__
method has been updated to apply different augmentations based on the class labels of the data.π― Purpose & Impact
The purpose of these changes is to enable more granular control over how data augmentations are applied, allowing specific transformations to be applied to certain classes. This can lead to improved model performance, especially in cases where some classes benefit from specific types of augmentation. Users can expect enhanced flexibility in customizing augmentations and potentially better model generalization by tailoring augmentations to the needs of individual classes.
π Summary
Apply targeted data augmentations to specific classes for enhanced model training flexibility. π¨βοΈπ