-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Update Frame-VAD doc and fix onnx export #7076
Merged
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
237dde6
update fvad doc
stevehuang52 9adcbad
Merge branch 'main' into add_fvad_doc
fayejf 9555cfd
fix typo
stevehuang52 fcfdf01
Merge branch 'add_fvad_doc' of https://github.com/NVIDIA/NeMo into ad…
stevehuang52 a765250
update fvad example
stevehuang52 a3b789f
merge main
stevehuang52 f51fa4b
update
stevehuang52 578cdfd
Merge branch 'main' into add_fvad_doc
stevehuang52 21d7b7f
fix onnx export
stevehuang52 97705b5
update test
stevehuang52 c8fec9c
refactor
stevehuang52 05f8e37
update doc
stevehuang52 69db77f
update
stevehuang52 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
## Usage: | ||
python frame_vad_infer.py \ | ||
--config-path="../conf/vad" --config-name="frame_vad_infer_postprocess" \ | ||
dataset=<Path of manifest file containing evaluation data. Audio files should have unique names> | ||
dataset=<Path of manifest file containing evaluation data. Audio files should have unique names> \ | ||
output=<Path of output directory> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
|
||
The manifest json file should have the following format (each line is a Python dictionary): | ||
{"audio_filepath": "/path/to/audio_file1", "offset": 0, "duration": 10000} | ||
|
@@ -60,6 +61,16 @@ | |
def main(cfg): | ||
if not cfg.dataset: | ||
raise ValueError("You must input the path of json file of evaluation data") | ||
output_dir = cfg.output if cfg.output else "frame_vad_outputs" | ||
if os.path.exists(output_dir): | ||
logging.warning( | ||
f"Output directory {output_dir} already exists, use this only if you're tuning post-processing params." | ||
) | ||
Path(output_dir).mkdir(parents=True, exist_ok=True) | ||
|
||
cfg.frame_out_dir = os.path.join(output_dir, "frame_preds") | ||
cfg.smoothing_out_dir = os.path.join(output_dir, "smoothing_preds") | ||
cfg.rttm_out_dir = os.path.join(output_dir, "rttm_preds") | ||
|
||
# each line of dataset should be have different audio_filepath and unique name to simplify edge cases or conditions | ||
logging.info(f"Loading manifest file {cfg.dataset}") | ||
|
@@ -76,6 +87,7 @@ def main(cfg): | |
'split_duration': cfg.prepare_manifest.split_duration, | ||
'num_workers': cfg.num_workers, | ||
'prepared_manifest_vad_input': cfg.prepared_manifest_vad_input, | ||
'out_dir': output_dir, | ||
} | ||
manifest_vad_input = prepare_manifest(config) | ||
else: | ||
|
@@ -171,7 +183,7 @@ def main(cfg): | |
key_pred_rttm_map[key] = entry['rttm_filepath'] | ||
|
||
if not cfg.out_manifest_filepath: | ||
out_manifest_filepath = "manifest_vad_output.json" | ||
out_manifest_filepath = os.path.join(output_dir, "manifest_vad_output.json") | ||
else: | ||
out_manifest_filepath = cfg.out_manifest_filepath | ||
write_manifest(out_manifest_filepath, manifest_new) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about making the name clearer? such as output_folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated