forked from TencentARC/GFPGAN
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major revision: Support Pypi (TencentARC#37)
* reorganize * update inference * update inference * format
- Loading branch information
Showing
28 changed files
with
470 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: PyPI Publish | ||
|
||
on: push | ||
|
||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.event.ref, 'refs/tags') | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- name: Upgrade pip | ||
run: pip install pip --upgrade | ||
- name: Install PyTorch (cpu) | ||
run: pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Build and install | ||
run: rm -rf .eggs && pip install -e . | ||
- name: Build for distribution | ||
# remove bdist_wheel for pip installation with compiling cuda extensions | ||
run: python setup.py sdist | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
include assets/* | ||
include inputs/* | ||
include scripts/*.py | ||
include inference_gfpgan.py | ||
include VERSION | ||
include LICENSE | ||
include requirements.txt | ||
include gfpgan/weights/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# flake8: noqa | ||
from .archs import * | ||
from .data import * | ||
from .models import * | ||
from .utils import * | ||
from .version import __gitsha__, __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import importlib | ||
from os import path as osp | ||
|
||
from basicsr.utils import scandir | ||
from os import path as osp | ||
|
||
# automatically scan and import arch modules for registry | ||
# scan all the files under the 'archs' folder and collect files ending with | ||
# '_arch.py' | ||
# scan all the files that end with '_arch.py' under the archs folder | ||
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] | ||
_arch_modules = [importlib.import_module(f'gfpgan.archs.{file_name}') for file_name in arch_filenames] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import torch.nn as nn | ||
|
||
from basicsr.utils.registry import ARCH_REGISTRY | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
5 changes: 2 additions & 3 deletions
5
archs/stylegan2_clean_arch.py → gfpgan/archs/stylegan2_clean_arch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import importlib | ||
from os import path as osp | ||
|
||
from basicsr.utils import scandir | ||
from os import path as osp | ||
|
||
# automatically scan and import dataset modules for registry | ||
# scan all the files under the data folder with '_dataset' in file names | ||
# scan all the files that end with '_dataset.py' under the data folder | ||
data_folder = osp.dirname(osp.abspath(__file__)) | ||
dataset_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.endswith('_dataset.py')] | ||
# import all the dataset modules | ||
_dataset_modules = [importlib.import_module(f'data.{file_name}') for file_name in dataset_filenames] | ||
_dataset_modules = [importlib.import_module(f'gfpgan.data.{file_name}') for file_name in dataset_filenames] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import importlib | ||
from os import path as osp | ||
|
||
from basicsr.utils import scandir | ||
from os import path as osp | ||
|
||
# automatically scan and import model modules for registry | ||
# scan all the files under the 'models' folder and collect files ending with | ||
# '_model.py' | ||
# scan all the files that end with '_model.py' under the model folder | ||
model_folder = osp.dirname(osp.abspath(__file__)) | ||
model_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(model_folder) if v.endswith('_model.py')] | ||
# import all the model modules | ||
_model_modules = [importlib.import_module(f'models.{file_name}') for file_name in model_filenames] | ||
_model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# flake8: noqa | ||
import os.path as osp | ||
from basicsr.train import train_pipeline | ||
|
||
import gfpgan.archs | ||
import gfpgan.data | ||
import gfpgan.models | ||
|
||
if __name__ == '__main__': | ||
root_path = osp.abspath(osp.join(__file__, osp.pardir, osp.pardir)) | ||
train_pipeline(root_path) |
Oops, something went wrong.