### Defining Python Project Dependencies Source: https://github.com/s0md3v/roop/blob/main/requirements-headless.txt This snippet specifies the Python packages and their exact versions required for the project. These dependencies are typically installed using pip from a `requirements.txt` file, ensuring all necessary libraries are available and compatible. ```Python numpy==1.24.3 opencv-python==4.8.0.74 onnx==1.14.0 insightface==0.7.3 psutil==5.9.5 tk==0.1.0 customtkinter==5.2.0 tkinterdnd2==0.3.0 onnxruntime==1.15.0 tensorflow==2.13.0 opennsfw2==0.10.2 protobuf==4.23.4 tqdm==4.65.0 ``` -------------------------------- ### Roop Project Python Package Requirements Source: https://github.com/s0md3v/roop/blob/main/requirements.txt This snippet defines the complete set of Python package dependencies for the Roop project. It includes specific version pinning for stability, an extra index URL for PyTorch wheels, and conditional installations for `tkinterdnd2` and `onnxruntime` to support various operating systems (macOS, Windows, Linux) and architectures (ARM64, x86_64). ```Python --extra-index-url https://download.pytorch.org/whl/cu118 numpy==1.24.3 opencv-python==4.8.0.74 onnx==1.14.0 insightface==0.7.3 psutil==5.9.5 tk==0.1.0 customtkinter==5.2.0 tkinterdnd2==0.3.0; sys_platform != 'darwin' and platform_machine != 'arm64' tkinterdnd2-universal==1.7.3; sys_platform == 'darwin' and platform_machine == 'arm64' pillow==10.0.0 onnxruntime==1.15.1; python_version != '3.9' and sys_platform == 'darwin' and platform_machine != 'arm64' onnxruntime-coreml==1.13.1; python_version == '3.9' and sys_platform == 'darwin' and platform_machine != 'arm64' onnxruntime-silicon==1.13.1; sys_platform == 'darwin' and platform_machine == 'arm64' onnxruntime-gpu==1.15.1; sys_platform != 'darwin' tensorflow==2.13.0 opennsfw2==0.10.2 protobuf==4.23.4 tqdm==4.65.0 gfpgan==1.3.8 ``` -------------------------------- ### Running Roop with Command-Line Arguments (Python) Source: https://github.com/s0md3v/roop/blob/main/README.md This snippet demonstrates how to execute the Roop program from the command line, specifying various options for source and target media, output paths, frame processing, and performance settings. It outlines the available arguments to control the face-swapping process. ```Bash python run.py [options] -h, --help show this help message and exit -s SOURCE_PATH, --source SOURCE_PATH select an source image -t TARGET_PATH, --target TARGET_PATH select an target image or video -o OUTPUT_PATH, --output OUTPUT_PATH select output file or directory --frame-processor FRAME_PROCESSOR [FRAME_PROCESSOR ...] frame processors (choices: face_swapper, face_enhancer, ...) --keep-fps keep target fps --keep-frames keep temporary frames --skip-audio skip target audio --many-faces process every face --reference-face-position REFERENCE_FACE_POSITION position of the reference face --reference-frame-number REFERENCE_FRAME_NUMBER number of the reference frame --similar-face-distance SIMILAR_FACE_DISTANCE face distance used for recognition --temp-frame-format {jpg,png} image format used for frame extraction --temp-frame-quality [0-100] image quality used for frame extraction --output-video-encoder {libx264,libx265,libvpx-vp9,h264_nvenc,hevc_nvenc} encoder used for the output video --output-video-quality [0-100] quality used for the output video --max-memory MAX_MEMORY maximum amount of RAM in GB --execution-provider {cpu} [{cpu} ...] available execution provider (choices: cpu, ...) --execution-threads EXECUTION_THREADS number of execution threads -v, --version show program's version number and exit ```