imansarraf commited on
Commit
047eec0
β€’
1 Parent(s): ab53da2

Rename sad_tf/segmenter_for_tf2_16.py to sad_tf/segmenter.py

Browse files
sad_tf/{segmenter_for_tf2_16.py β†’ segmenter.py} RENAMED
@@ -32,8 +32,7 @@ import math
32
  from iman import Audio
33
  import numpy as np
34
  from tensorflow import keras
35
- # from tensorflow.compat.v1.keras.backend import set_session
36
- import tensorflow.python.keras.backend as K
37
  from .thread_returning import ThreadReturning
38
 
39
  import shutil
@@ -366,8 +365,6 @@ class Segmenter:
366
  config = tf.compat.v1.ConfigProto()
367
  config.gpu_options.allow_growth = True
368
  config.log_device_placement = True
369
- sess = tf.compat.v1.Session(config=config)
370
- sess = K.get_session()
371
 
372
 
373
  self.complete_output = complete_output
@@ -418,7 +415,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
  from .thread_returning import ThreadReturning
37
 
38
  import shutil
 
365
  config = tf.compat.v1.ConfigProto()
366
  config.gpu_options.allow_growth = True
367
  config.log_device_placement = True
 
 
368
 
369
 
370
  self.complete_output = complete_output
 
415
  vadseg.append(('speech', start, stop))
416
  lseg.append((lab, start, stop))
417
  if (self.vad_type == 'vad'):
418
+ return [(lab, start_sec + start * .02, start_sec + stop * .02 , (stop-start) * .02) for lab, start, stop in vadseg]
419
  # perform voice activity detection
420
  lseg = self.vad(mspec, lseg, difflen)
421