Feature/random masking on images tests #1138
Merged
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.
This pull request adds several new image transformation classes to the
langtest/transform/image/robustness.py
file, enhancing the robustness testing capabilities for visual QA tasks. The most significant changes include the addition of multiple transformation classes and the inclusion of new image manipulation utilities.New image transformation classes:
ImageTranslate
class to apply translation transformations to images.ImageShear
class to apply shear transformations to images.ImageBlackSpot
class to corrupt images by adding black spots.ImageLayeredMask
class to apply layered mask transformations with optional flipping.ImageTextOverlay
class to overlay text on images.ImageWatermark
class to apply watermark transformations to images.Enhancements to image manipulation utilities:
ImageDraw
module to support drawing operations required by the new transformations.Literal
type import to support type annotations for specific string values.