Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

22.02 update #7

Merged
merged 23 commits into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
08ba52f
replace setup.py with poetry
lx-ykachan Mar 14, 2021
aa8e2e4
fix pipeline test
lx-ykachan Mar 14, 2021
8446186
Merge pull request #2 from leverxgroup/feat-poetry
lx-ykachan Mar 14, 2021
8ce46e6
add codestyle test
lx-ykachan Mar 14, 2021
4630a1a
fix rst docs
lx-ykachan Mar 14, 2021
9017d59
fix codestyle
lx-ykachan Mar 14, 2021
1f201bc
update readthedocs config
lx-ykachan Mar 14, 2021
b402873
Merge pull request #4 from leverxgroup/fix-readthedocs
lx-ykachan Mar 14, 2021
f713dfd
Merge pull request #3 from leverxgroup/tests-codestyle
lx-ykachan Mar 14, 2021
d5b31ac
update dev tools configs, update docs
bagxi Jun 29, 2021
887cc69
build: Bump catalyst from 20.10 to 21.12 (#6)
bagxi Jan 22, 2022
711cfb5
docs: (readthedocs) links fixed
bagxi Jan 22, 2022
8f0a064
feat: `Flickr2K` dataset added
bagxi Jan 22, 2022
bc96403
refactor: `_PairedImagesDataset` over `DIV2KDataset` and `Flickr2KDat…
bagxi Feb 3, 2022
02615d3
refactor: package structure updated, docs updated
bagxi Feb 3, 2022
8721167
refactor: training config updated
bagxi Feb 4, 2022
e7402a8
tests: separate config for pipeline tests added
bagxi Feb 4, 2022
eeca1a6
refactor: files premissions fixed
bagxi Feb 4, 2022
3840d89
docs: page with the installation instructions added, fixes
bagxi Feb 6, 2022
6d88b3e
docs: page with ESRGAN description added
bagxi Feb 6, 2022
960cf8a
docs: headers fixed
bagxi Feb 6, 2022
085be93
docs: links and structure updated
bagxi Feb 6, 2022
463d021
build: list of supported versions of Python updated
bagxi Feb 6, 2022
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
13 changes: 13 additions & 0 deletions .github/.stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- master
- develop

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install poetry
run: |
pip install -U pip
curl -sSL "https://install.python-poetry.org" | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH

- name: Set up cache
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry run pip install -U pip
poetry install

- name: Check codestyle
run: |
poetry run flake8 --show-source --statistics --count -- .
poetry run isort --check-only -- .
# poetry run mypy -- .
poetry run doc8 -q -- docs

# - name: Unit tests
# run: |
# poetry run pytest .

- name: Check dependencies compatibility
run: |
poetry run poetry check
poetry run pip check
39 changes: 20 additions & 19 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,46 @@ on:
pull_request:
branches:
- master
- develop

jobs:
build:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
- name: Install poetry
run: |
echo "::set-output name=dir::$(pip cache dir)"
pip install -U pip
curl -sSL "https://install.python-poetry.org" | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH

- name: Set up cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
pip install -r requirements.txt
python setup.py install
poetry config virtualenvs.in-project true
poetry run pip install -U pip
poetry install

- name: Cache data
id: cache-div2k
uses: actions/cache@v2
with:
path: data/*.zip
key: ${{ runner.os }}-data
key: data-div2k
- name: Download DIV2K dataset
if: steps.cache-div2k.outputs.cache-hit != 'true'
run: |
Expand All @@ -50,10 +55,6 @@ jobs:
wget http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_HR.zip -P ./data/
wget https://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_LR_bicubic_X4.zip -P ./data/

- name: Check pipeline - phase 1 (supervised)
run: |
catalyst-dl run -C experiment/config_supervised.yml --check --stages/data_params/batch_size=2:int

- name: Check pipeline - phase 2(GAN)
- name: Check pipeline
run: |
catalyst-dl run -C experiment/config_gan.yml --check --stages/data_params/batch_size=2:int
poetry run catalyst-dl run -C tests/pipeline/config.yml --check
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ sphinx:
python:
version: 3.8
install:
- method: pip
path: .
- requirements: docs/requirements.txt
- requirements: requirements.txt
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,22 @@ Key points of ESRGAN:

* `Catalyst` as pipeline runner for deep learning tasks. This new and rapidly developing [library](https://github.com/catalyst-team/catalyst).
can significantly reduce the amount of boilerplate code. If you are familiar with the TensorFlow ecosystem, you can think of Catalyst
as Keras for PyTorch. This framework is integrated with logging systems such as the well-known [TensorBoard](https://www.tensorflow.org/tensorboard).
* `Pytorch`, `torchvision`, and `PIQ` as main frameworks for deep learning.
* `Albumentations` for data preprocessing.
as Keras for PyTorch. This framework is integrated with logging systems such as the well-known [TensorBoard](https://www.tensorflow.org/tensorboard);
* `Pytorch` and `torchvision` as main frameworks for deep learning;
* `Albumentations` and `PIQ` for data processing.

## Quick Start

### Setup environment
`esrgan` requires python >= 3.8. The [requirements.txt](requirements.txt) file can be used to install the necessary packages.

```
git clone https://github.com/leverxgroup/esrgan.git
pip install ./esrgan
```bash
pip install git+https://github.com/leverxgroup/esrgan.git
```

### Run an experiment
```bash
catalyst-dl run -C esrgan/config.yml --benchmark
```
# step 1 - supervised training of the model
catalyst-dl run -C esrgan/experiment/config_supervised.yml --benchmark

# step 2 - use weights from step 1 to train model using GAN approach
catalyst-dl run -C esrgan/experiment/config_gan.yml --benchmark
```
where `esrgan/experiment/config.yml` is a path to the [config](experiment/config.yml) file.
where `esrgan/config.yml` is a path to the [config](config.yml) file.

## Results
Some examples of work of ESRGAN model trained on [DIV2K](https://data.vision.ee.ethz.ch/cvl/DIV2K) dataset:
Expand All @@ -52,5 +45,8 @@ Some examples of work of ESRGAN model trained on [DIV2K](https://data.vision.ee.
| <img src="docs/_static/wf_crop_lr.png" height="128" width="128"/> | <img src="docs/_static/wf_crop_sr_x4.png" height="128" width="128"/> | <img src="docs/_static/wf_crop_hr.png" height="128" width="128"/> |
| <img src="docs/_static/fish_crop_lr.png" height="128" width="128"/> | <img src="docs/_static/fish_crop_sr_x4.png" height="128" width="128"/> | <img src="docs/_static/fish_crop_hr.png" height="128" width="128"/> |

## Documentation
Full documentation for the project is available at https://esrgan.readthedocs.io/

## License
`esrgan` is released under a CC BY-NC-ND 4.0 license. See [LICENSE](LICENSE) for additional details about it.
Loading