-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added smart positioning (non overlapping labels) to VertexLabelAnnotator #1625
Conversation
917bb9c
to
a2e2e37
Compare
Accepting this based on the videos. I sense there's a lot of reviewing to do 🙂 Would you be able to create a Colab showcasing the usage? |
* Alos, refactored RichLabelAnnotator so its structure matches LabelAnnotator
* Vectorized * Using forces rather than discrete steps * Move along secondary axis more
…ays for passing data
… to 'smart_position'
…elf.smart_position:`
I've witnessed that the new algo sometimes produces more jerky motions of the label when applied to the video. I pushed the most stable combination I could find, but there's definitely room for improvement. Merging this in! Thank you very much, @kshitijaucharmal, @SkalskiP! |
Description
Resolved issue #1383 regarding overlapping labels in output.
Changes Done in VertexLabelAnnotator, LabelAnnotator and RichLabelAnnotator
No Extra dependencies used
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?
Have added an optional argument to the VertexLabelAnnotator called
use_smart_positioning
which defaults toFalse
.Enabling this prevents overlapping.
Before:
overlapping.mp4
After:
VertexLabelAnnotator:
smart.mp4
Label Annotator:
labelanno_smart.mp4
Rich Label Annotator (font: Vampire Wars):
rich_label_smart.mp4
Any specific deployment considerations
For example, documentation changes, usability, usage/costs, secrets, etc.
Docs
Collab Link: https://colab.research.google.com/drive/1GPHr7PpZ_eNs8Gkxx_A4w6PL5p4pJAn1?usp=sharing#scrollTo=ZHptw0Fk4lk4