Support audio tagging using zipformer (#747)
This commit is contained in:
32
.github/scripts/test-audio-tagging.sh
vendored
Executable file
32
.github/scripts/test-audio-tagging.sh
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
log() {
|
||||
# This function is from espnet
|
||||
local fname=${BASH_SOURCE[1]##*/}
|
||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||
}
|
||||
|
||||
echo "EXE is $EXE"
|
||||
echo "PATH: $PATH"
|
||||
|
||||
which $EXE
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run zipformer for audio tagging "
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/audio-tagging-models/sherpa-onnx-zipformer-audio-tagging-2024-04-09.tar.bz2
|
||||
tar xvf sherpa-onnx-zipformer-audio-tagging-2024-04-09.tar.bz2
|
||||
rm sherpa-onnx-zipformer-audio-tagging-2024-04-09.tar.bz2
|
||||
repo=sherpa-onnx-zipformer-audio-tagging-2024-04-09
|
||||
ls -lh $repo
|
||||
|
||||
for w in 1.wav 2.wav 3.wav 4.wav; do
|
||||
$EXE \
|
||||
--zipformer-model=$repo/model.onnx \
|
||||
--labels=$repo/class_labels_indices.csv \
|
||||
$repo/test_wavs/$w
|
||||
done
|
||||
rm -rf $repo
|
||||
10
.github/workflows/linux.yaml
vendored
10
.github/workflows/linux.yaml
vendored
@@ -15,6 +15,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -32,6 +33,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -124,6 +126,14 @@ jobs:
|
||||
name: release-${{ matrix.build_type }}-with-shared-lib-${{ matrix.shared_lib }}-with-tts-${{ matrix.with_tts }}
|
||||
path: build/bin/*
|
||||
|
||||
- name: Test Audio tagging
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx-offline-audio-tagging
|
||||
|
||||
.github/scripts/test-audio-tagging.sh
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
10
.github/workflows/macos.yaml
vendored
10
.github/workflows/macos.yaml
vendored
@@ -15,6 +15,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -31,6 +32,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -103,6 +105,14 @@ jobs:
|
||||
otool -L build/bin/sherpa-onnx
|
||||
otool -l build/bin/sherpa-onnx
|
||||
|
||||
- name: Test Audio tagging
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx-offline-audio-tagging
|
||||
|
||||
.github/scripts/test-audio-tagging.sh
|
||||
|
||||
- name: Test C API
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
10
.github/workflows/windows-x64.yaml
vendored
10
.github/workflows/windows-x64.yaml
vendored
@@ -14,6 +14,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -28,6 +29,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -70,6 +72,14 @@ jobs:
|
||||
|
||||
ls -lh ./bin/Release/sherpa-onnx.exe
|
||||
|
||||
- name: Test Audio tagging
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin/Release:$PATH
|
||||
export EXE=sherpa-onnx-offline-audio-tagging.exe
|
||||
|
||||
.github/scripts/test-audio-tagging.sh
|
||||
|
||||
- name: Test C API
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
9
.github/workflows/windows-x86.yaml
vendored
9
.github/workflows/windows-x86.yaml
vendored
@@ -14,6 +14,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -28,6 +29,7 @@ on:
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-audio-tagging.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -85,6 +87,13 @@ jobs:
|
||||
# export EXE=sherpa-onnx-offline-language-identification.exe
|
||||
#
|
||||
# .github/scripts/test-spoken-language-identification.sh
|
||||
- name: Test Audio tagging
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin/Release:$PATH
|
||||
export EXE=sherpa-onnx-offline-audio-tagging.exe
|
||||
|
||||
.github/scripts/test-audio-tagging.sh
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user