From ModelScope
Collection
98 items • Updated
Mirror of wlc952/FunASR-bmodel from ModelScope. All credit to the original authors. Not an official release from them. No license was declared at the source; all rights remain with the original authors.
git lfs install
git clone https://www.modelscope.cn/wlc952/FunASR-bmodel.git
cd FunASR-bmodel
uv sync
source .venv/bin/activate
cd bmodel # 注意工作目录是 ./bmodel
python monitor.py --rtsp rtsp://127.0.0.1:8554/stream1 --system-audio ../system_ref.wav --system-phrases ../system_phrases.txt --chunk-seconds 10
# 推荐方式
curl -LsSf https://astral.sh/uv/install.sh | sh
# pipx 安装
sudo apt install pipx
pipx install uv
pipx ensurepath
虚拟环境创建/同步
uv sync
source .venv/bin/activate
关键文件
bmodel/offline.py ,直接运行即可。cd bmodel
python offline.py
bmodel/monitor.py ,运行方式如下cd bmodel
python monitor.py --rtsp rtsp://172.24.64.225:8554/stream1 --system-audio ../system_ref.wav --system-phrases ../system_phrases.txt --chunk-seconds 10
相关参数说明:
parser = argparse.ArgumentParser(description="监控场景下非系统人声检测与上报")
parser.add_argument("--rtsp", required=True, help="RTSP 地址,例如 rtsp://user:pass@ip:554/Streaming/Channels/101")
parser.add_argument(
"--system-audio",
default="../system_ref.wav",
help="系统参考音频,作为前置拼接,系统说话人 spk=0",
)
parser.add_argument("--out-dir", default="/data/alarms", help="告警本地保存目录 (已由 nginx 映射到 /static)")
parser.add_argument("--chunk-seconds", type=int, default=10, help="检测窗口秒数,默认 10s")
parser.add_argument(
"--system-phrases",
default="../system_phrases.txt",
help="系统提示词文本库(每行一条),用于过滤系统播报文本。如果系统声音错误上报,请将对应的识别文本加入到该文件。",
)
还有一些参数需要直接修改代码:
get_local_ip_fallback()def post_alert(safety_url: str, when: str, timeout: int = 2)