aboutsummaryrefslogtreecommitdiff
path: root/dnn/torch/lpcnet/scripts/run_inference_test.sh
blob: 9f22b03decaca020a33ba315c0b831ab5ee9e226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash


case $# in
    3) FEATURES=$1; FOLDER=$2; PYTHON=$3;;
    *) echo "run_inference_test.sh <features file> <output folder> <python path>"; exit;;
esac


SCRIPTFOLDER=$(dirname "$0")

mkdir -p $FOLDER/inference_test

# update checkpoints
for fn in $(find $FOLDER -type f -name "checkpoint*.pth")
do
    tmp=$(basename $fn)
    tmp=${tmp%.pth}
    epoch=${tmp#checkpoint_epoch_}
    echo "running inference with checkpoint $fn..."
    $PYTHON $SCRIPTFOLDER/../test_lpcnet.py $FEATURES $fn $FOLDER/inference_test/output_epoch_${epoch}.wav
done