All Projects → juanmc2005 → StreamingSpeakerDiarization

juanmc2005 / StreamingSpeakerDiarization

Licence: MIT License
Official open source implementation of the paper "Overlap-aware low-latency online speaker diarization based on end-to-end local segmentation"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to StreamingSpeakerDiarization

D-TDNN
PyTorch implementation of Densely Connected Time Delay Neural Network
Stars: ✭ 60 (-24.05%)
Mutual labels:  speaker-diarization, speaker-embedding
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-79.75%)
Mutual labels:  real-time
endurox-go
Application Server for Go (ASG)
Stars: ✭ 32 (-59.49%)
Mutual labels:  real-time
platyplus
Low-code, offline-first apps with Hasura
Stars: ✭ 22 (-72.15%)
Mutual labels:  real-time
apex
Apex RTOS - A (somewhat) Linux compatible real time operating system
Stars: ✭ 15 (-81.01%)
Mutual labels:  real-time
verse-blender
Blender Python Add-on with Verse integration
Stars: ✭ 36 (-54.43%)
Mutual labels:  real-time
mishka-cms
MishkaCms an open source and real time API base CMS Powered by Elixir and Phoenix
Stars: ✭ 37 (-53.16%)
Mutual labels:  real-time
reactors
Maintain state, incorporate change, broadcast deltas. Reboot on error.
Stars: ✭ 17 (-78.48%)
Mutual labels:  real-time
asana-webhooks-manager
Asana Webhooks Manager (AWM) is a free and open source management and event handling server, written in JavaScript (NodeJS, Angular) for Asana's webhooks API. Use AWM to manage webhooks subscriptions and accept event payloads from Asana in real-time. Want to create your own Asana Dashboard? Consider AWM as your starting point!
Stars: ✭ 23 (-70.89%)
Mutual labels:  real-time
ByteTrack
ByteTrack: Multi-Object Tracking by Associating Every Detection Box
Stars: ✭ 1,991 (+2420.25%)
Mutual labels:  real-time
Custom-Object-Detection-using-Darkflow
Make custom objects dataset and detect them using darkflow. Darkflow is a tensorflow translation of Darknet.
Stars: ✭ 21 (-73.42%)
Mutual labels:  real-time
XBotControl
XBotControl framework: XBotCore + OpenSoT + CartesI/O
Stars: ✭ 23 (-70.89%)
Mutual labels:  real-time
transform-hub
Flexible and efficient data processing engine and an evolution of the popular Scramjet Framework based on node.js. Our Transform Hub was designed specifically for data processing and has its own unique algorithms included.
Stars: ✭ 38 (-51.9%)
Mutual labels:  real-time
tally
🙋‍♀️Social voting app
Stars: ✭ 58 (-26.58%)
Mutual labels:  real-time
TorrentsDuck
A multi users bittorrents client with a responsive web UI that quacks 🦆
Stars: ✭ 42 (-46.84%)
Mutual labels:  real-time
briefmatch
BriefMatch real-time GPU optical flow
Stars: ✭ 36 (-54.43%)
Mutual labels:  real-time
IoT-Technical-Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,565 (+3146.84%)
Mutual labels:  real-time
ChatService
ChatService (SignalR).
Stars: ✭ 26 (-67.09%)
Mutual labels:  real-time
object-flaw-detector-python
Detect various irregularities of a product as it moves along a conveyor belt.
Stars: ✭ 17 (-78.48%)
Mutual labels:  real-time
mute-structs
MUTE-structs is a Typescript library that provides an implementation of the LogootSplit CRDT algorithm.
Stars: ✭ 14 (-82.28%)
Mutual labels:  real-time

PyPI GitHub top language GitHub code size in bytes GitHub


Demo

You can visualize the real-time speaker diarization of an audio stream with the built-in demo script.

Stream a recorded conversation

python -m diart.demo /path/to/audio.wav

Stream from your microphone

python -m diart.demo microphone

See python -m diart.demo -h for more information.

Build your own pipeline

Diart provides building blocks that can be combined to do speaker diarization on an audio stream. The streaming implementation is powered by RxPY, but the functional module is completely independent.

Example

Obtain overlap-aware speaker embeddings from a microphone stream

import rx
import rx.operators as ops
import diart.operators as myops
from diart.sources import MicrophoneAudioSource
import diart.functional as fn

sample_rate = 16000
mic = MicrophoneAudioSource(sample_rate)

# Initialize independent modules
segmentation = fn.FrameWiseModel("pyannote/segmentation")
embedding = fn.ChunkWiseModel("pyannote/embedding")
osp = fn.OverlappedSpeechPenalty(gamma=3, beta=10)
normalization = fn.EmbeddingNormalization(norm=1)

# Reformat microphone stream. Defaults to 5s duration and 500ms shift
regular_stream = mic.stream.pipe(myops.regularize_stream(sample_rate))
# Branch the microphone stream to calculate segmentation
segmentation_stream = regular_stream.pipe(ops.map(segmentation))
# Join audio and segmentation stream to calculate speaker embeddings
embedding_stream = rx.zip(regular_stream, segmentation_stream).pipe(
    ops.starmap(lambda wave, seg: (wave, osp(seg))),
    ops.starmap(embedding),
    ops.map(normalization)
)

embedding_stream.subscribe(on_next=lambda emb: print(emb.shape))

mic.read()

Output:

torch.Size([4, 512])
torch.Size([4, 512])
torch.Size([4, 512])
...

Install

  1. Create environment:
conda create -n diarization python==3.8
conda activate diarization
  1. Install the latest PyTorch version following the official instructions

  2. Install pyannote.audio 2.0 (currently in development)

pip install git+https://github.com/pyannote/pyannote-audio.git@develop#egg=pyannote-audio
  1. Install diart:
pip install diart

Powered by research

Diart is the official implementation of the paper Overlap-aware low-latency online speaker diarization based on end-to-end local segmentation by Juan Manuel Coria, Hervé Bredin, Sahar Ghannay and Sophie Rosset.

We propose to address online speaker diarization as a combination of incremental clustering and local diarization applied to a rolling buffer updated every 500ms. Every single step of the proposed pipeline is designed to take full advantage of the strong ability of a recently proposed end-to-end overlap-aware segmentation to detect and separate overlapping speakers. In particular, we propose a modified version of the statistics pooling layer (initially introduced in the x-vector architecture) to give less weight to frames where the segmentation model predicts simultaneous speakers. Furthermore, we derive cannot-link constraints from the initial segmentation step to prevent two local speakers from being wrongfully merged during the incremental clustering step. Finally, we show how the latency of the proposed approach can be adjusted between 500ms and 5s to match the requirements of a particular use case, and we provide a systematic analysis of the influence of latency on the overall performance (on AMI, DIHARD and VoxConverse).

Citation

If you found diart useful, please make sure to cite our paper:

Awaiting paper publication (ASRU 2021).

Reproducibility

Results table

To reproduce the results of the paper, use the following hyper-parameters:

Dataset latency tau rho delta
DIHARD III any 0.555 0.422 1.517
AMI any 0.507 0.006 1.057
VoxConverse any 0.576 0.915 0.648
DIHARD II 1s 0.619 0.326 0.997
DIHARD II 5s 0.555 0.422 1.517

For instance, for a DIHARD III configuration:

python -m diart.demo /path/to/file.wav --tau=0.555 --rho=0.422 --delta=1.517 --output /output/dir

And then to obtain the diarization error rate:

from pyannote.metrics.diarization import DiarizationErrorRate
from pyannote.database.util import load_rttm

metric = DiarizationErrorRate()
hypothesis = load_rttm("/output/dir/output.rttm")
hypothesis = list(hypothesis.values())[0]  # Extract hypothesis from dictionary
reference = load_rttm("/path/to/reference.rttm")
reference = list(reference.values())[0]  # Extract reference from dictionary

der = metric(reference, hypothesis)

For convenience and to facilitate future comparisons, we also provide the expected outputs in RTTM format for every entry of Table 1 and Figure 5 in the paper. This includes the VBx offline topline as well as our proposed online approach with latencies 500ms, 1s, 2s, 3s, 4s, and 5s.

Figure 5

License

MIT License

Copyright (c) 2021 Université Paris-Saclay
Copyright (c) 2021 CNRS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Logo generated by DesignEvo free logo designer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].