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

[BugFix] Fix multi-processing bug in data simulator #6310

Merged
merged 24 commits into from
Mar 31, 2023

Conversation

tango4j
Copy link
Collaborator

@tango4j tango4j commented Mar 28, 2023

What does this PR do ?

Fix multi-processing bug in data simulator

Collection:
ASR

Changelog

  • Add specific line by line info of high level changes in this PR.
  • Changed silence sampling logic to follow overlap sampling logic
  • Changed perturbator config structure to include add_xxx_aug in side xxxxxx_augmentor
  • Some comment changes
  • Fixed annotation file writing mechanism to fix multi-processing issue.
  • Added more unit-tests for util functions

Usage

This script creates a synthetic diarization session using the provided audio dataset with ctm files.
Usage:
  python <NEMO_ROOT>/tools/speech_data_simulator/multispeaker_simulator.py  \
    num_workers=10 \
    data_simulator.random_seed=42 \
    data_simulator.manifest_filepath=manifest_with_alignment_file.json \
    data_simulator.outputs.output_dir=./simulated_data \
    data_simulator.outputs.output_filename=sim_spk2_sess20 \
    data_simulator.session_config.num_sessions=1000 \
    data_simulator.session_config.num_speakers=2 \
    data_simulator.session_config.session_length=20 \
    data_simulator.background_noise.add_bg=False \
    data_simulator.background_noise.background_manifest=background_noise.json \
    data_simulator.background_noise.snr=40 \

Check out parameters in ./conf/data_simulator.yaml.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

@github-actions github-actions bot added the ASR label Mar 28, 2023
@tango4j tango4j marked this pull request as ready for review March 28, 2023 21:23
stevehuang52
stevehuang52 previously approved these changes Mar 29, 2023
Copy link
Collaborator

@stevehuang52 stevehuang52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the code and found the silence/overlap distributions satisfactory enough, thanks for the great work~!

@tango4j
Copy link
Collaborator Author

tango4j commented Mar 30, 2023

Please do not merge this until we test tutorial notebooks. Thanks.

white_noise:
prob (float): Probability of adding white noise (Default: 1.0)
min_level (float): minimum gain in terms of dB
max_level (float): minimum gain in terms of dB
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimum -> maximum

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

@stevehuang52 stevehuang52 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tango4j tango4j merged commit 5d3fa84 into NVIDIA:main Mar 31, 2023
hsiehjackson pushed a commit to hsiehjackson/NeMo that referenced this pull request Jun 2, 2023
* [BugFix] Fix multi-processing bug in data simulator

Signed-off-by: Taejin Park <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed file writing mechanism to use a text buffer

Signed-off-by: Taejin Park <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed init functions

Signed-off-by: Taejin Park <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed unnecessary lines and fixed failed tests

Signed-off-by: Taejin Park <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed unnecessary lines

Signed-off-by: Taejin Park <[email protected]>

* changed yaml file structure for perturbation

Signed-off-by: Taejin Park <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changing yaml structure for augmentors

Signed-off-by: Taejin Park <[email protected]>

* Fixed perturb yaml file structure

Signed-off-by: Taejin Park <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update saving metadata

Signed-off-by: stevehuang52 <[email protected]>

* Fixed version log. Tested notebooks

Signed-off-by: Taejin Park <[email protected]>

---------

Signed-off-by: Taejin Park <[email protected]>
Signed-off-by: stevehuang52 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: stevehuang52 <[email protected]>
Co-authored-by: He Huang (Steve) <[email protected]>
Signed-off-by: hsiehjackson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants