Skip to content
Open
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
131 changes: 131 additions & 0 deletions modules/VideoFaceSwapper/CodeFormer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
.vscode

# ignored files
version.py

# ignored files with suffix
*.html
# *.png
# *.jpeg
# *.jpg
*.pt
*.gif
*.pth
*.dat
*.zip

# template

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# project
results/
experiments/
tb_logger/
run.sh
*debug*
*_old*

1 change: 1 addition & 0 deletions modules/VideoFaceSwapper/CodeFormer/basicsr/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3.2
11 changes: 11 additions & 0 deletions modules/VideoFaceSwapper/CodeFormer/basicsr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://github.com/xinntao/CodeFormer.basicsr
# flake8: noqa
from .archs import *
from .data import *
from .losses import *
from .metrics import *
from .models import *
from .ops import *
from .train import *
from .utils import *
#from .version import __gitsha__, __version__
25 changes: 25 additions & 0 deletions modules/VideoFaceSwapper/CodeFormer/basicsr/archs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import importlib
from copy import deepcopy
from os import path as osp

from CodeFormer.basicsr.utils import get_root_logger, scandir
from CodeFormer.basicsr.utils.registry import ARCH_REGISTRY

__all__ = ['build_network']

# automatically scan and import arch modules for registry
# scan all the files under the 'archs' folder and collect files ending with
# '_arch.py'
arch_folder = osp.dirname(osp.abspath(__file__))
arch_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(arch_folder) if v.endswith('_arch.py')]
# import all the arch modules
_arch_modules = [importlib.import_module(f'CodeFormer.basicsr.archs.{file_name}') for file_name in arch_filenames]


def build_network(opt):
opt = deepcopy(opt)
network_type = opt.pop('type')
net = ARCH_REGISTRY.get(network_type)(**opt)
logger = get_root_logger()
logger.info(f'Network [{net.__class__.__name__}] is created.')
return net
Loading
Loading