Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .dockerignore

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
!/requirements/*.py

# Root files
!Dockerfile*
!pyproject.toml
!.gitignore
!.travis.yml
Expand Down
19 changes: 0 additions & 19 deletions Dockerfile.cpu

This file was deleted.

18 changes: 0 additions & 18 deletions Dockerfile.gpu

This file was deleted.

90 changes: 3 additions & 87 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
- [Getting the faceswap code](#getting-the-faceswap-code)
- [Setup](#setup-2)
- [About some of the options](#about-some-of-the-options)
- [Docker Install Guide](#docker-install-guide)
- [Docker CPU](#docker-cpu)
- [Docker Nvidia](#docker-nvidia)
- [Run the project](#run-the-project)
- [Notes](#notes)

Expand Down Expand Up @@ -74,8 +71,6 @@ The type of computations that the process does are well suited for graphics card
Intel based macOS systems should work, but you will need to follow the [Manual Install](#manual-install) instructions.
- All operating systems must be 64-bit.

Alternatively, there is a docker image that is based on Debian.

# Important before you proceed
**In its current iteration, the project relies heavily on the use of the command line, although a gui is available. if you are unfamiliar with command line tools, you may have difficulty setting up the environment and should perhaps not attempt any of the steps described in this guide.** This guide assumes you have intermediate knowledge of the command line.

Expand Down Expand Up @@ -131,7 +126,7 @@ To enter the virtual environment:
- If you have issues/errors follow the Manual install steps below.

#### Manual install
Do not follow these steps if the Easy Install above completed succesfully.
Do not follow these steps if the Easy Install above completed successfully.
If you are using an Nvidia card make sure you have the correct versions of Cuda/cuDNN installed for the required version of Torch
- Install tkinter (required for the GUI) by typing: `conda install tk`
- Install requirements:
Expand Down Expand Up @@ -251,7 +246,7 @@ Alternatively you can install Python (3.14 64-bit) for your distribution (links

If using Conda3 then setting up virtual environments is relatively straight forward. More information can be found at [Conda Docs](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)

If using a default Python distribution then [virtualenv](https://github.com/pypa/virtualenv) and [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io) may help when you are not using docker.
If using a default Python distribution then [virtualenv](https://github.com/pypa/virtualenv) and [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io) may help.


## Getting the faceswap code
Expand All @@ -270,87 +265,8 @@ If setup fails for any reason you can still manually install the packages listed

### About some of the options
- CUDA: For acceleration. Requires a good nVidia Graphics Card (which supports CUDA inside)
- Docker: Provide a ready-made image. Hide trivial details. Get you straight to the project.
- nVidia-Docker: Access to the nVidia GPU on host machine from inside container.

# Docker Install Guide

This Faceswap repo contains Docker build scripts for CPU and Nvidia backends. The scripts will set up a Docker container for you and install the latest version of the Faceswap software.

You must first ensure that Docker is installed and running on your system. Follow the guide for downloading and installing Docker from their website:

- https://www.docker.com/get-started
- ROCm: For AMD GPUs under Linux/WSL2 only. Make sure you install the correct version of faceswap for your installed ROCm version

Once Docker is installed and running, follow the relevant steps for your chosen backend
## Docker CPU
To run the CPU version of Faceswap follow these steps:

1. Build the Docker image For faceswap:
```
docker build \
-t faceswap-cpu \
https://raw.githubusercontent.com/deepfakes/faceswap/master/Dockerfile.cpu
```
2. Launch and enter the Faceswap container:

a. For the **headless/command line** version of Faceswap run:
```
docker run --rm -it faceswap-cpu
```
You can then execute faceswap the standard way:
```
python faceswap.py --help
```
b. For the **GUI** version of Faceswap run:
```
xhost +local: && \
docker run --rm -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=${DISPLAY} \
faceswap-cpu
```
You can then launch the GUI with
```
python faceswap.py gui
```
## Docker Nvidia
To build the NVIDIA GPU version of Faceswap, follow these steps:

1. Nvidia Docker builds need extra resources to provide the Docker container with access to your GPU.

a. Follow the instructions to install and apply the `Nvidia Container Toolkit` for your distribution from:
- https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

b. If Docker is already running, restart it to pick up the changes made by the Nvidia Container Toolkit.

2. Build the Docker image For faceswap
```
docker build \
-t faceswap-gpu \
https://raw.githubusercontent.com/deepfakes/faceswap/master/Dockerfile.gpu
```
1. Launch and enter the Faceswap container:

a. For the **headless/command line** version of Faceswap run:
```
docker run --runtime=nvidia --rm -it faceswap-gpu
```
You can then execute faceswap the standard way:
```
python faceswap.py --help
```
b. For the **GUI** version of Faceswap run:
```
xhost +local: && \
docker run --runtime=nvidia --rm -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=${DISPLAY} \
faceswap-gpu
```
You can then launch the GUI with
```
python faceswap.py gui
```
# Run the project
Once all these requirements are installed, you can attempt to run the faceswap tools. Use the `-h` or `--help` options for a list of options.

Expand Down
4 changes: 2 additions & 2 deletions lib/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from lib.gpu_stats import GPUStats
from lib.logger import crash_log, log_setup
from lib.system.system import VALID_TORCH
from lib.utils import (FaceswapError, get_backend, get_torch_version,
get_module_objects, safe_shutdown, set_backend)

Expand Down Expand Up @@ -77,8 +78,7 @@ def _test_for_torch_version(self) -> None:
FaceswapError
If PyTorch is not found, or is not between versions 2.3 and 2.11
"""
min_ver = (2, 3)
max_ver = (2, 11)
min_ver, max_ver = VALID_TORCH
try:
import torch # noqa:F401 pylint:disable=unused-import,import-outside-toplevel
except ImportError as err:
Expand Down
Loading
Loading