Be sure to check C++ desktop development and the latest Windows 10 SDK.
3. Install Python 3.10.6 (it is recommended not to use a version higher than 3.10.9) https://www.python.org/downloads/release/python-3106/
4. Download and extract ffmpeg, then add it to the environment variables.
5. Download and extract the project archive. https://github.com/s0md3v/roop/
6. Install project dependencies.
In the command window, enter the project root directory.
python -m venv venv
call venv\Scripts\activate.bat
pip install -r requirements.txt
(If installation fails due to conflicting dependency packages in the local cache, you can run:
pip install --no-cache-dir -r requirements.txt
pip uninstall onnxruntime onnxruntime-gpu
pip install onnxruntime-gpu==1.15.0
)
7. Run the program.
call venv\Scripts\activate.bat
Process video with CPU only: python run.py
Process video with GPU: python run.py --execution-provider cuda
Video HD enhancement processing: python run.py --execution-provider cuda --frame-processor face_enhancer
8. Cloud drive installation package https://pan.baidu.com/share/init?surl=BTu7gQ_EXTbcqeNchhqVQQ
Extraction code: nr8m
II. Batch Processing Images for Face Swapping
Open the command window.
Enter the local roop root directory.
Run the following commands:
call venv\Scripts\activate.bat
python run.py --execution-provider cuda
[ Optional parameters: ]
1. Face enhancement
python run.py --execution-provider cuda face_enhancer
2. Adjust output video quality
python run.py --execution-provider cuda --video-quality 1
(0-50; the smaller the number, the higher the quality; the default is 0)
3. Specify memory
python run.py --execution-provider cuda --max-memory 16
4. Specify threads (suitable for older NVIDIA cards)
python run.py --execution-provider cuda --execution-threads 2
(The default is 4)
Copy code
Rename ui.py under the roop subdirectory of the original project.
Create a new ui.py file in the project subdirectory and paste the code.
Run the program.
cmd
call venv\scripts\activate.bat
python run.py --execution-provider cuda