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: Added detection metadata #1589

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

souhhmm
Copy link

@souhhmm souhhmm commented Oct 10, 2024

Description

As per,

implemented detection metadata and updated related methods. Please let me know if anything needs to be fixed/changed.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (probably)

How has this change been tested, please provide a testcase or example of how you tested the change?

Here's the link to the colab that tests the implemented code.

Additional Notes

In the current implementation, is_empty returns True even when a detection has a non empty metadata. When two empty detections with metadata are merged, the metadata is retained in the merge, with everything else being empty. If this is not how it is intended to work, simply adding empty_detections.metadata = self.metadata in is_empty retains metadata in the merge, however, this returns False when metadata is non empty (with everything else being empty).

@CLAassistant
Copy link

CLAassistant commented Oct 10, 2024

CLA assistant check
All committers have signed the CLA.

@souhhmm souhhmm mentioned this pull request Oct 11, 2024
@souhhmm
Copy link
Author

souhhmm commented Oct 13, 2024

Hey @LinasKo, it says the 'Welcome Workflow' check has failed. Is this the reason the review has been halted?

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 13, 2024

It's a mistake on our part. Don't worry about that one 😉

@LinasKo LinasKo self-requested a review October 13, 2024 08:23
@souhhmm
Copy link
Author

souhhmm commented Oct 15, 2024

Hey @LinasKo, any updates/feedback?

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 15, 2024

On it, on it. This one will take time, likely the whole week. It can have consequences across the repo, so I must be very careful.

@souhhmm
Copy link
Author

souhhmm commented Oct 15, 2024

No worries, take your time.

supervision/detection/core.py Outdated Show resolved Hide resolved
supervision/detection/core.py Outdated Show resolved Hide resolved
supervision/detection/core.py Show resolved Hide resolved
supervision/detection/utils.py Show resolved Hide resolved
@LinasKo
Copy link
Collaborator

LinasKo commented Oct 15, 2024

I've made some comments. I like your changes so far!

It shows you've thought through the problem, in places like introducing of optional variable in empty, while avoiding the pitfall of incorrectly defaulting to {}.

@souhhmm
Copy link
Author

souhhmm commented Oct 15, 2024

Thanks for the feedback, I'll make the required changes soon. :)

@souhhmm souhhmm requested a review from LinasKo October 16, 2024 06:23
@souhhmm
Copy link
Author

souhhmm commented Oct 16, 2024

Hey @LinasKo, I have made the required changes. Please let me know about further changes/fixes. Thanks :)

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 17, 2024

That looks good.

For each contribution moving forward, the next step is to create a Colab notebook to test the changes. This should include generating Detections with and without metadata to demonstrate how it works, and testing with various values. It’s a bit simpler than unit testing, and it also serves as a reference for future regression testing.

Got any time for that, @souhhmm? There's a Starter Template you may use 😉

@souhhmm
Copy link
Author

souhhmm commented Oct 17, 2024

I had linked a colab in the og PR, linking once again. But now that I have changed some code, I'll re-run it. Any particular tests you'd like me to include that I might not have included @LinasKo?

Edit: I've re-ran the testcases.

@LinasKo
Copy link
Collaborator

LinasKo commented Oct 18, 2024

Hi @souhhmm 👋

My apologies, I missed your Colab. That is indeed an amazing set of tests.
I'll take over from this point - there's a few checks I need to do before I merge this.

Thank you for a great contribution!

@LinasKo LinasKo added the hacktoberfest-accepted Contribute to the notion of open-source this October! label Oct 18, 2024
@LinasKo LinasKo linked an issue Oct 18, 2024 that may be closed by this pull request
@souhhmm
Copy link
Author

souhhmm commented Oct 18, 2024

No worries, thanks to you too for your great feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Contribute to the notion of open-source this October!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detections Metadata
3 participants