Fre-Painter: A Pytorch Implementation
git clone https://github.com/FrePainter/code.git
cd code
2. Install python requirements
pip install -r requirements.txt
2. Preprocessing for pre-training
INPUT_DIR=[Directory of LibriTTS]
OUTPUT_DIR=./dataset/LibriTTS
CUDA_VISIBLE_DEVICES=0,1 python preprocess.py -i $INPUT_DIR -o $OUTPUT_DIR
3. Preprocessing for fine-tuning
INPUT_DIR=[Directory of VCTK]
OUTPUT_DIR=./dataset/VCTK
CUDA_VISIBLE_DEVICES=0,1 python preprocess.py -i $INPUT_DIR -o $OUTPUT_DIR --save_audio
PT_MODEL_NAME=pretrain_80
MASK_RATIO=0.8
CUDA_VISIBLE_DEVICES=0,1 python pretrain.py -m $PT_MODEL_NAME -r $MASK_RATIO
FT_MODEL_NAME=finetune_random
PT_MODEL_NAME=pretrain_80
CUDA_VISIBLE_DEVICES=0,1 python finetune.py -m $FT_MODEL_NAME -p $PT_MODEL_NAME
INPUT_DIR=[Directory of VCTK]
TESTSET_DIR=./dataset/testset
CUDA_VISIBLE_DEVICES=0,1 python generate_testset.py -m $INPUT_DIR -o $OUTPUT_DIR
FT_MODEL_NAME=finetune_random
TESTSET_DIR=./dataset/testset
CUDA_VISIBLE_DEVICES=0,1 python inference_for_test.py -m $FT_MODEL_NAME -d $TESTSET_DIR
Inference with the pre-trained model
sh download_checkpoint.sh
MODEL_NAME=pt_rd_80_ft_ub_mrv2
DATA_DIR=[Directory or audio file]
OUTPUT_DIR=[output directory]
EXT=wav
sh inference.sh $MODEL_NAME $DATA_DIR $OUTPUT_DIR $EXT