- Golang >= v1.21
- A C compiler (e.g. GCC)
- ONNX Runtime (v1.18.1)
- A Silero VAD model (v5)
This repository is cloned from streamer45/silero-vad-go. Based on the original version, the introduction of onnxruntime dependency is modified to be through pkg-config
, the purpose is to make it more convenient to use.
# install pkg-config tool
## rhel ( or other rpm based distro version )
dnf install pkg-config
## debian ( or other deb based distro version )
apt install pkg-config
# install onnxruntime
## download onnxruntime
OV=1.20.1
ARCH="x64"
wget https://github.com/microsoft/onnxruntime/releases/download/v${OV}/onnxruntime-linux-${ARCH}-${OV}.tgz
## install
tar xf onnxruntime-linux-${ARCH}-${OV}.tgz
mv onnxruntime-linux-${ARCH}-${OV} /usr/local/onnxruntime
## Generate pc (pkg-config) file
mkdir -p /usr/local/share/pkgconfig
cp /usr/local/onnxruntime/lib/pkgconfig/libonnxruntime.pc /usr/local/share/pkgconfig/
sed -i "s/\/usr\/local/\/usr\/local\/onnxruntime/g" /usr/local/share/pkgconfig/libonnxruntime.pc
sed -i "s/\/lib64/\/lib/g" /usr/local/share/pkgconfig/libonnxruntime.pc
sed -i "s/\/include\/onnxruntime/\/include/g" /usr/local/share/pkgconfig/libonnxruntime.pc
echo "/usr/local/onnxruntime/lib" > /etc/ld.so.conf.d/libonnxruntime.conf
ldconfig
# done
brew install onnxruntime pkgconfig
pkg-config --libs libonnxruntime
prefix=/usr/local/onnxruntime
bindir=${prefix}/bin
mandir=${prefix}/share/man
docdir=${prefix}/share/doc/onnxruntime
libdir=${prefix}/lib
includedir=${prefix}/include
Name: onnxruntime
Description: ONNX runtime
URL: https://github.com/microsoft/onnxruntime
Version: 1.20.1
Libs: -L${libdir} -lonnxruntime
Cflags: -I${includedir}
MIT License - see LICENSE for full text