Environment

class setup.Environment(updater: bool = False)

Bases: object

The current install environment

Parameters:

updater (bool) – True if the script is being called by Faceswap’s internal updater. False if full setup is running. Default: False

Attributes Summary

cuda_version

The detected globally installed Cuda Version

cudnn_version

The detected globally installed cuDNN Version

Methods Summary

set_backend(backend)

Set the backend to install for

set_config()

Set the backend in the faceswap config file

set_requirements(requirements)

Validate that the requirements are compatible with the running Python version and set the requirements file version to install use

Attributes Documentation

cuda_version

The detected globally installed Cuda Version

cudnn_version

The detected globally installed cuDNN Version

Methods Documentation

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

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