Skip to content

Problem with custom_color_lookup on annotate function #1031

Description

@Youho99

Search before asking

  • I have searched the Supervision issues and found no similar feature requests.

Question

I'm using supervision for a project (currently I'm using supervision version 0.19)

I use the annotate() function of sv.BoundingBoxAnnotator() for example

When I use it with only the required parameters, it works correctly.

My goal is to customize the colors of the bboxes.
Actually, I'm using Streamlit, and I have one colorpicker per class created. I know how to retrieve its value (I retrieve it in hexadecimal code).
So I want to use the optional variable custom_color_lookup. However, I can't understand in what format I should pass my custom color values to it.

Let's imagine, I have 2 classes and I want to put these 2 custom colors:
custom_colors = ['#3ab63f', '#459af5']

How should I transform this variable in order to pass it without error into the optional custom_color_lookup variable of the annotate() function?

Thanks for your help

Additional

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions