mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
7.0 KiB
7.0 KiB
In [1]:
import os
os.environ['PYANNOTE_DATABASE_CONFIG'] = '/Users/bredin/Development/pyannote/pyannote-audio/tests/data/database.yml'In [2]:
from pyannote.database import get_protocol, FileFinder
protocol = get_protocol('Debug.SpeakerDiarization.Debug',
preprocessors={"audio": FileFinder()})In [3]:
from pyannote.audio.tasks.voice_activity_detection.task import VoiceActivityDetection
vad = VoiceActivityDetection(protocol, duration=2., batch_size=32, num_workers=4)In [4]:
from pyannote.audio.models.debug import SimpleSegmentationModel
model = SimpleSegmentationModel(task=vad)In [5]:
import pytorch_lightning as pl
trainer = pl.Trainer(max_epochs=10)
_ = trainer.fit(model, vad)GPU available: False, used: False TPU available: False, using: 0 TPU cores | Name | Type | Params ------------------------------------------ 0 | mfcc | MFCC | 0 1 | lstm | LSTM | 18 K 2 | classifier | Linear | 130 3 | activation | LogSoftmax | 0 /Users/bredin/miniconda3/envs/pyannote-audio-v2/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py:45: UserWarning: Your `IterableDataset` has `__len__` defined. In combination with multi-processing data loading (e.g. batch size > 1), this can lead to unintended side effects since the samples will be duplicated. warnings.warn(*args, **kwargs)
HBox(children=(HTML(value='Training'), FloatProgress(value=1.0, bar_style='info', layout=Layout(flex='2'), max…
In [6]:
from pyannote.audio.tasks.speaker_tracking.task import SpeakerTracking
spk = SpeakerTracking(protocol, duration=2., batch_size=32, num_workers=2)In [7]:
model = SimpleSegmentationModel(task=spk)In [8]:
trainer = pl.Trainer(max_epochs=10)
_ = trainer.fit(model, spk)GPU available: False, used: False TPU available: False, using: 0 TPU cores | Name | Type | Params --------------------------------------- 0 | mfcc | MFCC | 0 1 | lstm | LSTM | 18 K 2 | classifier | Linear | 1 K 3 | activation | Sigmoid | 0 /Users/bredin/miniconda3/envs/pyannote-audio-v2/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py:45: UserWarning: The dataloader, train dataloader, does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` (try 4 which is the number of cpus on this machine) in the `DataLoader` init to improve performance. warnings.warn(*args, **kwargs)
HBox(children=(HTML(value='Training'), FloatProgress(value=1.0, bar_style='info', layout=Layout(flex='2'), max…
In [9]:
from pyannote.audio.tasks.speaker_verification.task import SpeakerEmbeddingArcFace
emb = SpeakerEmbeddingArcFace(protocol, duration=2., batch_size=32, num_workers=4)In [10]:
from pyannote.audio.models.debug import SimpleEmbeddingModel
model = SimpleEmbeddingModel(task=emb)In [11]:
trainer = pl.Trainer(max_epochs=10)
_ = trainer.fit(model, emb)GPU available: False, used: False TPU available: False, using: 0 TPU cores | Name | Type | Params ------------------------------ 0 | mfcc | MFCC | 0 1 | lstm | LSTM | 18 K
HBox(children=(HTML(value='Training'), FloatProgress(value=1.0, bar_style='info', layout=Layout(flex='2'), max…