Closed yeldarby closed 2 months ago
Hi @yeldarby, if you are okay with it, can I work on this issue?
Hi @yeldarby 👋🏻 Thanks for pointing this out. It's funny how this bug flew under the radar for so long. As for RichLabelAnnotator,
it uses Pillow for text rendering, and in that case, as_rgb
is the expected behavior (I just tested this).
@Bhavay-2001, feel free to open PR to fix this issue. I assign this issue to you. Let me know if you need any help.
@yeldarby fix is merged into develop
. I'm closing the issue. Feel free to re-open it if you'll face more problems.
Awesome work @Bhavay-2001!
Search before asking
Bug
LabelAnnotator is using
to_rgb
instead ofto_bgr
for the text color so the channels get mixed up. Usingtext_color = sv.Color.RED
produces blue labels.Environment
Minimal Reproducible Example
Colab: https://colab.research.google.com/drive/1DVjQ4ETQK2o4CUqMGD8rBaLSxOu7KE4o#scrollTo=_Czi4iAkPt01
Additional
Pretty sure this is the culprit: https://github.com/roboflow/supervision/blob/e76dec7e1518cd286ea7391caf3a5766bbda1890/supervision/annotators/core.py#L1155
Looking at the file it also seems like it might affect RichLabelAnnotator (though that uses
to_rgb
both for the background and the text).Are you willing to submit a PR?