$ show juanmc2005/diart
diart is a Python library and CLI tool for real-time online speaker diarization, built on top of pyannote.audio. It processes audio streams (microphone, files, WebSocket) with low latency using a modular pipeline of segmentation, embedding, clustering, and aggregation blocks. The library is designed for both streaming and offline evaluation, with support for overlap-aware processing and hyperparameter tuning via Optuna. It provides a reactive streaming architecture using RxPY, making it suitable for building AI-powered audio applications. The repository includes a benchmark suite, expected outputs for standard diarization datasets (AMI, DIHARD, VoxConverse), and CI/CD pipelines. While primarily a software library, it has a strong research component with published results and reproducibility artifacts.
The LLM identified 5 files worth highlighting for reuse:
Implements DelayedAggregation, a self-contained block that aggregates overlapping sliding-window outputs with configurable strategies (mean, hamming, first). This is a common pattern in streaming diarization and can be reused in any time-series streaming pipeline.
Provides SpeakerMap and SpeakerMapBuilder for aligning speaker labels across windows using distance, correlation, or MSE. This is a generic pattern for solving label permutation problems in clustering and can be extracted for other multi-object tracking or re-identification tasks.
Contains TemporalFeatureFormatter, which handles conversion between SlidingWindowFeature, numpy arrays, and torch tensors. This utility solves a common friction point in audio ML pipelines and can be reused in any project using pyannote-style features or sliding window data.
Defines custom RxPY operators for audio stream manipulation (e.g., buffer rearrangement, output accumulation). These operators demonstrate a clean pattern for building streaming data pipelines and can be reused in any RxPY-based audio or real-time system.
AudioLoader is a simple, self-contained utility for loading audio files with automatic resampling to a target sample rate. It wraps torchaudio and handles edge cases, making it reusable in any audio processing project.