Skip to content

Commit

Permalink
Fixed main and merging this to r1.20 (NVIDIA#7127)
Browse files Browse the repository at this point in the history
* Fixed main and merging this to r1.20

Signed-off-by: Taejin Park <tango4j@gmail.com>

* Update vad_utils.py

Signed-off-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com>

---------

Signed-off-by: Taejin Park <tango4j@gmail.com>
Signed-off-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com>
Co-authored-by: He Huang (Steve) <105218074+stevehuang52@users.noreply.github.com>
Signed-off-by: zhehuaichen <dian.chenzhehuai@gmail.com>
  • Loading branch information
2 people authored and zhehuaichen committed Oct 4, 2023
1 parent 0f56d42 commit 1ce764b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions nemo/collections/asr/parts/utils/vad_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ def generate_overlap_vad_seq(
if out_dir:
overlap_out_dir = out_dir
else:
overlap_out_dir = frame_pred_dir + "/overlap_smoothing_output" + "_" + smoothing_method + "_" + str(overlap)
overlap_out_dir = os.path.join(
frame_pred_dir, "overlap_smoothing_output" + "_" + smoothing_method + "_" + str(overlap)
)

if not os.path.exists(overlap_out_dir):
os.mkdir(overlap_out_dir)
Expand Down Expand Up @@ -730,9 +732,9 @@ def generate_vad_segment_table(
vad_pred_filepath_list = [os.path.join(vad_pred_dir, x) for x in os.listdir(vad_pred_dir) if x.endswith(suffixes)]

if not out_dir:
out_dir_name = "seg_output_"
out_dir_name = "seg_output"
for key in postprocessing_params:
out_dir_name = out_dir_name + str(key) + str(postprocessing_params[key]) + "-"
out_dir_name = out_dir_name + "-" + str(key) + str(postprocessing_params[key])

out_dir = os.path.join(vad_pred_dir, out_dir_name)

Expand Down Expand Up @@ -1049,11 +1051,11 @@ def plot(
else:
label = None

if label:
if label is not None:
ax2.plot(np.arange(len_pred) * unit_frame_len, label, 'r', label='label')
if pred_snippet:
if pred_snippet is not None:
ax2.plot(np.arange(len_pred) * unit_frame_len, pred_snippet, 'b', label='pred')
if frame_snippet:
if frame_snippet is not None:
ax2.plot(np.arange(len_pred) * unit_frame_len, frame_snippet, 'g--', label='speech prob')

ax2.tick_params(axis='y', labelcolor='r')
Expand Down

0 comments on commit 1ce764b

Please sign in to comment.