[TTS]fix praatio version, test=tts (#1158)

* fix praatio version, test=tts

* fix praatio version, test=tts
pull/1160/head
TianYuan 3 years ago committed by GitHub
parent f840277381
commit 675cff258b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,7 +15,7 @@ import argparse
from collections import defaultdict from collections import defaultdict
from pathlib import Path from pathlib import Path
from praatio import tgio from praatio import textgrid
def get_baker_data(root_dir): def get_baker_data(root_dir):
@ -28,7 +28,7 @@ def get_baker_data(root_dir):
alignment_files = [f for f in alignment_files if f.stem not in exclude] alignment_files = [f for f in alignment_files if f.stem not in exclude]
data_dict = defaultdict(dict) data_dict = defaultdict(dict)
for alignment_fp in alignment_files: for alignment_fp in alignment_files:
alignment = tgio.openTextgrid(alignment_fp) alignment = textgrid.openTextgrid(alignment_fp, includeEmptyIntervals=True)
# only with baker's annotation # only with baker's annotation
utt_id = alignment.tierNameList[0].split(".")[0] utt_id = alignment.tierNameList[0].split(".")[0]
intervals = alignment.tierDict[alignment.tierNameList[0]].entryList intervals = alignment.tierDict[alignment.tierNameList[0]].entryList

@ -0,0 +1,10 @@
#!/bin/bash
export MAIN_ROOT=`realpath ${PWD}/../../../`
export PATH=${MAIN_ROOT}:${MAIN_ROOT}/utils:${PATH}
export LC_ALL=C
export PYTHONDONTWRITEBYTECODE=1
# Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}

@ -0,0 +1,10 @@
#!/bin/bash
export MAIN_ROOT=`realpath ${PWD}/../../../`
export PATH=${MAIN_ROOT}:${MAIN_ROOT}/utils:${PATH}
export LC_ALL=C
export PYTHONDONTWRITEBYTECODE=1
# Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=${MAIN_ROOT}:${PYTHONPATH}

@ -19,12 +19,12 @@ from pathlib import Path
import librosa import librosa
import numpy as np import numpy as np
import soundfile as sf import soundfile as sf
from praatio import tgio from praatio import textgrid
from tqdm import tqdm from tqdm import tqdm
def get_valid_part(fpath): def get_valid_part(fpath):
f = tgio.openTextgrid(fpath) f = textgrid.openTextgrid(fpath, includeEmptyIntervals=True)
start = 0 start = 0
phone_entry_list = f.tierDict['phones'].entryList phone_entry_list = f.tierDict['phones'].entryList

@ -20,7 +20,7 @@ paddlespeech_feat
pandas pandas
phkit phkit
Pillow Pillow
praatio~=4.1 praatio==5.0.0
pre-commit pre-commit
pybind11 pybind11
pypi-kenlm pypi-kenlm

@ -45,7 +45,7 @@ requirements = {
"pandas", "pandas",
"paddleaudio", "paddleaudio",
"paddlespeech_feat", "paddlespeech_feat",
"praatio~=4.1", "praatio==5.0.0",
"pypinyin", "pypinyin",
"python-dateutil", "python-dateutil",
"pyworld", "pyworld",

@ -18,12 +18,12 @@ from pathlib import Path
import librosa import librosa
import numpy as np import numpy as np
import yaml import yaml
from praatio import tgio from praatio import textgrid
from yacs.config import CfgNode from yacs.config import CfgNode
def readtg(tg_path, sample_rate=24000, n_shift=300): def readtg(tg_path, sample_rate=24000, n_shift=300):
alignment = tgio.openTextgrid(tg_path, readRaw=True) alignment = textgrid.openTextgrid(tg_path, includeEmptyIntervals=True)
phones = [] phones = []
ends = [] ends = []
for interval in alignment.tierDict["phones"].entryList: for interval in alignment.tierDict["phones"].entryList:

Loading…
Cancel
Save