Skip to content

Commit f383ec0

Browse files
committed
Fix annotation patch bug. Fix wrong config reference
1 parent 2734c04 commit f383ec0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/diart/pipelines.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ class OnlineSpeakerDiarization:
137137
def __init__(self, config: Optional[PipelineConfig] = None, profile: bool = False):
138138
self.config = PipelineConfig() if config is None else config
139139
self.profile = profile
140-
self.segmentation = blocks.SpeakerSegmentation(config.segmentation, config.device)
140+
self.segmentation = blocks.SpeakerSegmentation(self.config.segmentation, self.config.device)
141141
self.embedding = blocks.OverlapAwareSpeakerEmbedding(
142-
config.embedding, config.gamma, config.beta, norm=1, device=config.device
142+
self.config.embedding, self.config.gamma, self.config.beta, norm=1, device=self.config.device
143143
)
144-
self.speaker_tracking = OnlineSpeakerTracking(config)
145-
msg = f"Latency should be in the range [{config.step}, {config.duration}]"
146-
assert config.step <= config.latency <= config.duration, msg
144+
self.speaker_tracking = OnlineSpeakerTracking(self.config)
145+
msg = f"Latency should be in the range [{self.config.step}, {self.config.duration}]"
146+
assert self.config.step <= self.config.latency <= self.config.duration, msg
147147

148148
def from_audio_source(self, source: src.AudioSource) -> rx.Observable:
149149
operators = []

src/diart/sinks.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def __init__(self, patch_collar: float = 0.05):
5959

6060
def patch(self):
6161
"""Stitch same-speaker turns that are close to each other"""
62-
self._annotation.support(self.patch_collar)
62+
if self._annotation is not None:
63+
self._annotation = self._annotation.support(self.patch_collar)
6364

6465
def get_prediction(self) -> Annotation:
6566
# Patch again in case this is called before on_completed

0 commit comments

Comments
 (0)