-
Notifications
You must be signed in to change notification settings - Fork 45
Add processors for downloading HiFiTTS2 dataset #115
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2ef44f8
Add processors for downloading HiFiTTS2 dataset
rlangman 2f63993
Add bandwidth estimation processor from HiFiTTS-2
rlangman 5684a5d
Merge branch 'main' into hifitts2
rlangman aa643f8
Fix bandwidth documentation
rlangman 64fb25e
Fix tests, add example to docstrings
rlangman 2fd724e
Fix exception handling for URLError
rlangman ed4124f
Add 44kHz config test
rlangman 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| documentation: | | ||
| HiFiTTS-2 22kHz | ||
| ############### | ||
|
|
||
| This config can be used to download the audio data for HiFiTTS-2 22kHz. | ||
|
|
||
| 1. Downloads HiFiTTS-2 audio from LibriVox. | ||
| 2. Outputs a new manifest in which LibriVox audiobook chapters which could not be downloaded (e.g. because they | ||
| were removed from the website) are removed. | ||
|
|
||
| **Required arguments**. | ||
|
|
||
| * **workspace_dir**: specify the workspace folder where all audio files and manifests will be stored. | ||
|
|
||
| Note that you can customize any part of this config either directly or from command-line. | ||
|
|
||
| **Output format**. | ||
|
|
||
| This config outputs 2 manifest files: | ||
|
|
||
| * ``${workspace_dir}/errors.json`` - entries from the input chapters file which failed to download from LibriVox. | ||
| * ``${workspace_dir}/manifest_filtered_22khz`` - input manifest file without utterances from failed chapters. | ||
|
|
||
| processors_to_run: all | ||
| workspace_dir: ??? | ||
| manifest_filename: manifest_22khz.json | ||
| output_filename: manifest_filtered_22khz.json | ||
| chapter_filename: chapters_22khz.json | ||
| error_filename: errors_22khz.json | ||
| audio_dir_name: audio_22khz | ||
| chapter_audio_dir_name: chapters | ||
| sample_rate: 22050 | ||
| delete_chapter_files: true | ||
| exit_on_error: false | ||
| use_dask: false | ||
| max_workers: 8 | ||
| chunksize: 50 | ||
|
|
||
| input_manifest_file: ${workspace_dir}/${manifest_filename} | ||
| chapter_file: ${workspace_dir}/${chapter_filename} | ||
| error_file: ${workspace_dir}/${error_filename} | ||
| audio_dir: ${workspace_dir}/${audio_dir_name} | ||
| chapter_dir: ${workspace_dir}/${chapter_audio_dir_name} | ||
| final_manifest: ${workspace_dir}/${output_filename} | ||
|
|
||
| processors: | ||
| - _target_: sdp.processors.DownloadHiFiTTS2 | ||
| audio_dir: ${audio_dir} | ||
| chapter_dir: ${chapter_dir} | ||
| sample_rate: ${sample_rate} | ||
| delete_chapter_files: ${delete_chapter_files} | ||
| exit_on_error: ${exit_on_error} | ||
| input_manifest_file: ${chapter_file} | ||
| output_manifest_file: ${error_file} | ||
| use_dask: ${use_dask} | ||
| max_workers: ${max_workers} | ||
| chunksize: ${chunksize} | ||
|
|
||
| - _target_: sdp.processors.RemovedFailedChapters | ||
| input_manifest_file: ${input_manifest_file} | ||
| output_manifest_file: ${final_manifest} | ||
| error_file: ${error_file} |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| documentation: | | ||
| HiFiTTS-2 44kHz | ||
| ################## | ||
|
|
||
| This config can be used to download the audio data for HiFiTTS-2 44kHz. | ||
|
|
||
| 1. Downloads HiFiTTS-2 audio from LibriVox. | ||
| 2. Outputs a new manifest in which LibriVox audiobook chapters which could not be downloaded (e.g. because they | ||
| were removed from the website) are removed. | ||
|
|
||
| **Required arguments**. | ||
|
|
||
| * **workspace_dir**: specify the workspace folder where all audio files and manifests will be stored. | ||
|
|
||
| Note that you can customize any part of this config either directly or from command-line. | ||
|
|
||
| **Output format**. | ||
|
|
||
| This config outputs 2 manifest files: | ||
|
|
||
| * ``${workspace_dir}/errors.json`` - entries from the input chapters file which failed to download from LibriVox. | ||
| * ``${workspace_dir}/manifest_filtered_44khz`` - input manifest file without utterances from failed chapters. | ||
|
|
||
| processors_to_run: all | ||
| workspace_dir: ??? | ||
| manifest_filename: manifest_44khz.json | ||
| output_filename: manifest_filtered_44khz.json | ||
| chapter_filename: chapters_44khz.json | ||
| error_filename: errors_44khz.json | ||
| audio_dir_name: audio_44khz | ||
| chapter_audio_dir_name: chapters | ||
| sample_rate: 44100 | ||
| delete_chapter_files: true | ||
| exit_on_error: false | ||
| use_dask: false | ||
| max_workers: 8 | ||
| chunksize: 50 | ||
|
|
||
| input_manifest_file: ${workspace_dir}/${manifest_filename} | ||
| chapter_file: ${workspace_dir}/${chapter_filename} | ||
| error_file: ${workspace_dir}/${error_filename} | ||
| audio_dir: ${workspace_dir}/${audio_dir_name} | ||
| chapter_dir: ${workspace_dir}/${chapter_audio_dir_name} | ||
| final_manifest: ${workspace_dir}/${output_filename} | ||
|
|
||
| processors: | ||
| - _target_: sdp.processors.DownloadHiFiTTS2 | ||
| audio_dir: ${audio_dir} | ||
| chapter_dir: ${chapter_dir} | ||
| sample_rate: ${sample_rate} | ||
| delete_chapter_files: ${delete_chapter_files} | ||
| exit_on_error: ${exit_on_error} | ||
| input_manifest_file: ${chapter_file} | ||
| output_manifest_file: ${error_file} | ||
| use_dask: ${use_dask} | ||
| max_workers: ${max_workers} | ||
| chunksize: ${chunksize} | ||
|
|
||
| - _target_: sdp.processors.RemovedFailedChapters | ||
| input_manifest_file: ${input_manifest_file} | ||
| output_manifest_file: ${final_manifest} | ||
| error_file: ${error_file} |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| documentation: | | ||
| HiFiTTS-2 Bandwidth Estimation | ||
| ############################## | ||
|
|
||
| This config contains the bandwidth estimation code used for HiFiTTS and HiFiTTS-2. | ||
| This config can be used to estimate bandwidth for any dataset. For HiFiTTS-2 bandwidth | ||
| was estimated using the first 30 seconds of every audiobook chapter, but the estimate is still | ||
| reasonably accurate if run over a shorter duration or with individual utterances. | ||
|
|
||
| **Required arguments**. | ||
|
|
||
| * **workspace_dir**: The workspace folder where all audio files and manifests are stored. | ||
| * **audio_dir**: Folder in workspace containing audio files to estimate bandwidth of. | ||
| * **input_manifest_filename**: Manifest file in workspace containing relative paths to audio. | ||
|
|
||
| **Output format**. | ||
|
|
||
| This config outputs a single manifest with the following field(s): | ||
|
|
||
| * **bandwidth (int)**: Estimated bandwidth of the audio file. | ||
|
|
||
| processors_to_run: all | ||
| workspace_dir: ??? | ||
| audio_dir_name: ??? | ||
| input_manifest_filename: ??? | ||
| output_manifest_filename: manifest_bandwidth.json | ||
| audio_key: audio_filepath | ||
| use_dask: false | ||
| max_workers: 1 | ||
| chunksize: 1 | ||
|
|
||
| input_manifest_file: ${workspace_dir}/${input_manifest_filename} | ||
| final_manifest: ${workspace_dir}/${output_manifest_filename} | ||
| audio_dir: ${workspace_dir}/${audio_dir_name} | ||
|
|
||
| processors: | ||
| - _target_: sdp.processors.EstimateBandwidth | ||
| input_manifest_file: ${input_manifest_file} | ||
| output_manifest_file: ${final_manifest} | ||
| audio_dir: ${audio_dir} | ||
| input_audio_key: ${audio_key} | ||
| use_dask: ${use_dask} | ||
| max_workers: ${max_workers} | ||
| chunksize: ${chunksize} |
This file contains hidden or 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 hidden or 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 hidden or 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
Empty file.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.