From 33dc1a3f4a3ccffc329cbfdd1b2d6f7386de8d01 Mon Sep 17 00:00:00 2001 From: James O'Leary <65884233+jpohhhh@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:08:17 -0500 Subject: [PATCH] Revert "experiment(pyannote): probability" This reverts commit 47c12c329431a512423c76aed9c8c2b0da09f244. It doesn't add significant signal over the recommended algorithm. --- lib/models/pyannote/pyannote_isolate.dart | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/models/pyannote/pyannote_isolate.dart b/lib/models/pyannote/pyannote_isolate.dart index a07c73c..aaefc97 100644 --- a/lib/models/pyannote/pyannote_isolate.dart +++ b/lib/models/pyannote/pyannote_isolate.dart @@ -265,9 +265,6 @@ Future>> _processAudioInIsolate( List> results = []; List isActive = List.filled(PyannoteONNX.numSpeakers, false); List startSamples = List.filled(PyannoteONNX.numSpeakers, 0); - // Add near where isActive and startSamples are declared - final probSums = List.filled(PyannoteONNX.numSpeakers, 0.0); - final framesCounted = List.filled(PyannoteONNX.numSpeakers, 0); int currentSamples = 721; final overlap = sample2frame(PyannoteONNX.duration - step); @@ -374,29 +371,18 @@ Future>> _processAudioInIsolate( currentSamples += 270; for (int spk = 0; spk < PyannoteONNX.numSpeakers; spk++) { if (isActive[spk]) { - // Add probability tracking - probSums[spk] += probs[spk]; - framesCounted[spk]++; - if (probs[spk] < 0.5) { results.add({ 'speaker': spk, 'start': startSamples[spk] / PyannoteONNX.sampleRate, 'stop': currentSamples / PyannoteONNX.sampleRate, - 'probability': probSums[spk] / framesCounted[spk], // Add average probability }); isActive[spk] = false; - // Reset tracking for this speaker - probSums[spk] = 0.0; - framesCounted[spk] = 0; } } else { if (probs[spk] > 0.5) { startSamples[spk] = currentSamples; isActive[spk] = true; - // Start tracking probability - probSums[spk] = probs[spk]; - framesCounted[spk] = 1; } } } @@ -416,7 +402,6 @@ Future>> _processAudioInIsolate( 'speaker': spk, 'start': startSamples[spk] / PyannoteONNX.sampleRate, 'stop': currentSamples / PyannoteONNX.sampleRate, - 'probability': probSums[spk] / framesCounted[spk], // Add average probability }); } }