Skip to content

Instantly share code, notes, and snippets.

View alunkingusw's full-sized avatar

Alun King alunkingusw

View GitHub Profile
@alunkingusw
alunkingusw / gist:75ac37c44ca5b00ed9fdd5f50b391afa
Created June 20, 2025 20:12
Whisper & Pyannote Transcription segment by segment
import logging
# Configure logging level and format
logging.basicConfig(
level=logging.INFO, # options: DEBUG, INFO, WARNING, ERROR, CRITICAL
format='%(asctime)s [%(levelname)s] %(message)s',
handlers=[
logging.StreamHandler() # prints to console
]
)
@alunkingusw
alunkingusw / gist:2eb29682a98f94a714d10080ed0f4896
Last active June 28, 2025 06:09
Speaker diarisation with Whisper & Pyannote using pyannote-whisper. Then speaker labelling using pyannote/embedding
import logging
# Configure logging level and format
logging.basicConfig(
level=logging.INFO, # options: DEBUG, INFO, WARNING, ERROR, CRITICAL
format='%(asctime)s [%(levelname)s] %(message)s',
handlers=[
logging.StreamHandler() # prints to console
]
)
@alunkingusw
alunkingusw / gist:4275a26ba79cefd49f5a2e91d91c4da2
Last active June 16, 2025 08:42
Performing diarization on an audio file and comparing embeddings of known speakers.
!pip install -qq pyannote.audio
from datetime import datetime
from pyannote.core import Segment
from subprocess import CalledProcessError, run
from pyannote.audio import Pipeline
from pyannote.audio.core.model import Model # Import Model
import os
import torch # Import torch
from pyannote.audio import Inference
from sklearn.preprocessing import normalize