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

Refactor prep_segments in SVS #5210

Merged
merged 26 commits into from Jun 26, 2023
Merged

Refactor prep_segments in SVS #5210

merged 26 commits into from Jun 26, 2023

Conversation

jerryuhoo
Copy link
Contributor

@jerryuhoo jerryuhoo commented Jun 4, 2023

@ftshijt @A-Quarter-Mile
I plan to use only one file for preprocessing labels and XML files, instead of using local/prep_segments.py and local/prep_segments_from_xml.py in every dataset, which will be placed under pyscripts/utils.
To fix dataset errors, we can use several functions (replace_lyrics, replace_labels, skip_labels, add_missing_phoneme, add_pause) to handle specific errors. We can use a dictionary error_correction to store error handling functions in each dataset.

In order to use this new function, previous scripts for datasets that use XML files should be changed.

  1. in local/data.sh, we should use pyscripts/utils/prep_segments.py and add parameters such as --dataset natsume and --input_type hts/xml. Please see Natsume example.
  2. All error-handling code for each dataset should be added to this file.
  3. After that, delete local/prep_segments.py, local/prep_segments_from_xml.py and pyscripts/utils/prep_segments_from_xml.py

@mergify mergify bot added the ESPnet2 label Jun 4, 2023
@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Merging #5210 (f915e56) into master (d9ae3f7) will increase coverage by 0.44%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5210      +/-   ##
==========================================
+ Coverage   74.54%   74.98%   +0.44%     
==========================================
  Files         640      655      +15     
  Lines       57267    58552    +1285     
==========================================
+ Hits        42688    43908    +1220     
- Misses      14579    14644      +65     
Flag Coverage Δ
test_integration_espnet1 66.24% <ø> (-0.05%) ⬇️
test_integration_espnet2 47.64% <ø> (+0.06%) ⬆️
test_python 65.27% <ø> (-0.01%) ⬇️
test_utils 23.27% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
espnet2/gan_svs/vits/length_regulator.py 94.87% <ø> (-0.13%) ⬇️

... and 58 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jerryuhoo jerryuhoo changed the title [WIP] Refactor prep_segments in SVS Refactor prep_segments in SVS Jun 5, 2023
Copy link
Collaborator

@ftshijt ftshijt left a comment

Choose a reason for hiding this comment

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

super thanks! it would be great if we can create a better doc in egs/TEMPLATE/svs1 to instruct people how to use the tool

egs2/namine_ritsu_utagoe_db/svs1/local/data.sh Outdated Show resolved Hide resolved
label_info, text_info = process_text_info(
os.path.join(src_data, folder, "{}.lab".format(folder))
)
# text_scp.write("{} {}\n".format(utt_id, text_info))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you remove the write of text_scp and midiscp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do you remove the write of text_scp and midiscp?

I think they are not used in this dataset. I find that ofuton also doesn't use text_scp and midiscp, so I removed them. Should I keep them?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it is not used, let's remove them.

@A-Quarter-Mile
Copy link
Contributor

The modification functions in new prep_segment look great. But it would be too long if we put all datasets in it.

@jerryuhoo
Copy link
Contributor Author

jerryuhoo commented Jun 5, 2023

I see. I think it would be a good idea to generate a dict in check_align.py, then I can use the dict in prep_segments.py. In that case, all the errors will be auto-fixed, and we don't have to put those dicts inside the code. But currently I don't know how to save and load (also append a function to) this dict.

@ftshijt
Copy link
Collaborator

ftshijt commented Jun 11, 2023

Looks good to me. Could you also add the related docs in template/svs1/readme ? I'm still not pretty sure about the potential steps we need to do with the regarding updates.

@mergify mergify bot added the README label Jun 11, 2023
egs2/TEMPLATE/svs1/README.md Outdated Show resolved Hide resolved
label_info, text_info = process_text_info(
os.path.join(src_data, folder, "{}.lab".format(folder))
)
# text_scp.write("{} {}\n".format(utt_id, text_info))
Copy link
Collaborator

Choose a reason for hiding this comment

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

If it is not used, let's remove them.

@ftshijt
Copy link
Collaborator

ftshijt commented Jun 14, 2023

LGTM! @A-Quarter-Mile could you double check it?

@A-Quarter-Mile
Copy link
Contributor

I still suggest removing natsume from new prep_segments and keeping the one in local/. There are some special designs for it (mid_reader and align_lyric_notes), which are not applicable for other datasets. Besides, the modifications for natsume in new prep_segments are based on manual inspection, we can remove them safely.

Co-authored-by: Jiatong <728307998@qq.com>
@ftshijt ftshijt added Recipe Music Music processing labels Jun 16, 2023
@ftshijt
Copy link
Collaborator

ftshijt commented Jun 23, 2023

LGTM! @A-Quarter-Mile could you double check this update? After your confirmation and CI cleared, I will merge the PR.

@ftshijt
Copy link
Collaborator

ftshijt commented Jun 26, 2023

Many thanks! Code merged.

@ftshijt ftshijt merged commit baaba22 into espnet:master Jun 26, 2023
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants