-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support empty label fields #2471
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request modifies the Sequence diagram for processing label fields with empty labelssequenceDiagram
participant A as Albumentations
participant L as LabelManager
A->>A: _process_label_fields(data, data_name)
loop for each label_field in label_fields
A->>L: process_field(data_name, label_field, data[label_field])
L-->>A: encoded_labels (empty)
alt encoded_labels.size > 0
A->>A: np.hstack((data_array, encoded_labels))
else encoded_labels.size == 0
A->>A: data_array (no change)
end
end
A-->>A: return data_array
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @sklum - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a test case that covers the scenario with empty labels.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
What do you mean? You can pass images, and no any other labels to nearly every transform. |
If e.g. the bounding boxes are an empty tensor (i.e.
|
Here's an MRE which should hopefully clarify my use case. Is this not idiomatic?
|
For my use case, it's valuable to be able to train on images without any labels of any kind as a part of a batch. This change allows that.
Summary by Sourcery
Enhancements: