MatAnyone的安装需要以下前置准备:
- 硬件要求:推荐配备NVIDIA GPU(加速推理),CPU也可运行但效率较低
- 软件环境:Windows/Linux/macOS系统,需预装Git和Conda
- Python版本:3.8及以上
详细安装步骤:
- 通过Git克隆仓库:
git clone https://github.com/pq-yang/MatAnyone.git
- 创建Conda虚拟环境:
conda create -n matanyone python=3.8 -y
- 激活环境并安装依赖:
pip install -r requirements.txt
- 从项目README获取预训练模型,放置到
models/
目录 - 运行
python test.py
验证安装
常见问题解决:
- 依赖安装失败可尝试清华源:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple
- 模型文件需手动下载,通常存储在Google Drive或Hugging Face
本答案来源于文章《MatAnyone: 提取视频指定目标人像的开源工具,生成目标人像视频》