[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

LineZoneAnnotator make display of int/out values optional #802

Merged

Conversation

Kadermiyanyedi
Copy link
Contributor
@Kadermiyanyedi Kadermiyanyedi commented Jan 28, 2024

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
Copy link
CLAassistant commented Jan 28, 2024

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
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.

supervision/detection/line_counter.py Outdated Show resolved Hide resolved
supervision/detection/line_counter.py Outdated Show resolved Hide resolved
supervision/detection/line_counter.py Outdated Show resolved Hide resolved
…_count method and add center method to vector
supervision/geometry/core.py Outdated Show resolved Hide resolved
supervision/draw/utils.py Outdated Show resolved Hide resolved
supervision/detection/line_counter.py Outdated Show resolved Hide resolved
supervision/detection/line_counter.py Outdated Show resolved Hide resolved
@SkalskiP
Copy link
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
Contributor Author

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

@SkalskiP
Copy link
Collaborator
SkalskiP commented Jan 30, 2024

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

@Kadermiyanyedi
Copy link
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
Collaborator

Tests are passed that looks good.

@onuralpszr
Copy link
Collaborator

Collab also works perfectly fine on my end.

@SkalskiP
Copy link
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
8 checks passed
@Kadermiyanyedi
Copy link
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
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