mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
* chore: import Model from package root * chore: import Inference from package root
1.9 KiB
1.9 KiB
In [ ]:
from pyannote.database import get_protocol, FileFinder
protocol = get_protocol('Debug.SpeakerDiarization.Debug',
preprocessors={"audio": FileFinder()})In [ ]:
from pyannote.audio.tasks import VoiceActivityDetection
from pyannote.audio.models.segmentation.debug import SimpleSegmentationModel
import pytorch_lightning as pl
vad = VoiceActivityDetection(protocol, duration=2., batch_size=32, num_workers=4)
model = SimpleSegmentationModel(task=vad)
trainer = pl.Trainer(max_epochs=1, default_root_dir='sharing/')
_ = trainer.fit(model)In [ ]:
from pyannote.audio import Model
model = Model.from_pretrained('sharing/lightning_logs/version_0/checkpoints/epoch=0-step=3.ckpt')
assert isinstance(model, SimpleSegmentationModel)
# checkpoint should work with a URL as well (it relies on pl_load)