From 236c2fa9706134b8705a8b1cdc883bb7ac4452cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gustavo=20A=2E=20Amorim?= Date: Mon, 29 Apr 2024 18:19:42 -0300 Subject: [PATCH] fix up031 --- kornia/utils/image_print.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kornia/utils/image_print.py b/kornia/utils/image_print.py index 09099c1b5d..738564fb72 100644 --- a/kornia/utils/image_print.py +++ b/kornia/utils/image_print.py @@ -334,7 +334,7 @@ def rgb2short(rgb: str) -> Tuple[str, str]: res.append(closest) break i += 1 - _res = "".join([("%02.x" % i) for i in res]) + _res = "".join([(f"{i:02.0x}") for i in res]) equiv = RGB2SHORT_DICT[_res] return equiv, _res @@ -365,7 +365,7 @@ def image_to_string(image: Tensor, max_width: int = 256) -> str: r, g, b = image[:, y, x] h = f"{r:2x}{g:2x}{b:2x}" short, _ = rgb2short(h) - res += "\033[48;5;%sm " % short + res += f"\033[48;5;{short}m " res += "\033[0m\n" return res