-
Notifications
You must be signed in to change notification settings - Fork 47
[AI-1190] Implement and test augmentations #665
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
[AI-1190] Implement and test augmentations #665
Conversation
AI-1190 Implement and test augmentations
This task is about implementing and benchmarking augmentations for model training. We will first test it for object detection on HF models and benchmark against not using augmentations. If this improve model performance, let's generate a more general solution where any integration can import and use the augmentations. |
|
Updated title so that it's easier for me on deployment 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes look good to me.
Edit: noticed something in a second pass. See below.
almazan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments need to be addressed before approval
darwin/torch/transforms.py
Outdated
| boxes = torch.as_tensor(boxes, dtype=torch.float32).reshape(-1, 4) | ||
| boxes[:, 2:] += boxes[:, :2] | ||
| boxes[:, 0::2].clamp_(min=0, max=w) | ||
| boxes[:, 1::2].clamp_(min=0, max=h) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not clamping bboxes anymore, since now indexes 2 and 3 are height and width instead of x2 and y2. Boxes now could go outside of the image.
Problem
We want to introduce the possibility to use Albumentation transforms with darwin-py torch datasets.
Solution
Introducing an
AlbumentationsTransformclass in torch.transforms that can be be used in the following manner:One can initilize the
AlbumentationsTransformin three ways:To read more about the dictionary and file formats supported, we refer to the albumentations documentation.
Further.
cocoformat (X, Y, W, H) to be consistent with darwin-json annotations and the ObjectDetecion torch dataset. [BREAKING CHANGE]Changelog
pascal_voctococoformat (X, Y, H, W)