1.安装miniconda,下载地址:
按 Python 版本划分的最新 Miniconda 安装程序链接:https://docs.anaconda.com/miniconda/miniconda-other-installer-links/
下载后直接默认安装即可。
我用的是:Python3.10对应的Miniconda
2.下载git上的Roop
使用git克隆:
git clone https://github.com/s0md3v/roop.git
3.在roop的目录下,打开终端,运行:
./run.py
4.运行的时候,提示缺少哪个依赖,就依次下载
下载依赖遇到的问题:
1. 使用pip3 install xxx 安装依赖
2.tkinterdnd2安装好后运行roop报错,意思是架构不支持,报错如下:
TkdndVersion = tkroot.tk.call('package', 'require', 'tkdnd') _tkinter.TclError: dlopen(/opt/miniconda3/lib/python3.10/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib, 0x0006): tried: '/opt/miniconda3/lib/python3.10/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/miniconda3/lib/python3.10/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (no such file), '/opt/miniconda3/lib/python3.10/site-packages/tkinterdnd2/tkdnd/osx64/libtkdnd2.9.2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
解决方案:安装tkinterdnd2-universal
pip3 install tkinterdnd2-universal
5.运行./run.py,启动成功后显示如下框,代表安装成功!
6.使用GPU加速
pip uninstall onnxruntime onnxruntime-silicon
pip install onnxruntime-silicon==1.13.1
7.运行
普通启动:./run.py
启动CoreML加速代码:./run.py --execution-provider coreml
启动换脸+脸部增强+CoreML加速代码:./run.py --frame-processor face_swapper face_enhancer --execution-provider coreml
脸部增强模型(GFPGAN v1.4)下载地址:
https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth
(下载后放入到models下面)