Skip to content

LineZoneAnnotator make display of int/out values optional - #802

Merged
SkalskiP merged 4 commits into
roboflow:developfrom
Kadermiyanyedi:make-display-values-optional
Jan 30, 2024
Merged

SkalskiP merged 4 commits into
roboflow:developfrom
Kadermiyanyedi:make-display-values-optional

Conversation

@Kadermiyanyedi

@Kadermiyanyedi Kadermiyanyedi commented Jan 28, 2024 •

Copy link
Copy Markdown
Contributor

Description

LineZoneAnnotator has two new boolean parameters, display_in_count and display_out_count, to the functions display_in_count and display_on_count. When set to True, these parameters display the input/output values. (Fix: #792)

To optimize performance and avoid unnecessary mathematical calculations when the values are not displayed, I encapsulated these calculations within a separate function.

For testing purposes, please refer to the provided Colab link.

Type of change

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

Changes Made:

Added two boolean parameters, display_in_count and display_out_count, to display_in_count and display_on_count functions.
Implemented conditional logic to display input/output values based on the boolean parameters.
Moved unnecessary mathematical calculations to a separate function to optimize performance.

Example Output: Google Drive Link

Please review thank you :)

@CLAassistant

CLAassistant commented Jan 28, 2024 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@onuralpszr
onuralpszr self-requested a review January 28, 2024 21:20
@onuralpszr onuralpszr added enhancement New feature or request good first issue Good for newcomers API:linezone LineZone API labels Jan 28, 2024
@Kadermiyanyedi Kadermiyanyedi changed the title Make display of int/out values optional Make display of int/out values optional #802 Jan 28, 2024
@onuralpszr onuralpszr changed the title Make display of int/out values optional #802 LineZoneAnnotator make display of int/out values optional Jan 28, 2024
@onuralpszr onuralpszr added this to the version: 0.19.0 milestone Jan 28, 2024
@SkalskiP

Copy link
Copy Markdown
Collaborator

Hi @Kadermiyanyedi 👋🏻! The logic looks good.

I like that you decided to extract the drawing of the text using a separate method. Could we go a step further? We already have draw_text function, and we could use it here.

Comment thread supervision/detection/line_counter.py Outdated
Comment thread supervision/detection/line_counter.py Outdated
Comment thread supervision/detection/line_counter.py Outdated
…_count method and add center method to vector
Comment thread supervision/geometry/core.py Outdated
Comment thread supervision/draw/utils.py Outdated
Comment thread supervision/detection/line_counter.py Outdated
Comment thread supervision/detection/line_counter.py Outdated
@SkalskiP

Copy link
Copy Markdown
Collaborator

Awesome job @Kadermiyanyedi! 🔥 I left a few more comments, but we are close. I think we should be done after this.

@Kadermiyanyedi

Copy link
Copy Markdown
Contributor Author

@SkalskiP @onuralpszr I resolved all comments, can you review again please :)

@SkalskiP

SkalskiP commented Jan 30, 2024 •

Copy link
Copy Markdown
Collaborator

@Kadermiyanyedi, could you make your Google Colab public? The code looks good I just want to confirm everything works :)

@Kadermiyanyedi

Copy link
Copy Markdown
Contributor Author

@Kadermiyanyedi, could you make your Google Colab public? The code looks good I just want to confirm everything works :)

I updated Colab link, now you can access it :)

@onuralpszr

Copy link
Copy Markdown
Contributor

Tests are passed that looks good.

Comment thread supervision/detection/line_counter.py Outdated
@onuralpszr

Copy link
Copy Markdown
Contributor

Collab also works perfectly fine on my end.

@SkalskiP

Copy link
Copy Markdown
Collaborator

Awesome! @Kadermiyanyedi, thanks a lot for your help! 🙏🏻 We are merging!

Are you on LinkedIn?

@SkalskiP
SkalskiP merged commit 6147b6e into roboflow:develop Jan 30, 2024
@Kadermiyanyedi

Copy link
Copy Markdown
Contributor Author

@onuralpszr Thank you, you've been very helpful in assigning the relevant task and aiding my understanding of the project

@SkalskiP Thank you very much for taking the time to provide feedback and review. Your comments are highly valuable

@SkalskiP

Copy link
Copy Markdown
Collaborator

My pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API:linezone LineZone API enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LineZoneAnnotator] - make the display of in/out values optional

4 participants