[go: nahoru, domu]

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

Add corner_radius to sv.LabelAnnotator to handle roundness of label edges. #1037

Merged
merged 6 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
modified to use new custom method for rectangle drawing
  • Loading branch information
xaristeidou committed Mar 24, 2024
commit ed3c73eb02afc6d2685b87d83b4ab8b73eff9dc8
3 changes: 2 additions & 1 deletion supervision/annotators/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,12 +1084,13 @@ def annotate(
text_x = text_background_xyxy[0] + self.text_padding
text_y = text_background_xyxy[1] + self.text_padding + text_h

cv2.rectangle(
self.draw_rounded_rectangle(
img=scene,
pt1=(text_background_xyxy[0], text_background_xyxy[1]),
pt2=(text_background_xyxy[2], text_background_xyxy[3]),
color=color.as_bgr(),
thickness=cv2.FILLED,
corner_radius=self.corner_radius
)
cv2.putText(
img=scene,
Expand Down