Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed main and merging this to r1.20 #7127

Merged
merged 2 commits into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading