From 4be2fe5b546090c065121d2125db5c4b01910816 Mon Sep 17 00:00:00 2001 From: Kalyan Chakravarthy Date: Fri, 8 Nov 2024 15:32:11 +0530 Subject: [PATCH] refactor ImageTextOverlay class to improve text drawing readability --- langtest/transform/image/robustness.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langtest/transform/image/robustness.py b/langtest/transform/image/robustness.py index 507a4bda1..dc7cb5819 100644 --- a/langtest/transform/image/robustness.py +++ b/langtest/transform/image/robustness.py @@ -449,7 +449,10 @@ def transform( draw = ImageDraw.Draw(sample.perturbed_image) font = ImageFont.load_default() draw.text( - position, text, font=font, fill=font_color, + position, + text, + font=font, + fill=font_color, ) return sample_list