diart.sinks#

Module Contents#

Classes#

RTTMWriter

Base class for implementations of the Observer class. This base

PredictionAccumulator

Base class for implementations of the Observer class. This base

StreamingPlot

Base class for implementations of the Observer class. This base

Functions#

exception diart.sinks.WindowClosedException#

Bases: Exception

Common base class for all non-exit exceptions.

diart.sinks._extract_prediction(value)#
Parameters:

value (Union[Tuple, pyannote.core.Annotation]) –

Return type:

pyannote.core.Annotation

class diart.sinks.RTTMWriter(uri, path, patch_collar=0.05)#

Bases: rx.core.Observer

Base class for implementations of the Observer class. This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.

Parameters:
  • uri (Text) –

  • path (Union[pathlib.Path, Text]) –

  • patch_collar (float) –

patch()#

Stitch same-speaker turns that are close to each other

on_next(value)#

Notify the observer of a new element in the sequence.

Parameters:

value (Union[Tuple, pyannote.core.Annotation]) –

on_error(error)#

Notify the observer that an exception has occurred.

Parameters:

error (Exception) – The error that occurred.

on_completed()#

Notifies the observer of the end of the sequence.

class diart.sinks.PredictionAccumulator(uri=None, patch_collar=0.05)#

Bases: rx.core.Observer

Base class for implementations of the Observer class. This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.

Parameters:
  • uri (Optional[Text]) –

  • patch_collar (float) –

patch()#

Stitch same-speaker turns that are close to each other

get_prediction()#
Return type:

pyannote.core.Annotation

on_next(value)#

Notify the observer of a new element in the sequence.

Parameters:

value (Union[Tuple, pyannote.core.Annotation]) –

on_error(error)#

Notify the observer that an exception has occurred.

Parameters:

error (Exception) – The error that occurred.

on_completed()#

Notifies the observer of the end of the sequence.

class diart.sinks.StreamingPlot(duration, latency, visualization='slide', reference=None)#

Bases: rx.core.Observer

Base class for implementations of the Observer class. This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.

Parameters:
  • duration (float) –

  • latency (float) –

  • visualization (typing_extensions.Literal[slide, accumulate]) –

  • reference (Optional[Union[pathlib.Path, Text]]) –

_on_window_closed(event)#
_init_num_axs()#
_init_figure()#
_clear_axs()#
get_plot_bounds(real_time)#
Parameters:

real_time (float) –

Return type:

pyannote.core.Segment

on_next(values)#

Notify the observer of a new element in the sequence.

Parameters:

values (Tuple[pyannote.core.Annotation, pyannote.core.SlidingWindowFeature, float]) –