Spaces:
Running
Running
Update sad_tf/segmenter.py
Browse files- sad_tf/segmenter.py +4 -5
sad_tf/segmenter.py
CHANGED
@@ -32,8 +32,8 @@ import math
|
|
32 |
from iman import Audio
|
33 |
import numpy as np
|
34 |
from tensorflow import keras
|
35 |
-
|
36 |
-
|
37 |
from .thread_returning import ThreadReturning
|
38 |
|
39 |
import shutil
|
@@ -366,8 +366,7 @@ class Segmenter:
|
|
366 |
config = tf.compat.v1.ConfigProto()
|
367 |
config.gpu_options.allow_growth = True
|
368 |
config.log_device_placement = True
|
369 |
-
|
370 |
-
sess = K.get_session()
|
371 |
|
372 |
|
373 |
self.complete_output = complete_output
|
@@ -418,7 +417,7 @@ class Segmenter:
|
|
418 |
vadseg.append(('speech', start, stop))
|
419 |
lseg.append((lab, start, stop))
|
420 |
if (self.vad_type == 'vad'):
|
421 |
-
return [(lab, start_sec + start * .02, start_sec + stop * .02 , stop-start) for lab, start, stop in vadseg]
|
422 |
# perform voice activity detection
|
423 |
lseg = self.vad(mspec, lseg, difflen)
|
424 |
|
|
|
32 |
from iman import Audio
|
33 |
import numpy as np
|
34 |
from tensorflow import keras
|
35 |
+
|
36 |
+
|
37 |
from .thread_returning import ThreadReturning
|
38 |
|
39 |
import shutil
|
|
|
366 |
config = tf.compat.v1.ConfigProto()
|
367 |
config.gpu_options.allow_growth = True
|
368 |
config.log_device_placement = True
|
369 |
+
|
|
|
370 |
|
371 |
|
372 |
self.complete_output = complete_output
|
|
|
417 |
vadseg.append(('speech', start, stop))
|
418 |
lseg.append((lab, start, stop))
|
419 |
if (self.vad_type == 'vad'):
|
420 |
+
return [(lab, start_sec + start * .02, start_sec + stop * .02 , (stop-start) * .02) for lab, start, stop in vadseg]
|
421 |
# perform voice activity detection
|
422 |
lseg = self.vad(mspec, lseg, difflen)
|
423 |
|