[{"source":{"position":1,"lines":["
demucs(仓库 <a href="https://github.com/facebookresearch/demucs">facebookresearch/demucs)# Demucs Music Source Separation。本文基于官方 README 整理,从零开始带你完成环境搭建、配置、启动与日常使用全流程。
","<img alt="demucs 官方预览图" src="/upload/_cover_demucs.png"/>
"]},"target":{"position":1,"lines":["demucs(仓库 <a href="https://github.com/facebookresearch/demucs" target="_blank" rel="noopener">facebookresearch/demucs)# Demucs Music Source Separation。本文基于官方 README 整理,从零开始带你完成环境搭建、配置、启动与日常使用全流程。
","<img alt="demucs 官方预览图" src="/upload/_cover_demucs.png" />
"]},"type":"CHANGE"},{"source":{"position":132,"lines":["<code class="language-bash">sudo tee /etc/systemd/system/demucs.service <<EOF","[Unit]","Description=demucs Service","After=network.target","","[Service]","Type=simple","WorkingDirectory=/opt/demucs","ExecStart=/opt/demucs/start.sh","Restart=always","RestartSec=5","User=www-data","","[Install]","WantedBy=multi-user.target","EOF","","sudo systemctl daemon-reload","sudo systemctl enable --now demucs",""]},"target":{"position":132,"lines":["
<code class="language-bash">sudo tee /etc/systemd/system/demucs.service <<eof [unit] description="demucs" service after="network.target" [service] type="simple" workingdirectory="/opt/demucs" execstart="/opt/demucs/start.sh" restart="always" restartsec="5" user="www-data" [install] wantedby="multi-user.target" eof sudo systemctl daemon-reload sudo systemctl enable --now demucs < code>"]},"type":"CHANGE"},{"source":{"position":206,"lines":["- <a href="https://github.com/facebookresearch/demucs">GitHub 仓库","- <a href="https://github.com/facebookresearch/demucs/blob/main/README.md\">官方 README"]},"target":{"position":187,"lines":["- <a href="https://github.com/facebookresearch/demucs" target="_blank" rel="noopener">GitHub 仓库","- <a href="https://github.com/facebookresearch/demucs/blob/main/README.md" target="_blank" rel="noopener">官方 README"]},"type":"CHANGE"}]
安装部署(实操步骤)
1. 前置准备
- 项目仓库:facebookresearch/demucs(https://github.com/facebookresearch/demucs)
- 需要本机具备 Git;按项目语言准备对应运行时(Python / Node.js / Go / Java 等)
- 建议先在本机或测试服务器上跑通,再部署到生产环境
- 遇到依赖版本问题时,以仓库 README 与 Releases 说明为准
2. 官方安装 / 启动命令(摘自项目 README,可直接复制执行)
python3 -m pip install -U demucspython3 -m pip install -U git+https://github.com/facebookresearch/demucs#egg=demucsconda env update -f environment-cpu.yml # if you don't have GPUs
conda env update -f environment-cuda.yml # if you have GPUs
conda activate demucs
pip install -e .demucs PATH_TO_AUDIO_FILE_1 [PATH_TO_AUDIO_FILE_2 ...] # for Demucs
# If you used `pip install --user` you might need to replace demucs with python3 -m demucs
python3 -m demucs --mp3 --mp3-bitrate BITRATE PATH_TO_AUDIO_FILE_1 # output files saved as MP3
# use --mp3-preset to change encoder preset, 2 for best quality, 7 for fastest
# If your filename contain spaces don't forget to quote it !!!
demucs "my music/my favorite track.mp3"
# You can select different models with `-n` mdx_q is the quantized model, smaller but maybe a bit less accurate.
demucs -n mdx_q myfile.mp3
# If you only want to separate vocals out of an audio, use `--two-stems=vocals` (You can also set to drums or bass)
demucs --two-stems=vocals myfile.mp33. 部署流程
- 克隆仓库:
git clone https://github.com/facebookresearch/demucs - 进入目录后按上面的官方命令安装依赖
- 参考 README 的配置说明填写配置文件或环境变量
- 按官方说明启动服务,确认监听端口与访问地址
- 浏览器访问验证功能,确认无报错后再开放外网
4. 常见问题排查
- 依赖安装失败:先升级包管理器,再确认运行时版本符合 README 要求
- 启动报端口占用:修改配置中的端口或释放被占用端口
- 页面打不开:检查防火墙 / 安全组是否放行对应端口
- 功能异常:查看运行日志,对照 Issues 中同类问题处理