前言
Roop最新版改善了跳闪的问题,脸部处理更加精细,炼丹的效率也提升了约5倍左右,支持多张脸部选择替换。本文简略介绍ROOP的Windows平台下安装配置。
需要的前置准备
环境 | 版本 |
---|---|
Python | 3.10.6 |
Git工具 | |
ffmpeg | 6.0 |
Visual Studio | 2022 |
CUDA | 11.8.0 |
NvidiaGpu | 9系以上 |
开始部署
在任意文件夹下(你想要安装的地方)打开cmd,输入以下命令
克隆roop项目
git clone https://github.com/s0md3v/roop
输入”cd root”进入roop文件夹
创建虚拟环境
python -m venv venv
激活虚拟环境
call venv\scripts\activate
安装依赖包
pip install -r requirements.txt
查看已安装包
pip list
检查onnxruntime-gpu包是否安装,这会决定你能不能启用N卡
如果没有,用以下命令重装
pip uninstall onnxruntime onnxruntime-gpu
pip install onnxruntime-gpu==1.15.1
如果本地缓存有冲突依赖包安装失败 ,可执行
pip install –no-cache-dir -r requirements.txt
常用指令
1 | python run.py //只用CPU处理视频 |
参数调整
老显卡限制内存和线程参考
1 | python run.py --execution-provider cuda --max-memory 4 --execution-threads 1 |
其中 “–max-memory 4”参数为显存大小设定为4 “–execution-threads 1”为调用线程数设定为1
其它参数
1 | --temp-frame-format {jpg,png} //帧提取的图像格式 |
文章引用:
帮助文档:https://roop-ai.gitbook.io/roop/installation/acceleration
项目地址:https://github.com/s0md3v/roop
GPU加速:https://github.com/s0md3v/roop/wiki/