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

feat: 🚀 Add default color to PolygonZoneAnnotator, drawing functions #1591

Merged
merged 6 commits into from
Oct 12, 2024

Conversation

DivyaVijay1234
Copy link
Contributor

@DivyaVijay1234 DivyaVijay1234 commented Oct 11, 2024

Description

Default Colors Added: Default colors were added to utility functions such as drawLine, drawRectangle, drawPolygon, and PolygonZoneAnnotator.
Documentation: Documentation was added to explain the changes and usage of the new default colors.

Fix: #1587

Type of change

  • New feature (non-breaking change which adds functionality)

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Preview

Preview and run these notebook edits with Google Colab: Rendered notebook diffs available on ReviewNB.com. If commits are added to the pull request, synchronize your local branch: git pull origin develop

@@ -9,7 +9,7 @@


def draw_line(
scene: np.ndarray, start: Point, end: Point, color: Color, thickness: int = 2
scene: np.ndarray, start: Point, end: Point, color: Color=Color(163, 81, 251), thickness: int = 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use our color scheme in like "sv.Color.WHITE" for all them. You can find them in here

def WHITE(cls) -> Color:

@onuralpszr
Copy link
Collaborator

@DivyaVijay1234 please accept CLA and please check my review and after that we can move on thank you.

@onuralpszr onuralpszr added bug Something isn't working enhancement New feature or request hacktoberfest Open for contributions during the annual Hacktoberfest event, aimed at encouraging open-source parti labels Oct 11, 2024
@DivyaVijay1234
Copy link
Contributor Author

@onuralpszr Which of those colours would you like me to use as the default colour?

@onuralpszr
Copy link
Collaborator

@onuralpszr Which of those colours would you like me to use as the default colour?

Change all of "your" changes to default color like "white" I wrote in comment

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 11, 2024

Hi @DivyaVijay1234 👋

Thank you for the contribution!

Which of those colours would you like me to use as the default colour?

The default color we prefer is Color.ROBOFLOW. I see you set the values for it, but that's in fact not necessary. You can simply replace Color(r, g, b) with Color.ROBOFLOW.

@DivyaVijay1234
Copy link
Contributor Author

@onuralpszr @LinasKo
Thank you for guidance. Please confirm if I need to make any further changes or if the issue has now been solved.

@onuralpszr
Copy link
Collaborator

@onuralpszr @LinasKo Thank you for guidance. Please confirm if I need to make any further changes or if the issue has now been solved.

push code please :)

@DivyaVijay1234
Copy link
Contributor Author

Please check if the changes I made are now visible. Thank you.

@onuralpszr onuralpszr self-requested a review October 11, 2024 20:33
@onuralpszr onuralpszr changed the title feat-Added Default color feat: 🚀 Add default color to PolygonZoneAnnotator, drawing functions Oct 12, 2024
@onuralpszr
Copy link
Collaborator

@DivyaVijay1234 I made some small documentation additions and also add white color to other annotator you missed with documentations, thank you for your contribution I am merging in this and close the issue as complete as well.

cc @LinasKo

@onuralpszr
Copy link
Collaborator

I made some fixes on PR title and comment part to be more descriptive so that everyone else can understand what is going on in here as well.

Copy link
Collaborator

@onuralpszr onuralpszr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@onuralpszr onuralpszr merged commit 9b35f8c into roboflow:develop Oct 12, 2024
10 checks passed
@DivyaVijay1234
Copy link
Contributor Author

@onuralpszr Thank you!

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 12, 2024

@onuralpszr , the documentation updates are helpful, but I'm confused why PolygonAnnotator got white as the default color. Does this also pick it for text boxes? Otherwise, the line should be roboflow-colored.

@onuralpszr
Copy link
Collaborator

onuralpszr commented Oct 12, 2024

@onuralpszr , the documentation updates are helpful, but I'm confused why PolygonAnnotator got white as the default color. Does this also pick it for text boxes? Otherwise, the line should be roboflow-colored.

The reason I used white because I wanted to follow LineZoneAnnotator also using white lines

https://supervision.roboflow.com/latest/detection/tools/line_zone/#supervision.detection.line_zone.LineZoneAnnotator-functions

__init__(thickness=2, color=Color.WHITE, text_thickness=2, text_color=Color.BLACK, text_scale=0.5, text_offset=1.5, text_padding=10, custom_in_text=None, custom_out_text=None, display_in_count=True, display_out_count=True, display_text_box=True, text_orient_to_line=False, text_centered=True) 

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 13, 2024

@onuralpszr , that makes sense! I did not notice that. Thank you for the guidance and PR resolution!

@onuralpszr
Copy link
Collaborator

@onuralpszr , that makes sense! I did not notice that. Thank you for the guidance and PR resolution!

Pleasures 🙏 ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request hacktoberfest Open for contributions during the annual Hacktoberfest event, aimed at encouraging open-source parti
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add default color: PolygonZoneAnnotator, drawing functions
4 participants