Add keyword spotting for C# (#1105)

This commit is contained in:
Fangjun Kuang
2024-07-10 21:18:46 +08:00
committed by GitHub
parent dd0ff2ca06
commit 08c758520f
21 changed files with 368 additions and 37 deletions

View File

@@ -2,7 +2,10 @@
cd dotnet-examples/
cd ./online-decode-files
cd ./keyword-spotting-from-files
./run.sh
cd ../online-decode-files
./run-transducer-itn.sh
./run-zipformer2-ctc.sh
./run-transducer.sh

View File

@@ -139,7 +139,7 @@ time $EXE \
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=2 \
$repo/test_wavs/0.wav \
@@ -172,7 +172,7 @@ time $EXE \
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=2 \
$repo/test_wavs/0.wav \

View File

@@ -86,7 +86,7 @@ for wave in ${waves[@]}; do
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=2 \
$wave
@@ -126,7 +126,7 @@ for wave in ${waves[@]}; do
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-11-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-11-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-11-avg-1.onnx \
--joiner=$repo/joiner-epoch-11-avg-1.int8.onnx \
--num-threads=2 \
$wave
@@ -168,7 +168,7 @@ for wave in ${waves[@]}; do
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=2 \
$wave
@@ -210,7 +210,7 @@ for wave in ${waves[@]}; do
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=2 \
$wave
@@ -231,7 +231,7 @@ if [ $EXE == "sherpa-onnx-ffmpeg" ]; then
time $EXE \
$repo/tokens.txt \
$repo/encoder-epoch-99-avg-1.int8.onnx \
$repo/decoder-epoch-99-avg-1.int8.onnx \
$repo/decoder-epoch-99-avg-1.onnx \
$repo/joiner-epoch-99-avg-1.int8.onnx \
https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/resolve/main/test_wavs/4.wav \
2
@@ -271,7 +271,7 @@ for wave in ${waves[@]}; do
time $EXE \
--tokens=$repo/tokens.txt \
--encoder=$repo/encoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.int8.onnx \
--decoder=$repo/decoder-epoch-99-avg-1.onnx \
--joiner=$repo/joiner-epoch-99-avg-1.int8.onnx \
--num-threads=2 \
$wave

View File

@@ -125,12 +125,15 @@ for name in ${wenet_models[@]}; do
repo=$name
log "Start testing ${repo_url}"
python3 ./python-api-examples/offline-decode-files.py \
--tokens=$repo/tokens.txt \
--wenet-ctc=$repo/model.onnx \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav
if false; then
# offline wenet ctc models are not supported by onnxruntime >= 1.18
python3 ./python-api-examples/offline-decode-files.py \
--tokens=$repo/tokens.txt \
--wenet-ctc=$repo/model.onnx \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav
fi
python3 ./python-api-examples/online-decode-files.py \
--tokens=$repo/tokens.txt \