1
0
mirror of https://github.com/TencentARC/GFPGAN.git synced 2025-05-16 23:30:13 -07:00
GFPGAN/archs/__init__.py
2021-05-18 15:09:11 +08:00

13 lines
510 B
Python

import importlib
from os import path as osp
from basicsr.utils import scandir
# 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'archs.{file_name}') for file_name in arch_filenames]