#!/usr/bin/env bash # Copyright 2024 Xiaomi Corp. (authors: Fangjun Kuang) set -ex function install_pyannote() { pip install pyannote.audio onnx onnxruntime } function download_test_files() { curl -SL -O https://huggingface.co/csukuangfj/pyannote-models/resolve/main/segmentation-3.0/pytorch_model.bin curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/lei-jun-test.wav } install_pyannote download_test_files ./export-onnx.py ./preprocess.sh echo "----------torch----------" ./vad-torch.py echo "----------onnx model.onnx----------" ./vad-onnx.py --model ./model.onnx --wav ./lei-jun-test.wav echo "----------onnx model.int8.onnx----------" ./vad-onnx.py --model ./model.int8.onnx --wav ./lei-jun-test.wav cat >README.md << EOF # Introduction Models in this file are converted from https://huggingface.co/pyannote/segmentation-3.0/tree/main EOF cat >LICENSE <