Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ValueError: RGBA values should be within 0-1 range #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion utils/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -1276,4 +1277,4 @@ def get_output(self):
output (VisImage): the image output containing the visualizations added
to the image.
"""
return self.output
return self.output