inference.sh 1.6 KB
Newer Older
1 2 3 4
#!/bin/bash

train_output_path=$1

小湉湉's avatar
小湉湉 已提交
5 6 7
stage=0
stop_stage=0

8
# pwgan
小湉湉's avatar
小湉湉 已提交
9 10 11 12 13
if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
    python3 ${BIN_DIR}/../inference.py \
        --inference_dir=${train_output_path}/inference \
        --am=fastspeech2_csmsc \
        --voc=pwgan_csmsc \
H
Hui Zhang 已提交
14
        --text=${BIN_DIR}/../../assets/sentences.txt \
小湉湉's avatar
小湉湉 已提交
15 16 17 18 19 20 21 22 23 24 25
        --output_dir=${train_output_path}/pd_infer_out \
        --phones_dict=dump/phone_id_map.txt
fi

# for more GAN Vocoders
# multi band melgan
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
    python3 ${BIN_DIR}/../inference.py \
        --inference_dir=${train_output_path}/inference \
        --am=fastspeech2_csmsc \
        --voc=mb_melgan_csmsc \
H
Hui Zhang 已提交
26
        --text=${BIN_DIR}/../../assets/sentences.txt \
小湉湉's avatar
小湉湉 已提交
27 28 29 30 31
        --output_dir=${train_output_path}/pd_infer_out \
        --phones_dict=dump/phone_id_map.txt
fi

# hifigan
32
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
小湉湉's avatar
小湉湉 已提交
33 34 35 36
    python3 ${BIN_DIR}/../inference.py \
        --inference_dir=${train_output_path}/inference \
        --am=fastspeech2_csmsc \
        --voc=hifigan_csmsc \
H
Hui Zhang 已提交
37
        --text=${BIN_DIR}/../../assets/sentences.txt \
小湉湉's avatar
小湉湉 已提交
38 39
        --output_dir=${train_output_path}/pd_infer_out \
        --phones_dict=dump/phone_id_map.txt
40 41 42
fi

# wavernn
43
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then
44 45 46 47
    python3 ${BIN_DIR}/../inference.py \
        --inference_dir=${train_output_path}/inference \
        --am=fastspeech2_csmsc \
        --voc=wavernn_csmsc \
H
Hui Zhang 已提交
48
        --text=${BIN_DIR}/../../assets/sentences.txt \
49 50
        --output_dir=${train_output_path}/pd_infer_out \
        --phones_dict=dump/phone_id_map.txt
小湉湉's avatar
小湉湉 已提交
51
fi