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:
Added ImageTranslate class to apply translation transformations to images.
Added ImageShear class to apply shear transformations to images.
Added ImageBlackSpot class to corrupt images by adding black spots.
Added ImageLayeredMask class to apply layered mask transformations with optional flipping.
Added ImageTextOverlay class to overlay text on images.
Added ImageWatermark class to apply watermark transformations to images.
Enhancements to image manipulation utilities:
Imported ImageDraw module to support drawing operations required by the new transformations.
Added Literal type import to support type annotations for specific string values.
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.