From 3cd3473bf7a3b41484baa86d9092248d78e7af39 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 21 四月 2023 17:17:37 +0800
Subject: [PATCH] docs

---
 egs/mars/sd/scripts/real_meeting_process/dump_real_meeting_chunks.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/egs/mars/sd/scripts/real_meeting_process/dump_real_meeting_chunks.py b/egs/mars/sd/scripts/real_meeting_process/dump_real_meeting_chunks.py
index ebd4c9b..a2bcd39 100644
--- a/egs/mars/sd/scripts/real_meeting_process/dump_real_meeting_chunks.py
+++ b/egs/mars/sd/scripts/real_meeting_process/dump_real_meeting_chunks.py
@@ -26,6 +26,7 @@
         short_spk_list.append(spk)
 
     ivc_list = [kaldiio.load_mat(utt2ivc[utt]) for utt in utt_list]
+    ivc_list = [x/np.linalg.norm(x, axis=-1) for x in ivc_list]
     ivc = np.concatenate(ivc_list, axis=0)
     ivc = np.mean(ivc, axis=0, keepdims=False)
     return ivc
@@ -66,10 +67,10 @@
             wav_label = meeting_labels[st:ed, :]
             frame_num = (ed-st) // win_shift
             # wav_label = np.pad(wav_label, ((win_len/2, win_len/2), (0, 0)), "constant")
-            feat_label = np.zeros((frame_num, wav_label.shape[1]), dtype=int)
+            feat_label = np.zeros((frame_num, wav_label.shape[1]), dtype=np.float32)
             for i in range(frame_num):
                 frame_label = wav_label[i*win_shift: (i+1)*win_shift, :]
-                feat_label[i, :] = (np.sum(frame_label, axis=0) > 0).astype(int)
+                feat_label[i, :] = (np.sum(frame_label, axis=0) > 0).astype(np.float32)
             label_writer(seg_id, feat_label)
 
             frames_list.append((mid, feat_label.shape[0]))

--
Gitblit v1.9.1