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: resolves #57 : add support for "arrangement" option in plot_annotation method #59

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

Conversation

janaab11
Copy link

@janaab11 janaab11 commented Jul 5, 2021

def plot_annotation(..., arrangement="pack"):
    ...

When arrangement is:

  • pack: follows default grouping, by timestamps only
  • stack: groups segments by their label. Each label gets a distinct line

@hbredin
Copy link
Member

hbredin commented Jul 8, 2021

Thanks! Will definitely have a look at this PR but with summer vacations coming up, I cannot promise any ETA...

Copy link
Member

@hbredin hbredin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took a long time but I finally managed to have a closer look at the code.

I think I'd prefer the API to look like this:

from pyannote.core import notebook
notebook.set_arrangement("stack")  # defaults to "pack"

This way, it can also be used directly by Jupyter Notebook cells returning Annotation instances, without having to call plot_annotation manually.

See Segment.set_precision for ideas on how to implement this API

pyannote/core/notebook.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants