diart.blocks.base#

Module Contents#

Classes#

HyperParameter

Represents a pipeline hyper-parameter that can be tuned by diart

PipelineConfig

Configuration containing the required

Pipeline

Represents a streaming audio pipeline

Attributes#

class diart.blocks.base.HyperParameter#

Represents a pipeline hyper-parameter that can be tuned by diart

name: Text#

Name of the hyper-parameter (e.g. tau_active)

low: float#

Lowest value that this parameter can take

high: float#

Highest value that this parameter can take

static from_name(name)#

Create a HyperParameter object given its name.

Parameters:

name (str) – Name of the hyper-parameter

Return type:

HyperParameter

diart.blocks.base.TauActive#
diart.blocks.base.RhoUpdate#
diart.blocks.base.DeltaNew#
class diart.blocks.base.PipelineConfig#

Bases: abc.ABC

Configuration containing the required parameters to build and run a pipeline

abstract property duration: float#

The duration of an input audio chunk (in seconds)

Return type:

float

abstract property step: float#

The step between two consecutive input audio chunks (in seconds)

Return type:

float

abstract property latency: float#

The algorithmic latency of the pipeline (in seconds). At time t of the audio stream, the pipeline will output predictions for time t - latency.

Return type:

float

abstract property sample_rate: int#

The sample rate of the input audio stream

Return type:

int

get_file_padding(filepath)#
Parameters:

filepath (diart.audio.FilePath) –

Return type:

Tuple[float, float]

class diart.blocks.base.Pipeline#

Bases: abc.ABC

Represents a streaming audio pipeline

abstract property config: PipelineConfig#
Return type:

PipelineConfig

abstract static get_config_class()#
Return type:

type

abstract static suggest_metric()#
Return type:

pyannote.metrics.base.BaseMetric

abstract static hyper_parameters()#
Return type:

Sequence[HyperParameter]

abstract reset()#
abstract set_timestamp_shift(shift)#
Parameters:

shift (float) –

abstract __call__(waveforms)#

Runs the next steps of the pipeline given a list of consecutive audio chunks.

Parameters:

waveforms (Sequence[SlidingWindowFeature]) – Consecutive chunk waveforms for the pipeline to ingest

Returns:

For each input waveform, a tuple containing the pipeline output and its respective audio

Return type:

Sequence[Tuple[Any, SlidingWindowFeature]]