이것이 공식 코드 구현입니까? Matcha-TTS [ICASSP 2024].
우리는 제안합니다. 비유로 인한 신경 TTS에 대한 새로운 접근법 인 Matcha-TTS는 조건부 흐름 일치 (정류 흐름과 유사)를 사용하여 ODE 기반 음성 합성 속도를 높입니다. 우리의 방법 :
자세한 내용은 데모 페이지를 확인하고 ICASSP 2024 용지를 읽으십시오.
미리 훈련 된 모델은 CLI 또는 Gradio 인터페이스와 함께 자동으로 다운로드됩니다.
당신은 또한 시도 할 수 있습니까? Huggingface의 브라우저에서 matcha-tts? 공간.
conda create -n matcha-tts python=3.10 -y
conda activate matcha-tts
pip install matcha-tts소스에서
pip install git+https://github.com/shivammehta25/Matcha-TTS.git
cd Matcha-TTS
pip install -e . # This will download the required models
matcha-tts --text " <INPUT TEXT> "또는
matcha-tts-app 또는 Jupyter Notebook의 Open synthesis.ipynb
matcha-tts --text " <INPUT TEXT> "matcha-tts --file < PATH TO FILE >matcha-tts --file < PATH TO FILE > --batched추가 논쟁
matcha-tts --text " <INPUT TEXT> " --speaking_rate 1.0matcha-tts --text " <INPUT TEXT> " --temperature 0.667matcha-tts --text " <INPUT TEXT> " --steps 10우리가 LJ 연설로 훈련하고 있다고 가정 해 봅시다
여기에서 데이터 세트를 다운로드하여 data/LJSpeech-1.1 로 추출한 다음 Nvidia Tacotron 2 Repo 설정에서 항목 5와 같이 추출 된 데이터를 가리 키도록 파일 목록을 준비하십시오.
Matcha-TTS 저장소를 복제하고 입력하십시오
git clone https://github.com/shivammehta25/Matcha-TTS.git
cd Matcha-TTSpip install -e .configs/data/ljspeech.yaml 로 이동하여 변경하십시오 train_filelist_path : data/filelists/ljs_audio_text_train_filelist.txt
valid_filelist_path : data/filelists/ljs_audio_text_val_filelist.txtmatcha-data-stats -i ljspeech.yaml
# Output:
#{ ' mel_mean ' : -5.53662231756592, ' mel_std ' : 2.1161014277038574} data_statistics 키에서 configs/data/ljspeech.yaml 에서이 값을 업데이트하십시오.
data_statistics: # Computed for ljspeech dataset
mel_mean: -5.536622
mel_std: 2.116101열차와 검증 파일리스트의 길에.
make train-ljspeech또는
python matcha/train.py experiment=ljspeechpython matcha/train.py experiment=ljspeech_min_memorypython matcha/train.py experiment=ljspeech trainer.devices=[0,1]matcha-tts --text " <INPUT TEXT> " --checkpoint_path < PATH TO CHECKPOINT > ONNX 내보내기 및 추론 지원을 구현 한 @Mush42에 특별한 감사를드립니다.
Matcha 체크 포인트를 ONNX로 내보내고 내보낸 ONNX 그래프에서 추론을 실행할 수 있습니다.
Onnx로 검사 점을 내보내려면 먼저 Onnx를 설치하십시오.
pip install onnx그런 다음 다음을 실행하십시오.
python3 -m matcha.onnx.export matcha.ckpt model.onnx --n-timesteps 5선택적으로, ONNX Expler는 COBODER-NAME 및 VOCODER-Checkpoint 인수를 수락합니다. 이를 통해 내보내기 그래프에 보코더를 포함시키고 단일 실행 (엔드 투 엔드 TTS 시스템과 유사)에서 파형을 생성 할 수 있습니다.
n_timesteps 는 모델 입력이 아닌 하이퍼 패러 아미터로 취급 됩니다. 즉, 수출 중에 지정해야합니다 (추론 중). 지정되지 않으면 n_timesteps 5 로 설정됩니다.
중요 : 현재로서는 scaled_product_attention 연산자가 이전 버전에서 내보낼 수 없으므로 Torch> = 2.1.0이 내보내기에 필요합니다. 최종 버전이 릴리스 될 때까지 모델을 내보내려는 사람들은 Torch> = 2.1.0 수동으로 사전 릴리스로 설치해야합니다.
내보낸 모델에서 추론을 실행하려면 먼저 onnxruntime 설치하십시오.
pip install onnxruntime
pip install onnxruntime-gpu # for GPU inference그런 다음 다음을 사용하십시오.
python3 -m matcha.onnx.infer model.onnx --text " hey " --output-dir ./outputs합성 파라미터를 제어 할 수도 있습니다.
python3 -m matcha.onnx.infer model.onnx --text " hey " --output-dir ./outputs --temperature 0.4 --speaking_rate 0.9 --spk 0 GPU 에서 추론을 실행하려면 OnnxRuntime-GPU 패키지를 설치 한 다음 --gpu 추론 명령으로 전달하십시오.
python3 -m matcha.onnx.infer model.onnx --text " hey " --output-dir ./outputs --gpu Onnx로 만 내보낸 경우 멜 스피어 그램을 그래프로, numpy Arrays로 출력 디렉토리에 표시됩니다. 내보내기 그래프에 보코더를 포함 시키면 .wav 오디오 파일을 출력 디렉토리에 씁니다.
Onnx로 만 내보내기를하고 전체 TTS 파이프 라인을 실행하려면 ONNX 형식의 보코더 모델로의 경로를 전달할 수 있습니다.
python3 -m matcha.onnx.infer model.onnx --text " hey " --output-dir ./outputs --vocoder hifigan.small.onnx 이렇게하면 .wav 오디오 파일을 출력 디렉토리에 작성합니다.
데이터 세트가 다음과 같이 구성된 경우
data/
└── LJSpeech-1.1
├── metadata.csv
├── README
├── test.txt
├── train.txt
├── val.txt
└── wavs그런 다음 다음을 사용하여 훈련 된 말차 tts 모델에서 음운 레벨 정렬을 추출 할 수 있습니다.
python matcha/utils/get_durations_from_trained_model.py -i dataset_yaml -c < checkpoint >예:
python matcha/utils/get_durations_from_trained_model.py -i ljspeech.yaml -c matcha_ljspeech.ckpt또는 간단히 :
matcha-tts-get-durations -i ljspeech.yaml -c matcha_ljspeech.ckpt DataSetConfig에서로드 기간을 켜십시오. 예 : ljspeech.yaml
load_durations: True
또는 구성/실험/ljspeech_from_durations.yaml의 예를 참조하십시오
당사 코드를 사용 하거나이 작업이 유용하다고 생각하는 경우, 우리 논문을 인용하십시오.
@inproceedings{mehta2024matcha,
title={Matcha-{TTS}: A fast {TTS} architecture with conditional flow matching},
author={Mehta, Shivam and Tu, Ruibo and Beskow, Jonas and Sz{'e}kely, {'E}va and Henter, Gustav Eje},
booktitle={Proc. ICASSP},
year={2024}
}
이 코드는 Lightning-hydra-template를 사용하기 때문에 함께 제공되는 모든 힘이 있습니다.
우리가 인정하고 싶은 다른 소스 코드 :