setup Module
Install packages for faceswap.py
- class setup.Checks(environment: Environment)
Pre-installation checks
- Parameters:
environment (Environment) – Environment class holding information about the running system
- class setup.Environment(updater: bool = False)
The current install environment
- Parameters:
updater (bool) –
Trueif the script is being called by Faceswap’s internal updater.Falseif full setup is running. Default:False
- property cuda_version: str
The detected globally installed Cuda Version
- property cudnn_version: str
The detected globally installed cuDNN Version
- set_backend(backend: Literal['nvidia', 'apple_silicon', 'cpu', 'rocm']) None
Set the backend to install for
- Parameters:
backend (Literal['nvidia', 'apple_silicon', 'cpu', 'rocm']) – The backend to setup faceswap for
- Return type:
None
- set_config() None
Set the backend in the faceswap config file
- Return type:
None
- set_requirements(requirements: str) None
Validate that the requirements are compatible with the running Python version and set the requirements file version to install use
- Parameters:
backend – The requirements file version to use for install
requirements (str)
- Return type:
None
- class setup.Install(environment: Environment, is_gui: bool = False)
Handles installation of Faceswap requirements
- Parameters:
environment (Environment) – Environment class holding information about the running system
is_gui (bool) –
Trueif the caller is the Faceswap GUI. Used to prevent output of progress bars which get scrambled in the GUI
- class setup.Installer(environment: Environment, packages: list[str], command: list[str], is_conda: bool, is_gui: bool)
Uses the python Subprocess module to install packages.
- Parameters:
environment (Environment) – Environment class holding information about the running system
packages (list[str]) – The list of package names that are to be installed
command (list[str]) – The command to run
is_conda (bool) –
Trueif conda install command is running.Falseif pip install command is runningis_gui (bool) –
Trueif the process is being called from the Faceswap GUI
- __call__() int
Install a package using the Subprocess module
- Return type:
The return code of the package install process
- class setup.RequiredPackages(environment: Environment)
Holds information about installed and required packages. Handles updating dependencies based on running platform/backend
- Parameters:
environment (Environment) – Environment class holding information about the running system
- property packages_need_install: bool
Trueif there are packages available that need to be installed
- pip_arguments
Any additional pip arguments that are required for installing from pip for the given backend
- class setup.Status(is_conda: bool)
Simple Status output for intercepting Conda/Pip installs and keeping the terminal clean
- Parameters:
is_conda (bool) –
Trueif installing packages from Conda.Falseif installing from pip
- __call__(line: str) None
Update the output status with the given line
- Parameters:
line (str) – A cleansed line from either Conda or Pip installers
- Return type:
None
- close() None
Reset all progress bars and re-enable the cursor
- Return type:
None
- class setup.Tips
Display installation Tips
- classmethod macos() None
Output Tips for macOS
- Return type:
None
- classmethod pip() None
Pip Tips
- Return type:
None
Classes
|
Pre-installation checks |
|
The current install environment |
|
Handles installation of Faceswap requirements |
|
Uses the python Subprocess module to install packages. |
|
Holds information about installed and required packages. |
|
Simple Status output for intercepting Conda/Pip installs and keeping the terminal clean |
|
Display installation Tips |