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

apply data augmentations on specific classs #1005

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

akashAD98
Copy link
Contributor

@akashAD98 akashAD98 commented Feb 16, 2023

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.

We face the doom of the COCO dataset
The person and the bicycle elude our sight
We unleash the Albumentations wrath
To enhance our YOLO model's might

Walkthrough

  • Add optional argument aug_ids to Albumentations class to specify class IDs for specific augmentations (link)
  • Define two sets of augmentations for different classes: T_0_1 for person and bicycle, and T_other for the rest (link)
  • Create two Compose objects for the two sets of augmentations and assign them to transform_0_1 and transform_other attributes (link)
  • Apply different augmentations depending on the class labels of the input image and bounding boxes in __call__ method (link)
  • Update LOGGER.info statements to print the augmentations for each set separately (link)

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

πŸ“Š Key Changes

  • Introduction of class-specific data augmentations within the Albumentations class.
  • Default augmentations are defined for two class IDs (0 and 1), while other classes get a separate set of default augmentations.
  • The __init__ method now accepts an aug_ids parameter for specifying which class IDs to apply specific augmentations to.
  • The __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. πŸŽ¨βœ‚οΈπŸ“ˆ

apply data augmentations while model training, lets say i want to add flipup effect to id 2,5,7 & other class with other effect we can do this easily
@github-actions
Copy link

github-actions bot commented Feb 16, 2023

CLA Assistant Lite bot All Contributors have signed the CLA. βœ…

@AyushExel
Copy link
Contributor

I don't understand a few things.

  • ids are hardcoded so that'll break the default behavior and only apply augmentation to 0,1 classes.
  • The default values of augmentation are changed.
  • Some augmentations are commented out
  • call method is implemented twice

@akashAD98
Copy link
Contributor Author

@AyushExel ill fix it

@akashAD98
Copy link
Contributor Author

I have read the CLA Document and I sign the CLA

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

Successfully merging this pull request may close these issues.

None yet

2 participants