-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add pydantic #1605
Add pydantic #1605
Conversation
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 @ternaus - I've reviewed your changes and they look great!
General suggestions:
- Consider simplifying the implementation by integrating configuration directly into the transformation classes to reduce complexity.
- Ensure comprehensive test coverage for the new configuration models, including their custom validators and edge cases.
- Review the relationship between
quality_lower
andquality_upper
inImageCompressionConfig
to ensure it's validated within the config class. - Add unit tests for the new
ImageCompressionType
enum to verify serialization and deserialization.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 3 issues found
- 🟡 Complexity: 1 issue found
- 🟢 Docstrings: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
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.
empty file
always_apply: bool = False, | ||
p: float = 0.5, | ||
): | ||
config = BaseTransformConfig(always_apply=always_apply, p=p) |
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 must be inside BasicTransform.__init__
raise ValueError(f"Grid dimensions must be positive integers. Current grid dimensions: [{n}, {m}]") | ||
|
||
self.grid = grid | ||
config = RandomGridShuffleConfig(grid=grid, always_apply=always_apply, p=p) |
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.
Maybe we can do this using metcaclasses...
Look SerializableMeta as an example https://github.com/albumentations-team/albumentations/blob/main/albumentations/core/serialization.py#L44
No description provided.