Commit 47c05e8f authored by Anthony Larcher's avatar Anthony Larcher
Browse files

debug

parent a548e3d8
......@@ -84,8 +84,8 @@ def create_bottomline_clustering(model, model_cfg, show, current_diar, file_path
model_cfg,
"reference")
print(f"cluster_{cluster} with {len(diar_per_cluster)} segs changed to "
f"{len(diar_per_cluster.unique('cluster'))} clusters")
#print(f"cluster_{cluster} with {len(diar_per_cluster)} segs changed to "
# f"{len(diar_per_cluster.unique('cluster'))} clusters")
# Creat a diarization with bottom line clustering
for seg in diar_per_cluster:
bottomline_diar.append(show=seg["show"],
......
......@@ -58,9 +58,6 @@ def bic_linear_segmentation(init_diar, cep, model_cfg):
:param model_cfg:
:return:
"""
init_diar.pad(25)
init_diar.pack(50)
output_diar = init_diar.copy_structure()
spk_lst = init_diar.unique('cluster')
for spk in spk_lst:
......@@ -71,6 +68,15 @@ def bic_linear_segmentation(init_diar, cep, model_cfg):
output_diar = s4d.segmentation(cep, output_diar)
output_diar = s4d.bic_linear(cep, output_diar, model_cfg['first_seg']['thr_l'], sr=False)
print(f"Nombre de segments apres BIC LIN: {len(output_diar)}")
#final_diar = output_diar.copy_structure()
#for seg in output_diar:
# if seg.duration() > 3:
# final_diar.append_diar(seg)
#print(f"Nombre de segments apres BIC LIN filtering: {len(final_diar)}")
return output_diar
......@@ -99,6 +105,9 @@ def init_clustering(init_diar, cep, model_cfg, vad_type="none"):
if vad_type != "reference":
output_diar = s4d.viterbi.viterbi_decoding(cep, output_diar, model_cfg['first_seg']['thr_vit'])
print(f"Nombre de segments apres VITERBI: {len(output_diar)}")
return output_diar
......@@ -879,11 +888,11 @@ def allies_init_seg(model, model_cfg, show, data_folder, verbose=False):
current_vec = sidekit.StatServer(f"{first_seg_path}/{show}_{model_cfg['model']['vectors']['type']}v.h5")
current_vec_per_seg = sidekit.StatServer(f"{first_seg_path}/{show}_{model_cfg['model']['vectors']['type']}v_per_seg.h5")
#current_diar, current_vec, current_vec_per_seg = perform_second_seg(model,
# current_diar,
# current_vec,
# current_vec_per_seg,
# model_cfg)
current_diar, current_vec, current_vec_per_seg = perform_second_seg(model,
current_diar,
current_vec,
current_vec_per_seg,
model_cfg)
# re-extract x-vectors based on the final diarization to have correct vectors for the clusters
......
Supports Markdown
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