Commit f600ab86 authored by Anthony Larcher's avatar Anthony Larcher
Browse files
parents ac9c7030 c4d4493d
...@@ -769,7 +769,8 @@ class Diar(): ...@@ -769,7 +769,8 @@ class Diar():
if not diarization._attributes.exist('channel'): if not diarization._attributes.exist('channel'):
diarization.add_attribut(new_attribut='channel', default='U') diarization.add_attribut(new_attribut='channel', default='U')
try: try:
for line in fic line = re.sub('\s+',' ',line) for line in fic:
line = re.sub('\s+',' ',line)
line = line.strip() line = line.strip()
# logging.debug(line) # logging.debug(line)
if line.startswith('#') or line.startswith(';;'): if line.startswith('#') or line.startswith(';;'):
......
...@@ -44,6 +44,9 @@ __email__ = "anthony.larcher@univ-lemans.fr" ...@@ -44,6 +44,9 @@ __email__ = "anthony.larcher@univ-lemans.fr"
__status__ = "Production" __status__ = "Production"
__docformat__ = 'reS' __docformat__ = 'reS'
class PreNet(nn.Module): class PreNet(nn.Module):
def __init(self, def __init(self,
sample_rate=16000, sample_rate=16000,
...@@ -75,7 +78,10 @@ class PreNet(nn.Module): ...@@ -75,7 +78,10 @@ class PreNet(nn.Module):
return output return output
class preprocessingBLSTM(nn.Module):
class BLSTM(nn.Module):
""" """
Bi LSTM model used for voice activity detection or speaker turn detection Bi LSTM model used for voice activity detection or speaker turn detection
""" """
......
...@@ -111,8 +111,8 @@ def mdtm_to_label(mdtm_filename, ...@@ -111,8 +111,8 @@ def mdtm_to_label(mdtm_filename,
# Fill the labels with spk_idx # Fill the labels with spk_idx
for segment in diarization: for segment in diarization:
start = int(segment['start']) * framerate / 100. start = int(segment['start']) * framerate // 100
stop = int(segment['stop']) * framerate / 100. stop = int(segment['stop']) * framerate // 100
spk_idx = speaker_dict[segment['cluster']] spk_idx = speaker_dict[segment['cluster']]
label[start:stop] = spk_idx label[start:stop] = spk_idx
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment