-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[IconAnnotator] - Add IconAnnotator to Mark Objects with Custom Icons/Images #930
base: develop
Are you sure you want to change the base?
[IconAnnotator] - Add IconAnnotator to Mark Objects with Custom Icons/Images #930
Conversation
* Add test for icon annotator, with sample test files to verify
Hi @dfreilich 👋🏻 ! Thank you very much for your interest in Supervision.
|
|
||
# The current positions of the anchors don't account for annotations that | ||
# have mass. This visually centers the anchor, given the size of the icon | ||
x_offset = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about handling other cases? I assume that in appropriate cases, we should align to the left, to the center, and to the right. Do we also plan to support y_offset
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was most glaring in the center case, which is why I handled it. I can also handle it in left/right cases as well, to make sure that it's outside of the bounds or on the boundary itself. y_offset
we definitely can add (albeit we'll need to be careful to make sure it doesn't run into conflict with boundaries of the image), but I was waiting to get feedback from the project on whether x_offset
was desired first before adding it
* Update docs
* Simplify code to remove unnecessary comments * Make code style and sample code fit with other patterns in file * Raise exception if invalid icon
@SkalskiP Thanks for the review! I addressed the comments, and removed the unit tests I had created. With regards to the changes in acceptance.md, I assumed that it didn't make sense to add the supervision/docs/annotators.md Lines 8 to 27 in 8599345
media.roboflow.com , like the rest of the examples, but I can add one if you'd like.
|
Description
This PR adds an IconAnnotator class, which can annotate images. For best results, the icon should be a transparent icon without a background, so that it will come up clearly against any images.
Some open questions for discussion:
I'd love to hear your thoughts on it.
A Collab notebook which demonstrates the change is here
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
This change includes a unit test (the first created for annotations) to verify that the annotation works, and the result closely matches a so-called golden file
Docs
Closes #460