From f223d6446eb0b3feb27d066b75e4c95f9725592e Mon Sep 17 00:00:00 2001 From: Mohamad Al Mdfaa Date: Sat, 7 Sep 2024 00:34:09 +0300 Subject: [PATCH] fix: ValueError: RGBA values should be within 0-1 range --- utils/visualizer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/visualizer.py b/utils/visualizer.py index b6799ed..4a1008b 100644 --- a/utils/visualizer.py +++ b/utils/visualizer.py @@ -886,6 +886,7 @@ def draw_text( font_size = self._default_font_size # since the text background is dark, we don't want the text to be dark + color = np.clip(color, 0, 1) color = np.maximum(list(mplc.to_rgb(color)), 0.2) color[np.argmax(color)] = max(0.8, np.max(color)) @@ -1276,4 +1277,4 @@ def get_output(self): output (VisImage): the image output containing the visualizations added to the image. """ - return self.output \ No newline at end of file + return self.output