Full Code of xiaom233/BSRN for AI

main 2d63d5239c9f cached
182 files
3.5 MB
915.0k tokens
673 symbols
1 requests
Download .txt
Showing preview only (3,669K chars total). Download the full file or copy to clipboard to get everything.
Repository: xiaom233/BSRN
Branch: main
Commit: 2d63d5239c9f
Files: 182
Total size: 3.5 MB

Directory structure:
gitextract_k1iv7nsr/

├── .gitignore
├── .pre-commit-config.yaml
├── INSTALL.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── VERSION
├── basicsr/
│   ├── __init__.py
│   ├── archs/
│   │   ├── BSRN_arch.py
│   │   ├── Blocks.py
│   │   ├── RFDN_arch.py
│   │   ├── Upsamplers.py
│   │   ├── __init__.py
│   │   ├── arch_util.py
│   │   ├── rfdnfinalB5_arch.py
│   │   └── vgg_arch.py
│   ├── data/
│   │   ├── __init__.py
│   │   ├── data_sampler.py
│   │   ├── data_util.py
│   │   ├── degradations.py
│   │   ├── ffhq_dataset.py
│   │   ├── meta_info/
│   │   │   ├── meta_info_DIV2K800sub_GT.txt
│   │   │   ├── meta_info_REDS4_test_GT.txt
│   │   │   ├── meta_info_REDS_GT.txt
│   │   │   ├── meta_info_REDSofficial4_test_GT.txt
│   │   │   ├── meta_info_REDSval_official_test_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_fast_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_medium_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_slow_GT.txt
│   │   │   └── meta_info_Vimeo90K_train_GT.txt
│   │   ├── paired_image_dataset.py
│   │   ├── prefetch_dataloader.py
│   │   ├── reds_dataset.py
│   │   ├── single_image_dataset.py
│   │   ├── transforms.py
│   │   ├── video_test_dataset.py
│   │   └── vimeo90k_dataset.py
│   ├── losses/
│   │   ├── __init__.py
│   │   ├── loss_util.py
│   │   └── losses.py
│   ├── metrics/
│   │   ├── __init__.py
│   │   ├── fid.py
│   │   ├── metric_util.py
│   │   ├── niqe.py
│   │   ├── niqe_pris_params.npz
│   │   └── psnr_ssim.py
│   ├── models/
│   │   ├── __init__.py
│   │   ├── base_model.py
│   │   ├── edvr_model.py
│   │   ├── esrgan_model.py
│   │   ├── hifacegan_model.py
│   │   ├── lr_scheduler.py
│   │   ├── sr_model.py
│   │   ├── srgan_model.py
│   │   ├── stylegan2_model.py
│   │   ├── swinir_model.py
│   │   ├── video_base_model.py
│   │   ├── video_gan_model.py
│   │   ├── video_recurrent_gan_model.py
│   │   └── video_recurrent_model.py
│   ├── ops/
│   │   ├── __init__.py
│   │   ├── dcn/
│   │   │   ├── __init__.py
│   │   │   ├── deform_conv.py
│   │   │   └── src/
│   │   │       ├── deform_conv_cuda.cpp
│   │   │       ├── deform_conv_cuda_kernel.cu
│   │   │       └── deform_conv_ext.cpp
│   │   ├── fused_act/
│   │   │   ├── __init__.py
│   │   │   ├── fused_act.py
│   │   │   └── src/
│   │   │       ├── fused_bias_act.cpp
│   │   │       └── fused_bias_act_kernel.cu
│   │   └── upfirdn2d/
│   │       ├── __init__.py
│   │       ├── src/
│   │       │   ├── upfirdn2d.cpp
│   │       │   └── upfirdn2d_kernel.cu
│   │       └── upfirdn2d.py
│   ├── summary.py
│   ├── test.py
│   ├── train.py
│   └── utils/
│       ├── __init__.py
│       ├── diffjpeg.py
│       ├── dist_util.py
│       ├── download_util.py
│       ├── face_util.py
│       ├── file_client.py
│       ├── flow_util.py
│       ├── img_process_util.py
│       ├── img_util.py
│       ├── lmdb_util.py
│       ├── logger.py
│       ├── matlab_functions.py
│       ├── misc.py
│       ├── options.py
│       └── registry.py
├── colab/
│   └── README.md
├── datasets/
│   └── README.md
├── docs/
│   ├── Config.md
│   ├── Config_CN.md
│   ├── DatasetPreparation.md
│   ├── DatasetPreparation_CN.md
│   ├── Datasets.md
│   ├── Datasets_CN.md
│   ├── DesignConvention.md
│   ├── DesignConvention_CN.md
│   ├── HOWTOs.md
│   ├── HOWTOs_CN.md
│   ├── Logging.md
│   ├── Logging_CN.md
│   ├── Makefile
│   ├── Metrics.md
│   ├── Metrics_CN.md
│   ├── ModelZoo.md
│   ├── ModelZoo_CN.md
│   ├── Models.md
│   ├── Models_CN.md
│   ├── TrainTest.md
│   ├── TrainTest_CN.md
│   ├── api.rst
│   ├── conf.py
│   ├── history_updates.md
│   ├── index.rst
│   └── make.bat
├── experiments/
│   └── pretrained_models/
│       ├── net_g_BSRN-S.pth
│       ├── net_g_BSRN_x2.pth
│       ├── net_g_BSRN_x3.pth
│       └── net_g_BSRN_x4.pth
├── options/
│   ├── test/
│   │   ├── benchmark_BSRN-S_x4.yml
│   │   ├── benchmark_BSRN_x2.yml
│   │   ├── benchmark_BSRN_x3.yml
│   │   └── benchmark_BSRN_x4.yml
│   └── train/
│       ├── train_BSRN-S_x4.yml
│       ├── train_BSRN_x2.yml
│       ├── train_BSRN_x3.yml
│       └── train_BSRN_x4.yml
├── requirements.txt
├── scripts/
│   ├── data_preparation/
│   │   ├── create_lmdb.py
│   │   ├── download_datasets.py
│   │   ├── extract_images_from_tfrecords.py
│   │   ├── extract_subimages.py
│   │   ├── generate_meta_info.py
│   │   ├── prepare_hifacegan_dataset.py
│   │   └── regroup_reds_dataset.py
│   ├── dist_test.sh
│   ├── dist_train.sh
│   ├── download_gdrive.py
│   ├── download_pretrained_models.py
│   ├── matlab_scripts/
│   │   ├── back_projection/
│   │   │   ├── backprojection.m
│   │   │   ├── main_bp.m
│   │   │   └── main_reverse_filter.m
│   │   ├── generate_LR_Vimeo90K.m
│   │   └── generate_bicubic_img.m
│   ├── metrics/
│   │   ├── calculate_fid_folder.py
│   │   ├── calculate_fid_stats_from_datasets.py
│   │   ├── calculate_lpips.py
│   │   ├── calculate_niqe.py
│   │   ├── calculate_psnr_ssim.py
│   │   └── calculate_stylegan2_fid.py
│   ├── model_conversion/
│   │   ├── convert_dfdnet.py
│   │   ├── convert_models.py
│   │   ├── convert_ridnet.py
│   │   └── convert_stylegan.py
│   └── publish_models.py
├── setup.cfg
├── setup.py
└── tests/
    ├── README.md
    ├── data/
    │   ├── gt.lmdb/
    │   │   ├── data.mdb
    │   │   ├── lock.mdb
    │   │   └── meta_info.txt
    │   ├── lq.lmdb/
    │   │   ├── data.mdb
    │   │   ├── lock.mdb
    │   │   └── meta_info.txt
    │   ├── meta_info_gt.txt
    │   └── meta_info_pair.txt
    ├── test_archs/
    │   ├── test_basicvsr_arch.py
    │   ├── test_discriminator_arch.py
    │   ├── test_duf_arch.py
    │   ├── test_ecbsr_arch.py
    │   └── test_srresnet_arch.py
    ├── test_data/
    │   ├── test_paired_image_dataset.py
    │   └── test_single_image_dataset.py
    ├── test_losses/
    │   └── test_losses.py
    ├── test_metrics/
    │   └── test_psnr_ssim.py
    └── test_models/
        └── test_sr_model.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# ignored folders
results/*
tb_logger/*
wandb/*
tmp/*

*.DS_Store
.idea

# ignored files
version.py

# ignored files with suffix
*.html
*.png
*.jpeg
*.jpg
*.gif
*.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/


================================================
FILE: .pre-commit-config.yaml
================================================
repos:
  # flake8
  - repo: https://github.com/PyCQA/flake8
    rev: 3.8.3
    hooks:
      - id: flake8
        args: ["--config=setup.cfg", "--ignore=W504, W503"]

  # modify known_third_party
  - repo: https://github.com/asottile/seed-isort-config
    rev: v2.2.0
    hooks:
      - id: seed-isort-config

  # isort
  - repo: https://github.com/timothycrosley/isort
    rev: 5.2.2
    hooks:
      - id: isort

  # yapf
  - repo: https://github.com/pre-commit/mirrors-yapf
    rev: v0.30.0
    hooks:
      - id: yapf

  # codespell
  - repo: https://github.com/codespell-project/codespell
    rev: v2.1.0
    hooks:
      - id: codespell

  # pre-commit-hooks
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v3.2.0
    hooks:
      - id: trailing-whitespace  # Trim trailing whitespace
      - id: check-yaml  # Attempt to load all yaml files to verify syntax
      - id: check-merge-conflict  # Check for files that contain merge conflict strings
      - id: double-quote-string-fixer  # Replace double quoted strings with single quoted strings
      - id: end-of-file-fixer  # Make sure files end in a newline and only a newline
      - id: requirements-txt-fixer  # Sort entries in requirements.txt and remove incorrect entry for pkg-resources==0.0.0
      - id: fix-encoding-pragma  # Remove the coding pragma: # -*- coding: utf-8 -*-
        args: ["--remove"]
      - id: mixed-line-ending  # Replace or check mixed line ending
        args: ["--fix=lf"]


================================================
FILE: INSTALL.md
================================================
# Installation

## Contents

- [Requirements](#requirements)
- [BASICSR_EXT and BASICSR_JIT environment variables](#basicsr_ext-and-basicsr_jit-environment-variables)
- [Installation Options](#installation-options)
  - [Install from PyPI](#install-from-pypi)
  - [Install from a local clone](#Install-from-a-local-clone)
- [FAQ](#faq)

## Requirements

- Python >= 3.7 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html))
- [PyTorch >= 1.7](https://pytorch.org/)
- NVIDIA GPU + [CUDA](https://developer.nvidia.com/cuda-downloads)
- Linux (We have not tested on Windows)

## BASICSR_EXT and BASICSR_JIT Environment Variables

If you want to use PyTorch C++ extensions:<br>
&emsp;deformable convolution: [*dcn* for EDVR](basicsr/ops) (For torchvision>=0.9.0, we use the official `torchvision.ops.deform_conv2d` instead)<br>
&emsp;StyleGAN customized operators: [*upfirdn2d* and *fused_act* for StyleGAN2](basicsr/ops)<br>
you also need to:

1. **compile** the PyTorch C++ extensions during installation
2. OR **load** the PyTorch C++ extensions just-in-time (JIT)

You may choose one of the options according to your needs.

| Option | Pros| Cons | Cases | Env Variable|
| :--- | :---        |     :---      | :--- |:--- |
| **Compile** PyTorch C++ extensions during installation   | **Quickly load** the compiled extensions during running | May have more stringent requirements for the environment, and you may encounter annoying issues | If you need to train/inference those models for many times, it will save your time| Set `BASICSR_EXT=True` during **installation**|
| **Load** PyTorch C++ extensions just-in-time (JIT) | Have less requirements, may have less issues | Each time you run the model, it will takes several minutes to load extensions again  | If you just want to do simple inferences, it is more convenient| Set  `BASICSR_JIT=True` during **running** (not **installation**) |

For those who need to compile the PyTorch C++ extensions during installation, remember:

- Make sure that your gcc and g++ version: gcc & g++ >= 5

Note that:

- The `BASICSR_JIT` has higher priority, that is, even you have successfully compiled PyTorch C++ extensions during installation, it will still load the extensions just-in-time if you set `BASICSR_JIT=True` in your running commands.
- :x: Do not set `BASICSR_JIT` during installation. Installation commands are in [Installation Options](#installation-options).
- :heavy_check_mark: If you want to load PyTorch C++ extensions just-in-time (JIT), just set `BASICSR_JIT=True` before your  **running** commands. For example, `BASICSR_JIT=True python inference/inference_stylegan2.py`.

If you do not need those PyTorch C++ extensions, just skip it. There is no need to set `BASICSR_EXT` or `BASICSR_JIT` environment variables.

## Installation Options

There are two options to install BASICSR, according to your needs.

- If you just want to use BASICSR as a **package** (just like [GFPGAN](https://github.com/TencentARC/GFPGAN) and []()), it is recommended to install from PyPI.
- If you want to **investigate** the details of BASICSR OR **develop** it OR **modify** it to fulfill your needs, it is better to install from a local clone.

### Install from PyPI

- If you do not need C++ extensions (more details are [here](#basicsr_ext-and-basicsr_jit-environment-variables)):

  ```bash
  pip install basicsr
  ```

- If you want to use C++ extensions in **JIT mode** without compiling them during installatoin (more details are [here](#basicsr_ext-and-basicsr_jit-environment-variables)):

  ```bash
  pip install basicsr
  ```

- If you want to **compile C++ extensions during installation**, please set the environment variable `BASICSR_EXT=True`:

  ```bash
  BASICSR_EXT=True pip install basicsr
  ```

  The compilation may fail without any error prints. If you encounter running errors, such as `ImportError: cannot import name 'deform_conv_ext' | 'fused_act_ext' | 'upfirdn2d_ext'`, you may check the compilation process by re-installation. The following command will print detailed log:

  ```bash
  BASICSR_EXT=True pip install basicsr -vvv
  ```

  You may also want to specify the CUDA paths:

  ```bash
  CUDA_HOME=/usr/local/cuda \
  CUDNN_INCLUDE_DIR=/usr/local/cuda \
  CUDNN_LIB_DIR=/usr/local/cuda \
  BASICSR_EXT=True pip install basicsr
  ```

### Install from a local clone

1. Clone the repo

    ```bash
    git clone https://github.com/xinntao/BasicSR.git
    ```

1. Install dependent packages

    ```bash
    cd BasicSR
    pip install -r requirements.txt
    ```

1. Install BasicSR<br>
    Please run the following commands in the **BasicSR root path** to install BasicSR:<br>

    -  If you do not need C++ extensions (more details are [here](#basicsr_ext-and-basicsr_jit-environment-variables)):

        ```bash
        python setup.py develop
        ```

    - If you want to use C++ extensions in **JIT mode** without compiling them during installatoin (more details are [here](#basicsr_ext-and-basicsr_jit-environment-variables)):

        ```bash
        python setup.py develop
        ```

    - If you want to **compile C++ extensions during installation**, please set the environment variable `BASICSR_EXT=True`:

        ```bash
        BASICSR_EXT=True python setup.py develop
        ```

    You may also want to specify the CUDA paths:

    ```bash
    CUDA_HOME=/usr/local/cuda \
    CUDNN_INCLUDE_DIR=/usr/local/cuda \
    CUDNN_LIB_DIR=/usr/local/cuda \
    BASICSR_EXT=True python setup.py develop
    ```

## FAQ


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2022 Hoven Li

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: MANIFEST.in
================================================
include basicsr/ops/dcn/src/*.cu basicsr/ops/dcn/src/*.cpp
include basicsr/ops/fused_act/src/*.cu basicsr/ops/fused_act/src/*.cpp
include basicsr/ops/upfirdn2d/src/*.cu basicsr/ops/upfirdn2d/src/*.cpp
include basicsr/metrics/niqe_pris_params.npz
include VERSION
include requirements.txt


================================================
FILE: README.md
================================================
# BSRN
[Blueprint Separable Residual Network for Efficient Image Super-Resolution](https://arxiv.org/abs/2205.05996)   
[Zheyuan Li](https://xiaom233.github.io/), Yingqi Liu, Xiangyu Chen, Haoming Cai, Jinjin Gu, Yu Qiao, Chao Dong

BibTex
```
@InProceedings{Li_2022_CVPR,
    author    = {Li, Zheyuan and Liu, Yingqi and Chen, Xiangyu and Cai, Haoming and Gu, Jinjin and Qiao, Yu and Dong, Chao},
    title     = {Blueprint Separable Residual Network for Efficient Image Super-Resolution},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2022},
    pages     = {833-843}
}
```

## Environment

[PyTorch >= 1.7](https://pytorch.org/)  
[BasicSR >= 1.3.4.9](https://github.com/XPixelGroup/BasicSR)

### Installation
```
pip install -r requirements.txt
python setup.py develop
```

## How To Test
· Refer to ./options/test for the configuration file of the model to be tested, and prepare the testing data and pretrained model.  
· The pretrained models are available in ./experiments/pretrained_models/  
· Then run the follwing codes (taking net_g_BSRN_x4.pth as an example):  

```
python basicsr/test.py -opt options/test/benchmark_BSRN_x4.yml
```
The testing results will be saved in the ./results folder.

## How To Train
· Refer to ./options/train for the configuration file of the model to train.  
· Preparation of training data can refer to this page. All datasets can be downloaded at the official website.  
· Note that the default training dataset is based on lmdb, refer to [docs in BasicSR](https://github.com/XPixelGroup/BasicSR/blob/master/docs/DatasetPreparation.md) to learn how to generate the training datasets.  
· The training command is like  
```
CUDA_VISIBLE_DEVICES=0 python basicsr/train.py -opt options/train/train_BSRN_x4.yml
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 --master_port=4321 basicsr/train.py -opt options/train/train_BSRN-S_x4.yml --launcher pytorch
```
For more training commands and details, please check the docs in [BasicSR](https://github.com/XPixelGroup/BasicSR)  

## Results
The inference results on benchmark datasets are available at [Google Drive](https://drive.google.com/drive/folders/18uRxyAWwpAfKuxgDneacJkF4-rAyR7XR?usp=sharing) or [Baidu Netdisk](https://pan.baidu.com/s/1N9zLwsOBM8MxqpfK5zpZXw) (access code: VISU).

## Contact
If you have any question, please email zheyuanli884886@gmail.com or join in the Wechat group of BasicSR to discuss with the authors.


================================================
FILE: VERSION
================================================
1.3.4.9


================================================
FILE: basicsr/__init__.py
================================================
# https://github.com/xinntao/BasicSR
# flake8: noqa
from .archs import *
from .data import *
from .losses import *
from .metrics import *
from .models import *
from .ops import *
from .test import *
from .train import *
from .utils import *
from .version import __gitsha__, __version__


================================================
FILE: basicsr/archs/BSRN_arch.py
================================================
'''
This repository is used to implement all upsamplers(only x4) and tools for Efficient SR
@author
    LI Zehyuan from SIAT
    LIU yingqi from SIAT
'''

from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import basicsr.archs.Upsamplers as Upsamplers
from basicsr.utils.registry import ARCH_REGISTRY


class DepthWiseConv(nn.Module):
    def __init__(self, in_ch, out_ch, kernel_size=3, stride=1, padding=1,
                 dilation=1, bias=True, padding_mode="zeros", with_norm=False, bn_kwargs=None):
        super(DepthWiseConv, self).__init__()

        self.dw = torch.nn.Conv2d(
                in_channels=in_ch,
                out_channels=in_ch,
                kernel_size=kernel_size,
                stride=stride,
                padding=padding,
                dilation=dilation,
                groups=in_ch,
                bias=bias,
                padding_mode=padding_mode,
        )

        self.pw = torch.nn.Conv2d(
            in_channels=in_ch,
            out_channels=out_ch,
            kernel_size=(1, 1),
            stride=1,
            padding=0,
            dilation=1,
            groups=1,
            bias=False,
        )

    def forward(self, input):
        out = self.dw(input)
        out = self.pw(out)
        return out


class BSConvU(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1,
                 dilation=1, bias=True, padding_mode="zeros", with_ln=False, bn_kwargs=None):
        super().__init__()
        self.with_ln = with_ln
        # check arguments
        if bn_kwargs is None:
            bn_kwargs = {}

        # pointwise
        self.pw=torch.nn.Conv2d(
                in_channels=in_channels,
                out_channels=out_channels,
                kernel_size=(1, 1),
                stride=1,
                padding=0,
                dilation=1,
                groups=1,
                bias=False,
        )

        # depthwise
        self.dw = torch.nn.Conv2d(
                in_channels=out_channels,
                out_channels=out_channels,
                kernel_size=kernel_size,
                stride=stride,
                padding=padding,
                dilation=dilation,
                groups=out_channels,
                bias=bias,
                padding_mode=padding_mode,
        )

    def forward(self, fea):
        fea = self.pw(fea)
        fea = self.dw(fea)
        return fea


class BSConvS(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, dilation=1, bias=True,
                 padding_mode="zeros", p=0.25, min_mid_channels=4, with_ln=False, bn_kwargs=None):
        super().__init__()
        self.with_ln = with_ln
        # check arguments
        assert 0.0 <= p <= 1.0
        mid_channels = min(in_channels, max(min_mid_channels, math.ceil(p * in_channels)))
        if bn_kwargs is None:
            bn_kwargs = {}

        # pointwise 1
        self.pw1 = torch.nn.Conv2d(
            in_channels=in_channels,
            out_channels=mid_channels,
            kernel_size=(1, 1),
            stride=1,
            padding=0,
            dilation=1,
            groups=1,
            bias=False,
        )

        # pointwise 2
        self.add_module("pw2", torch.nn.Conv2d(
            in_channels=mid_channels,
            out_channels=out_channels,
            kernel_size=(1, 1),
            stride=1,
            padding=0,
            dilation=1,
            groups=1,
            bias=False,
        ))

        # depthwise
        self.dw = torch.nn.Conv2d(
            in_channels=out_channels,
            out_channels=out_channels,
            kernel_size=kernel_size,
            stride=stride,
            padding=padding,
            dilation=dilation,
            groups=out_channels,
            bias=bias,
            padding_mode=padding_mode,
        )

    def forward(self, x):
        fea = self.pw1(x)
        fea = self.pw2(fea)
        fea = self.dw(fea)
        return fea

    def _reg_loss(self):
        W = self[0].weight[:, :, 0, 0]
        WWt = torch.mm(W, torch.transpose(W, 0, 1))
        I = torch.eye(WWt.shape[0], device=WWt.device)
        return torch.norm(WWt - I, p="fro")


def stdv_channels(F):
    assert (F.dim() == 4)
    F_mean = mean_channels(F)
    F_variance = (F - F_mean).pow(2).sum(3, keepdim=True).sum(2, keepdim=True) / (F.size(2) * F.size(3))
    return F_variance.pow(0.5)


def mean_channels(F):
    assert(F.dim() == 4)
    spatial_sum = F.sum(3, keepdim=True).sum(2, keepdim=True)
    return spatial_sum / (F.size(2) * F.size(3))


class CCALayer(nn.Module):
    def __init__(self, channel, reduction=16):
        super(CCALayer, self).__init__()

        self.contrast = stdv_channels
        self.avg_pool = nn.AdaptiveAvgPool2d(1)
        self.conv_du = nn.Sequential(
            nn.Conv2d(channel, channel // reduction, 1, padding=0, bias=True),
            nn.ReLU(inplace=True),
            nn.Conv2d(channel // reduction, channel, 1, padding=0, bias=True),
            nn.Sigmoid()
        )

    def forward(self, x):
        y = self.contrast(x) + self.avg_pool(x)
        y = self.conv_du(y)
        return x * y


class ChannelAttention(nn.Module):
    """Channel attention used in RCAN.

    Args:
        num_feat (int): Channel number of intermediate features.
        squeeze_factor (int): Channel squeeze factor. Default: 16.
    """

    def __init__(self, num_feat, squeeze_factor=16):
        super(ChannelAttention, self).__init__()
        self.attention = nn.Sequential(
            nn.AdaptiveAvgPool2d(1), nn.Conv2d(num_feat, num_feat // squeeze_factor, 1, padding=0),
            nn.ReLU(inplace=True), nn.Conv2d(num_feat // squeeze_factor, num_feat, 1, padding=0), nn.Sigmoid())

    def forward(self, x):
        y = self.attention(x)
        return x * y


class ESA(nn.Module):
    def __init__(self, num_feat=50, conv=nn.Conv2d, p=0.25):
        super(ESA, self).__init__()
        f = num_feat // 4
        BSConvS_kwargs = {}
        if conv.__name__ == 'BSConvS':
            BSConvS_kwargs = {'p': p}
        self.conv1 = nn.Conv2d(num_feat, f, 1)
        self.conv_f = nn.Conv2d(f, f, 1)
        self.maxPooling = nn.MaxPool2d(kernel_size=7, stride=3)
        self.conv_max = conv(f, f, kernel_size=3, **BSConvS_kwargs)
        self.conv2 = conv(f, f, 3, 2, 0)
        self.conv3 = conv(f, f, kernel_size=3, **BSConvS_kwargs)
        self.conv3_ = conv(f, f, kernel_size=3, **BSConvS_kwargs)
        self.conv4 = nn.Conv2d(f, num_feat, 1)
        self.sigmoid = nn.Sigmoid()
        self.GELU = nn.GELU()

    def forward(self, input):
        c1_ = (self.conv1(input))
        c1 = self.conv2(c1_)
        v_max = self.maxPooling(c1)
        v_range = self.GELU(self.conv_max(v_max))
        c3 = self.GELU(self.conv3(v_range))
        c3 = self.conv3_(c3)
        c3 = F.interpolate(c3, (input.size(2), input.size(3)), mode='bilinear', align_corners=False)
        cf = self.conv_f(c1_)
        c4 = self.conv4((c3 + cf))
        m = self.sigmoid(c4)

        return input * m


class ESDB(nn.Module):
    def __init__(self, in_channels, out_channels, conv=nn.Conv2d, p=0.25):
        super(ESDB, self).__init__()
        kwargs = {'padding': 1}
        if conv.__name__ == 'BSConvS':
            kwargs = {'p': p}

        self.dc = self.distilled_channels = in_channels // 2
        self.rc = self.remaining_channels = in_channels

        self.c1_d = nn.Conv2d(in_channels, self.dc, 1)
        self.c1_r = conv(in_channels, self.rc, kernel_size=3,  **kwargs)
        self.c2_d = nn.Conv2d(self.remaining_channels, self.dc, 1)
        self.c2_r = conv(self.remaining_channels, self.rc, kernel_size=3, **kwargs)
        self.c3_d = nn.Conv2d(self.remaining_channels, self.dc, 1)
        self.c3_r = conv(self.remaining_channels, self.rc, kernel_size=3, **kwargs)

        self.c4 = conv(self.remaining_channels, self.dc, kernel_size=3, **kwargs)
        self.act = nn.GELU()

        self.c5 = nn.Conv2d(self.dc * 4, in_channels, 1)
        self.esa = ESA(in_channels, conv)
        self.cca = CCALayer(in_channels)

    def forward(self, input):

        distilled_c1 = self.act(self.c1_d(input))
        r_c1 = (self.c1_r(input))
        r_c1 = self.act(r_c1 + input)

        distilled_c2 = self.act(self.c2_d(r_c1))
        r_c2 = (self.c2_r(r_c1))
        r_c2 = self.act(r_c2 + r_c1)

        distilled_c3 = self.act(self.c3_d(r_c2))
        r_c3 = (self.c3_r(r_c2))
        r_c3 = self.act(r_c3 + r_c2)

        r_c4 = self.act(self.c4(r_c3))

        out = torch.cat([distilled_c1, distilled_c2, distilled_c3, r_c4], dim=1)
        out = self.c5(out)
        out_fused = self.esa(out)
        out_fused = self.cca(out_fused)
        return out_fused + input


def make_layer(block, n_layers):
    layers = []
    for _ in range(n_layers):
        layers.append(block())
    return nn.Sequential(*layers)


@ARCH_REGISTRY.register()
class BSRN(nn.Module):
    def __init__(self, num_in_ch=3, num_feat=64, num_block=8, num_out_ch=3, upscale=4,
                 conv='BSConvU', upsampler='pixelshuffledirect', p=0.25):
        super(BSRN, self).__init__()
        kwargs = {'padding': 1}
        if conv == 'BSConvS':
            kwargs = {'p': p}
        print(conv)
        if conv == 'DepthWiseConv':
            self.conv = DepthWiseConv
        elif conv == 'BSConvU':
            self.conv = BSConvU
        elif conv == 'BSConvS':
            self.conv = BSConvS
        else:
            self.conv = nn.Conv2d
        self.fea_conv = self.conv(num_in_ch * 4, num_feat, kernel_size=3, **kwargs)

        self.B1 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B2 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B3 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B4 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B5 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B6 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B7 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B8 = ESDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)

        self.c1 = nn.Conv2d(num_feat * num_block, num_feat, 1)
        self.GELU = nn.GELU()

        self.c2 = self.conv(num_feat, num_feat, kernel_size=3, **kwargs)


        if upsampler == 'pixelshuffledirect':
            self.upsampler = Upsamplers.PixelShuffleDirect(scale=upscale, num_feat=num_feat, num_out_ch=num_out_ch)
        elif upsampler == 'pixelshuffleblock':
            self.upsampler = Upsamplers.PixelShuffleBlcok(in_feat=num_feat, num_feat=num_feat, num_out_ch=num_out_ch)
        elif upsampler == 'nearestconv':
            self.upsampler = Upsamplers.NearestConv(in_ch=num_feat, num_feat=num_feat, num_out_ch=num_out_ch)
        elif upsampler == 'pa':
            self.upsampler = Upsamplers.PA_UP(nf=num_feat, unf=24, out_nc=num_out_ch)
        else:
            raise NotImplementedError(("Check the Upsampeler. None or not support yet"))

    def forward(self, input):
        input = torch.cat([input, input, input, input], dim=1)
        out_fea = self.fea_conv(input)
        out_B1 = self.B1(out_fea)
        out_B2 = self.B2(out_B1)
        out_B3 = self.B3(out_B2)
        out_B4 = self.B4(out_B3)
        out_B5 = self.B5(out_B4)
        out_B6 = self.B6(out_B5)
        out_B7 = self.B7(out_B6)
        out_B8 = self.B8(out_B7)

        trunk = torch.cat([out_B1, out_B2, out_B3, out_B4, out_B5, out_B6, out_B7, out_B8], dim=1)
        out_B = self.c1(trunk)
        out_B = self.GELU(out_B)

        out_lr = self.c2(out_B) + out_fea

        output = self.upsampler(out_lr)

        return output



================================================
FILE: basicsr/archs/Blocks.py
================================================
'''
This repository is used to implement all blocks and tools for Efficient SR
@author
    LI Zehyuan from SIAT
    LIU yingqi from SIAT
'''
from functools import partial

import torch
import torch.nn as nn
import math
import torch.nn.functional as F
from distutils.version import LooseVersion



# 1*1卷积使用nn.Linear实现
class DepthWiseConv(nn.Module):
    def __init__(self, in_ch, out_ch, kernel_size=3, stride=1, padding=1,
                 dilation=1, bias=True, padding_mode="zeros", with_norm=True, bn_kwargs=None):
        super(DepthWiseConv, self).__init__()
        # 也相当于分组为1的分组卷积
        self.depth_conv = nn.Conv2d(in_channels=in_ch,
                                    out_channels=in_ch,
                                    kernel_size=3,
                                    stride=1,
                                    padding=1,
                                    groups=in_ch)
        self.point_conv = nn.Linear(in_ch, out_ch)
        # self.point_conv = nn.Conv2d(in_channels=in_ch,
        #                             out_channels=out_ch,
        #                             kernel_size=1,
        #                             stride=1,
        #                             padding=0,
        #                             groups=1)

    def forward(self, input):
        out = self.depth_conv(input)
        out = out.permute(0, 2, 3, 1)
        out = self.point_conv(out)
        out = out.permute(0, 3, 1, 2)
        return out


class BSConvU(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1,
                 dilation=1, bias=True, padding_mode="zeros", with_ln=False, bn_kwargs=None):
        super().__init__()
        self.with_ln = with_ln
        # check arguments
        if bn_kwargs is None:
            bn_kwargs = {}

        # pointwise
        self.pw = nn.Linear(in_channels, out_channels)
        # self.pw=torch.nn.Conv2d(
        #         in_channels=in_channels,
        #         out_channels=out_channels,
        #         kernel_size=(1, 1),
        #         stride=1,
        #         padding=0,
        #         dilation=1,
        #         groups=1,
        #         bias=False,
        # )
        # batchnorm
        if with_ln:
            self.ln = torch.nn.LayerNorm(out_channels, **bn_kwargs)

        # depthwise
        self.dw = torch.nn.Conv2d(
                in_channels=out_channels,
                out_channels=out_channels,
                kernel_size=kernel_size,
                stride=stride,
                padding=padding,
                dilation=dilation,
                groups=out_channels,
                bias=bias,
                padding_mode=padding_mode,
        )

    def forward(self, fea):
        fea = fea.permute(0, 2, 3, 1)
        fea = self.pw(fea)
        if self.with_ln:
            fea = self.ln(fea)
        fea = self.dw(fea.permute(0, 3, 1, 2))
        return fea


class BSConvS(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, dilation=1, bias=True,
                 padding_mode="zeros", p=0.25, min_mid_channels=4, with_ln=True, bn_kwargs=None):
        super().__init__()
        self.with_ln = with_ln
        # check arguments
        assert 0.0 <= p <= 1.0
        mid_channels = min(in_channels, max(min_mid_channels, math.ceil(p * in_channels)))
        if bn_kwargs is None:
            bn_kwargs = {}

        # pointwise 1
        self.pw1 = nn.Linear(in_channels, mid_channels)
        # self.pw1 = torch.nn.Conv2d(
        #     in_channels=in_channels,
        #     out_channels=mid_channels,
        #     kernel_size=(1, 1),
        #     stride=1,
        #     padding=0,
        #     dilation=1,
        #     groups=1,
        #     bias=False,
        # )

        # batchnorm
        if with_ln:
            self.ln1 = torch.nn.LayerNorm(mid_channels, **bn_kwargs)

        # pointwise 2
        self.pw2 = nn.Linear(mid_channels, out_channels)
        # self.add_module("pw2", torch.nn.Conv2d(
        #     in_channels=mid_channels,
        #     out_channels=out_channels,
        #     kernel_size=(1, 1),
        #     stride=1,
        #     padding=0,
        #     dilation=1,
        #     groups=1,
        #     bias=False,
        # ))

        # batchnorm
        if with_ln:
            self.ln2 = torch.nn.LayerNorm(out_channels, **bn_kwargs)

        # depthwise
        self.dw = torch.nn.Conv2d(
            in_channels=out_channels,
            out_channels=out_channels,
            kernel_size=kernel_size,
            stride=stride,
            padding=padding,
            dilation=dilation,
            groups=out_channels,
            bias=bias,
            padding_mode=padding_mode,
        )

    def forward(self, x):
        fea = x.permute(0, 2, 3, 1)
        fea = self.pw1(fea)
        if self.with_ln:
            fea = self.ln1(fea)
        fea = self.pw2(fea)
        if self.with_ln:
            fea = self.ln2(fea)
        fea = self.dw(fea.permute(0, 3, 1, 2))
        return fea

    def _reg_loss(self):
        W = self[0].weight[:, :, 0, 0]
        WWt = torch.mm(W, torch.transpose(W, 0, 1))
        I = torch.eye(WWt.shape[0], device=WWt.device)
        return torch.norm(WWt - I, p="fro")


# replicate the input RGB channels at the head of the net
class ChannelReplicate(nn.Module):
    def __init__(self, factor=3):
        super(ChannelReplicate, self).__init__()
        self.factor = factor

    def forward(self, input):
        template = input
        for i in range(0, self.factor-1):
            input = torch.cat((template, input), 1)
        return input


# shuffleNetv1
# shufflblock combine group_conv with channle shuffle
class ShuffleV1Block(nn.Module):
    def __init__(self, inp, oup, *, group, first_group, mid_channels, ksize, stride):
        super(ShuffleV1Block, self).__init__()
        self.stride = stride
        assert stride in [1, 2]

        self.mid_channels = mid_channels
        self.ksize = ksize
        pad = ksize // 2
        self.pad = pad
        self.inp = inp
        self.group = group

        if stride == 2:
            outputs = oup - inp
        else:
            outputs = oup

        branch_main_1 = [
            # pw
            nn.Conv2d(inp, mid_channels, 1, 1, 0, groups=1 if first_group else group, bias=False),
            nn.BatchNorm2d(mid_channels),
            nn.ReLU(inplace=True),
            # dw
            nn.Conv2d(mid_channels, mid_channels, ksize, stride, pad, groups=mid_channels, bias=False),
            nn.BatchNorm2d(mid_channels),
        ]
        branch_main_2 = [
            # pw-linear
            nn.Conv2d(mid_channels, outputs, 1, 1, 0, groups=group, bias=False),
            nn.BatchNorm2d(outputs),
        ]
        self.branch_main_1 = nn.Sequential(*branch_main_1)
        self.branch_main_2 = nn.Sequential(*branch_main_2)

        if stride == 2:
            self.branch_proj = nn.AvgPool2d(kernel_size=3, stride=2, padding=1)

    def forward(self, old_x):
        x = old_x
        x_proj = old_x
        x = self.branch_main_1(x)
        if self.group > 1:
            x = self.channel_shuffle_v1(x)
        # 此处我觉得代码有问题,channle shuffle应该在branch_main_1中的pw之后
        x = self.branch_main_2(x)
        if self.stride == 1:
            return F.relu(x + x_proj)
        elif self.stride == 2:
            return torch.cat((self.branch_proj(x_proj), F.relu(x)), 1)

        def channel_shuffle_v1(self, x):
            batchsize, num_channels, height, width = x.data.size()
            assert num_channels % self.group == 0
            group_channels = num_channels // self.group

            x = x.reshape(batchsize, group_channels, self.group, height, width)
            x = x.permute(0, 2, 1, 3, 4)
            #将x换位,相当于x = (batchsize, self.group, group_channles, height, width)
            x = x.reshape(batchsize, num_channels, height, width)

            return x


# shufflev2block
# Gconv-->conv , remove channle shuffle in the branch
class ShuffleV2Block(nn.Module):
    def __init__(self, inp, oup, mid_channels, *, ksize, stride):
        super(ShuffleV2Block, self).__init__()
        self.stride = stride
        assert stride in [1, 2]

        self.mid_channels = mid_channels
        self.ksize = ksize
        pad = ksize // 2
        self.pad = pad
        self.inp = inp

        outputs = oup - inp

        branch_main = [
            # pw
            nn.Conv2d(inp, mid_channels, 1, 1, 0, bias=False),
            nn.BatchNorm2d(mid_channels),
            nn.ReLU(inplace=True),
            # dw
            nn.Conv2d(mid_channels, mid_channels, ksize, stride, pad, groups=mid_channels, bias=False),
            nn.BatchNorm2d(mid_channels),
            # pw-linear
            nn.Conv2d(mid_channels, outputs, 1, 1, 0, bias=False),
            nn.BatchNorm2d(outputs),
            nn.ReLU(inplace=True),
        ]
        self.branch_main = nn.Sequential(*branch_main)

        if stride == 2:
            branch_proj = [
                # dw
                nn.Conv2d(inp, inp, ksize, stride, pad, groups=inp, bias=False),
                nn.BatchNorm2d(inp),
                # pw-linear
                nn.Conv2d(inp, inp, 1, 1, 0, bias=False),
                nn.BatchNorm2d(inp),
                nn.ReLU(inplace=True),
            ]
            self.branch_proj = nn.Sequential(*branch_proj)
        else:
            self.branch_proj = None

    def forward(self, old_x):
        if self.stride==1:
            x_proj, x = self.channel_shuffle_v2(old_x)
            return torch.cat((x_proj, self.branch_main(x)), 1)
        # 将上一个block得到的old_x经过两个不同分支,注意这里的恒等体现了channle spilt. 然后横着concat
        elif self.stride==2:
            x_proj = old_x
            x = old_x
            return torch.cat((self.branch_proj(x_proj), self.branch_main(x)), 1)
        # 对应paper中第二幅图

    def channel_shuffle_v2(self, x):
        batchsize, num_channels, height, width = x.data.size()
        assert (num_channels % 4 == 0)
        x = x.reshape(batchsize * num_channels // 2, 2, height * width)
        x = x.permute(1, 0, 2)
        x = x.reshape(2, -1, num_channels // 2, height, width)
        return x[0], x[1]
# Performer
# for simpler you can just import and use like below
# from performer_pytorch import FastAttention
# https://github.com/lucidrains/performer-pytorch for more details




# Linear Transformer
# https://github.com/idiap/fast-transformers
# Linear Transformer
class FeatureMap(nn.Module):
    """Define the FeatureMap interface."""
    def __init__(self, query_dims):
        super().__init__()
        self.query_dims = query_dims

    def new_feature_map(self, device):
        """Create a new instance of this feature map. In particular, if it is a
        random feature map sample new parameters."""
        raise NotImplementedError()

    def forward_queries(self, x):
        """Encode the queries `x` using this feature map."""
        return self(x)

    def forward_keys(self, x):
        """Encode the keys `x` using this feature map."""
        return self(x)

    def forward(self, x):
        """Encode x using this feature map. For symmetric feature maps it
        suffices to define this function, but for asymmetric feature maps one
        needs to define the `forward_queries` and `forward_keys` functions."""
        raise NotImplementedError()

    @classmethod
    def factory(cls, *args, **kwargs):
        """Return a function that when called with the query dimensions returns
        an instance of this feature map.
        It is inherited by the subclasses so it is available in all feature
        maps.
        """
        def inner(query_dims):
            return cls(query_dims, *args, **kwargs)
        return inner


class ActivationFunctionFeatureMap(FeatureMap):
    """Define a feature map that is simply an element-wise activation
    function."""
    def __init__(self, query_dims, activation_function):
        super().__init__(query_dims)
        self.activation_function = activation_function

    def new_feature_map(self, device):
        return

    def forward(self, x):
        return self.activation_function(x)


class LinearAttention(nn.Module):
    """Implement unmasked attention using dot product of feature maps in
    O(N D^2) complexity.
    Given the queries, keys and values as Q, K, V instead of computing
        V' = softmax(Q.mm(K.t()), dim=-1).mm(V),
    we make use of a feature map function Φ(.) and perform the following
    computation
        V' = normalize(Φ(Q).mm(Φ(K).t())).mm(V).
    The above can be computed in O(N D^2) complexity where D is the
    dimensionality of Q, K and V and N is the sequence length. Depending on the
    feature map, however, the complexity of the attention might be limited.
    Arguments
    ---------
        feature_map: callable, a callable that applies the feature map to the
                     last dimension of a tensor (default: elu(x)+1)
        eps: float, a small number to ensure the numerical stability of the
             denominator (default: 1e-6)
        event_dispatcher: str or EventDispatcher instance to be used by this
                          module for dispatching events (default: the default
                          global dispatcher)
    """
    def __init__(self, query_dimensions, feature_map=None, eps=1e-6,
                 event_dispatcher=""):
        super(LinearAttention, self).__init__()
        elu_feature_map = ActivationFunctionFeatureMap.factory(
            lambda x: torch.nn.functional.elu(x) + 1
        )
        self.feature_map = (
            feature_map(query_dimensions) if feature_map else
            elu_feature_map(query_dimensions)
        )
        self.eps = eps
        # self.event_dispatcher = EventDispatcher.get(event_dispatcher)

    def forward(self, queries, keys, values, attn_mask, query_lengths,
                key_lengths):
        # Apply the feature map to the queries and keys
        self.feature_map.new_feature_map(queries.device)
        Q = self.feature_map.forward_queries(queries)
        K = self.feature_map.forward_keys(keys)

        # Apply the key padding mask and make sure that the attn_mask is
        # all_ones
        if not attn_mask.all_ones:
            raise RuntimeError(("LinearAttention does not support arbitrary "
                                "attention masks"))
        K = K * key_lengths.float_matrix[:, :, None, None]

        # Compute the KV matrix, namely the dot product of keys and values so
        # that we never explicitly compute the attention matrix and thus
        # decrease the complexity
        KV = torch.einsum("nshd,nshm->nhmd", K, values)

        # Compute the normalizer
        Z = 1/(torch.einsum("nlhd,nhd->nlh", Q, K.sum(dim=1))+self.eps)

        # Finally compute and return the new values
        V = torch.einsum("nlhd,nhmd,nlh->nlhm", Q, KV, Z)

        return V.contiguous()

================================================
FILE: basicsr/archs/RFDN_arch.py
================================================
from collections import OrderedDict
from basicsr.utils.registry import ARCH_REGISTRY
import torch.nn as nn
import torch
import torch.nn.functional as F


def conv_layer(in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1):
    padding = int((kernel_size - 1) / 2) * dilation
    return nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding=padding, bias=True, dilation=dilation,
                     groups=groups)


def norm(norm_type, nc):
    norm_type = norm_type.lower()
    if norm_type == 'batch':
        layer = nn.BatchNorm2d(nc, affine=True)
    elif norm_type == 'instance':
        layer = nn.InstanceNorm2d(nc, affine=False)
    else:
        raise NotImplementedError('normalization layer [{:s}] is not found'.format(norm_type))
    return layer


def pad(pad_type, padding):
    pad_type = pad_type.lower()
    if padding == 0:
        return None
    if pad_type == 'reflect':
        layer = nn.ReflectionPad2d(padding)
    elif pad_type == 'replicate':
        layer = nn.ReplicationPad2d(padding)
    else:
        raise NotImplementedError('padding layer [{:s}] is not implemented'.format(pad_type))
    return layer


def get_valid_padding(kernel_size, dilation):
    kernel_size = kernel_size + (kernel_size - 1) * (dilation - 1)
    padding = (kernel_size - 1) // 2
    return padding


def conv_block(in_nc, out_nc, kernel_size, stride=1, dilation=1, groups=1, bias=True,
               pad_type='zero', norm_type=None, act_type='relu'):
    padding = get_valid_padding(kernel_size, dilation)
    p = pad(pad_type, padding) if pad_type and pad_type != 'zero' else None
    padding = padding if pad_type == 'zero' else 0

    c = nn.Conv2d(in_nc, out_nc, kernel_size=kernel_size, stride=stride, padding=padding,
                  dilation=dilation, bias=bias, groups=groups)
    a = activation(act_type) if act_type else None
    n = norm(norm_type, out_nc) if norm_type else None
    return sequential(p, c, n, a)


def activation(act_type, inplace=True, neg_slope=0.05, n_prelu=1):
    act_type = act_type.lower()
    if act_type == 'relu':
        layer = nn.ReLU(inplace)
    elif act_type == 'lrelu':
        layer = nn.LeakyReLU(neg_slope, inplace)
    elif act_type == 'prelu':
        layer = nn.PReLU(num_parameters=n_prelu, init=neg_slope)
    else:
        raise NotImplementedError('activation layer [{:s}] is not found'.format(act_type))
    return layer


class ShortcutBlock(nn.Module):
    def __init__(self, submodule):
        super(ShortcutBlock, self).__init__()
        self.sub = submodule

    def forward(self, x):
        output = x + self.sub(x)
        return output


def mean_channels(F):
    assert (F.dim() == 4)
    spatial_sum = F.sum(3, keepdim=True).sum(2, keepdim=True)
    return spatial_sum / (F.size(2) * F.size(3))


def stdv_channels(F):
    assert (F.dim() == 4)
    F_mean = mean_channels(F)
    F_variance = (F - F_mean).pow(2).sum(3, keepdim=True).sum(2, keepdim=True) / (F.size(2) * F.size(3))
    return F_variance.pow(0.5)


def sequential(*args):
    if len(args) == 1:
        if isinstance(args[0], OrderedDict):
            raise NotImplementedError('sequential does not support OrderedDict input.')
        return args[0]
    modules = []
    for module in args:
        if isinstance(module, nn.Sequential):
            for submodule in module.children():
                modules.append(submodule)
        elif isinstance(module, nn.Module):
            modules.append(module)
    return nn.Sequential(*modules)


class ESA(nn.Module):
    def __init__(self, n_feats, conv):
        super(ESA, self).__init__()
        f = n_feats // 4
        self.conv1 = conv(n_feats, f, kernel_size=1)
        self.conv_f = conv(f, f, kernel_size=1)
        self.conv_max = conv(f, f, kernel_size=3, padding=1)
        self.conv2 = conv(f, f, kernel_size=3, stride=2, padding=0)
        self.conv3 = conv(f, f, kernel_size=3, padding=1)
        self.conv3_ = conv(f, f, kernel_size=3, padding=1)
        self.conv4 = conv(f, n_feats, kernel_size=1)
        self.sigmoid = nn.Sigmoid()
        self.relu = nn.ReLU(inplace=True)

    def forward(self, x):
        c1_ = (self.conv1(x))
        c1 = self.conv2(c1_)
        v_max = F.max_pool2d(c1, kernel_size=7, stride=3)
        v_range = self.relu(self.conv_max(v_max))
        c3 = self.relu(self.conv3(v_range))
        c3 = self.conv3_(c3)
        c3 = F.interpolate(c3, (x.size(2), x.size(3)), mode='bilinear', align_corners=False)
        cf = self.conv_f(c1_)
        c4 = self.conv4(c3 + cf)
        m = self.sigmoid(c4)

        return x * m


class RFDB(nn.Module):
    def __init__(self, in_channels, distillation_rate=0.25):
        super(RFDB, self).__init__()
        self.dc = self.distilled_channels = in_channels // 2
        self.rc = self.remaining_channels = in_channels
        self.c1_d = conv_layer(in_channels, self.dc, 1)
        self.c1_r = conv_layer(in_channels, self.rc, 3)
        self.c2_d = conv_layer(self.remaining_channels, self.dc, 1)
        self.c2_r = conv_layer(self.remaining_channels, self.rc, 3)
        self.c3_d = conv_layer(self.remaining_channels, self.dc, 1)
        self.c3_r = conv_layer(self.remaining_channels, self.rc, 3)
        self.c4 = conv_layer(self.remaining_channels, self.dc, 3)
        self.act = activation('lrelu', neg_slope=0.05)
        self.c5 = conv_layer(self.dc * 4, in_channels, 1)
        self.esa = ESA(in_channels, nn.Conv2d)

    def forward(self, input):
        distilled_c1 = self.act(self.c1_d(input))
        r_c1 = (self.c1_r(input))
        r_c1 = self.act(r_c1 + input)

        distilled_c2 = self.act(self.c2_d(r_c1))
        r_c2 = (self.c2_r(r_c1))
        r_c2 = self.act(r_c2 + r_c1)

        distilled_c3 = self.act(self.c3_d(r_c2))
        r_c3 = (self.c3_r(r_c2))
        r_c3 = self.act(r_c3 + r_c2)

        r_c4 = self.act(self.c4(r_c3))

        out = torch.cat([distilled_c1, distilled_c2, distilled_c3, r_c4], dim=1)
        out_fused = self.esa(self.c5(out))

        return out_fused


def pixelshuffle_block(in_channels, out_channels, upscale_factor=2, kernel_size=3, stride=1):
    conv = conv_layer(in_channels, out_channels * (upscale_factor ** 2), kernel_size, stride)
    pixel_shuffle = nn.PixelShuffle(upscale_factor)
    return sequential(conv, pixel_shuffle)


def make_model(args, parent=False):
    model = RFDN()
    return model


@ARCH_REGISTRY.register()
class RFDN(nn.Module):
    def __init__(self, in_nc=3, nf=50, num_modules=4, out_nc=3, upscale=4):
        super(RFDN, self).__init__()

        self.fea_conv = conv_layer(in_nc, nf, kernel_size=3)

        self.B1 = RFDB(in_channels=nf)
        self.B2 = RFDB(in_channels=nf)
        self.B3 = RFDB(in_channels=nf)
        self.B4 = RFDB(in_channels=nf)
        self.c = conv_block(nf * num_modules, nf, kernel_size=1, act_type='lrelu')

        self.LR_conv = conv_layer(nf, nf, kernel_size=3)

        upsample_block = pixelshuffle_block
        self.upsampler = upsample_block(nf, out_nc, upscale_factor=4)
        self.scale_idx = 0


    def forward(self, input):
        input = input * 255.
        out_fea = self.fea_conv(input)
        out_B1 = self.B1(out_fea)
        out_B2 = self.B2(out_B1)
        out_B3 = self.B3(out_B2)
        out_B4 = self.B4(out_B3)

        out_B = self.c(torch.cat([out_B1, out_B2, out_B3, out_B4], dim=1))
        out_lr = self.LR_conv(out_B) + out_fea

        output = self.upsampler(out_lr)

        return output/255.

    def set_scale(self, scale_idx):
        self.scale_idx = scale_idx


================================================
FILE: basicsr/archs/Upsamplers.py
================================================
'''
This repository is used to implement all upsamplers(only x4) and tools for Efficient SR
@author
    LI Zehyuan from SIAT
    LIU yingqi from SIAT
'''
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import math


class PA(nn.Module):
    '''PA is pixel attention'''

    def __init__(self, nf):
        super(PA, self).__init__()
        self.conv = nn.Conv2d(nf, nf, 1)
        self.sigmoid = nn.Sigmoid()

    def forward(self, x):
        y = self.conv(x)
        y = self.sigmoid(y)
        out = torch.mul(x, y)

        return out


class PA_UP(nn.Module):
    def __init__(self, nf, unf, out_nc, scale=4, conv=nn.Conv2d):
        super(PA_UP, self).__init__()
        self.upconv1 = conv(nf, unf, 3, 1, 1, bias=True)
        self.att1 = PA(unf)
        self.HRconv1 = conv(unf, unf, 3, 1, 1, bias=True)

        if scale == 4:
            self.upconv2 = conv(unf, unf, 3, 1, 1, bias=True)
            self.att2 = PA(unf)
            self.HRconv2 = conv(unf, unf, 3, 1, 1, bias=True)

        self.conv_last = conv(unf, out_nc, 3, 1, 1, bias=True)
        self.lrelu = nn.LeakyReLU(negative_slope=0.2, inplace=True)

    def forward(self, fea):
        fea = self.upconv1(F.interpolate(fea, scale_factor=2, mode='nearest'))
        fea = self.lrelu(self.att1(fea))
        fea = self.lrelu(self.HRconv1(fea))
        fea = self.upconv2(F.interpolate(fea, scale_factor=2, mode='nearest'))
        fea = self.lrelu(self.att2(fea))
        fea = self.lrelu(self.HRconv2(fea))
        fea = self.conv_last(fea)
        return fea

class PA_UP_Dropout(nn.Module):
    def __init__(self, nf, unf, out_nc, scale=4, conv=nn.Conv2d, P=0.7):
        super(PA_UP_Dropout, self).__init__()
        self.upconv1 = conv(nf, unf, 3, 1, 1, bias=True)
        self.att1 = PA(unf)
        self.HRconv1 = conv(unf, unf, 3, 1, 1, bias=True)

        if scale == 4:
            self.upconv2 = conv(unf, unf, 3, 1, 1, bias=True)
            self.att2 = PA(unf)
            self.HRconv2 = conv(unf, unf, 3, 1, 1, bias=True)
        
        self.dropout = nn.Dropout(p=P)
        self.conv_last = conv(unf, out_nc, 3, 1, 1, bias=True)
        self.lrelu = nn.LeakyReLU(negative_slope=0.2, inplace=True)

    def forward(self, fea):
        fea = self.upconv1(F.interpolate(fea, scale_factor=2, mode='nearest'))
        fea = self.lrelu(self.att1(fea))
        fea = self.lrelu(self.HRconv1(fea))
        fea = self.upconv2(F.interpolate(fea, scale_factor=2, mode='nearest'))
        fea = self.lrelu(self.att2(fea))
        fea = self.lrelu(self.HRconv2(fea))
        fea = self.dropout(fea)
        fea = self.conv_last(fea)
        return fea

class UpsampleOneStep(nn.Sequential):
    """UpsampleOneStep module (the difference with Upsample is that it always only has 1conv + 1pixelshuffle)
       Used in lightweight SR to save parameters.
    Args:
        scale (int): Scale factor. Supported scales: 2^n and 3.
        num_feat (int): Channel number of intermediate features.
    """

    def __init__(self, scale, num_feat, num_out_ch, input_resolution=None):
        self.num_feat = num_feat
        self.input_resolution = input_resolution
        m = []
        m.append(nn.Conv2d(num_feat, (scale**2) * num_out_ch, 3, 1, 1))
        m.append(nn.PixelShuffle(scale))
        super(UpsampleOneStep, self).__init__(*m)

    def flops(self):
        h, w = self.input_resolution
        flops = h * w * self.num_feat * 3 * 9
        return flops


class PixelShuffleDirect(nn.Module):
    def __init__(self, scale, num_feat, num_out_ch, input_resolution=None):
        super(PixelShuffleDirect, self).__init__()
        self.upsampleOneStep = UpsampleOneStep(scale, num_feat, num_out_ch, input_resolution=None)

    def forward(self, x):
        return self.upsampleOneStep(x)


class PixelShuffleBlcok(nn.Module):
    def __init__(self, in_feat, num_feat, num_out_ch):
        super(PixelShuffleBlcok, self).__init__()
        self.conv_before_upsample = nn.Sequential(
            nn.Conv2d(in_feat, num_feat, 3, 1, 1), nn.LeakyReLU(inplace=True))
        self.upsample = nn.Sequential(
            nn.Conv2d(num_feat, 4 * num_feat, 3, 1, 1),
            nn.PixelShuffle(2),
            nn.Conv2d(num_feat, 4 * num_feat, 3, 1, 1),
            nn.PixelShuffle(2)
        )
        self.conv_last = nn.Conv2d(num_feat, num_out_ch, 3, 1, 1)

    def forward(self, x):
        x = self.conv_before_upsample(x)
        x = self.conv_last(self.upsample(x))
        return x


class NearestConv(nn.Module):
    def __init__(self, in_ch, num_feat, num_out_ch, conv=nn.Conv2d):
        super(NearestConv, self).__init__()
        self.conv_before_upsample = nn.Sequential(
            conv(in_ch, num_feat, 3, 1, 1), nn.LeakyReLU(inplace=True))
        self.conv_up1 = conv(num_feat, num_feat, 3, 1, 1)
        self.conv_up2 = conv(num_feat, num_feat, 3, 1, 1)
        self.conv_hr = conv(num_feat, num_feat, 3, 1, 1)
        self.conv_last = conv(num_feat, num_out_ch, 3, 1, 1)
        self.lrelu = nn.LeakyReLU(negative_slope=0.2, inplace=True)

    def forward(self, x):
        x = self.conv_before_upsample(x)
        x = self.lrelu(self.conv_up1(torch.nn.functional.interpolate(x, scale_factor=2, mode='nearest')))
        x = self.lrelu(self.conv_up2(torch.nn.functional.interpolate(x, scale_factor=2, mode='nearest')))
        x = self.conv_last(self.lrelu(self.conv_hr(x)))
        return x


class NearestConvDropout(nn.Module):
    def __init__(self, in_ch, num_feat, num_out_ch, P=0.7):
        super(NearestConvDropout, self).__init__()
        self.conv_before_upsample = nn.Sequential(
            nn.Conv2d(in_ch, num_feat, 3, 1, 1), nn.LeakyReLU(inplace=True))
        self.conv_up1 = nn.Conv2d(num_feat, num_feat, 3, 1, 1)
        self.conv_up2 = nn.Conv2d(num_feat, num_feat, 3, 1, 1)
        self.conv_hr = nn.Conv2d(num_feat, num_feat, 3, 1, 1)
        self.dropout = nn.Dropout(p=P)
        self.conv_last = nn.Conv2d(num_feat, num_out_ch, 3, 1, 1)
        self.act = nn.GELU()

    def forward(self, x):
        x = self.conv_before_upsample(x)
        x = self.act(self.conv_up1(torch.nn.functional.interpolate(x, scale_factor=2, mode='nearest')))
        x = self.act(self.conv_up2(torch.nn.functional.interpolate(x, scale_factor=2, mode='nearest')))
        x = self.dropout(x)
        x = self.conv_last(self.act(self.conv_hr(x)))
        return x

================================================
FILE: basicsr/archs/__init__.py
================================================
import importlib
from copy import deepcopy
from os import path as osp

from basicsr.utils import get_root_logger, scandir
from 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'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


================================================
FILE: basicsr/archs/arch_util.py
================================================
import collections.abc
import math
import torch
import torchvision
import warnings
from distutils.version import LooseVersion
from itertools import repeat
from torch import nn as nn
from torch.nn import functional as F
from torch.nn import init as init
from torch.nn.modules.batchnorm import _BatchNorm

from basicsr.ops.dcn import ModulatedDeformConvPack, modulated_deform_conv
from basicsr.utils import get_root_logger


@torch.no_grad()
def default_init_weights(module_list, scale=1, bias_fill=0, **kwargs):
    """Initialize network weights.

    Args:
        module_list (list[nn.Module] | nn.Module): Modules to be initialized.
        scale (float): Scale initialized weights, especially for residual
            blocks. Default: 1.
        bias_fill (float): The value to fill bias. Default: 0
        kwargs (dict): Other arguments for initialization function.
    """
    if not isinstance(module_list, list):
        module_list = [module_list]
    for module in module_list:
        for m in module.modules():
            if isinstance(m, nn.Conv2d):
                init.kaiming_normal_(m.weight, **kwargs)
                m.weight.data *= scale
                if m.bias is not None:
                    m.bias.data.fill_(bias_fill)
            elif isinstance(m, nn.Linear):
                init.kaiming_normal_(m.weight, **kwargs)
                m.weight.data *= scale
                if m.bias is not None:
                    m.bias.data.fill_(bias_fill)
            elif isinstance(m, _BatchNorm):
                init.constant_(m.weight, 1)
                if m.bias is not None:
                    m.bias.data.fill_(bias_fill)


def make_layer(basic_block, num_basic_block, **kwarg):
    """Make layers by stacking the same blocks.

    Args:
        basic_block (nn.module): nn.module class for basic block.
        num_basic_block (int): number of blocks.

    Returns:
        nn.Sequential: Stacked blocks in nn.Sequential.
    """
    layers = []
    for _ in range(num_basic_block):
        layers.append(basic_block(**kwarg))
    return nn.Sequential(*layers)


class ResidualBlockNoBN(nn.Module):
    """Residual block without BN.

    It has a style of:
        ---Conv-ReLU-Conv-+-
         |________________|

    Args:
        num_feat (int): Channel number of intermediate features.
            Default: 64.
        res_scale (float): Residual scale. Default: 1.
        pytorch_init (bool): If set to True, use pytorch default init,
            otherwise, use default_init_weights. Default: False.
    """

    def __init__(self, num_feat=64, res_scale=1, pytorch_init=False):
        super(ResidualBlockNoBN, self).__init__()
        self.res_scale = res_scale
        self.conv1 = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True)
        self.conv2 = nn.Conv2d(num_feat, num_feat, 3, 1, 1, bias=True)
        self.relu = nn.ReLU(inplace=True)

        if not pytorch_init:
            default_init_weights([self.conv1, self.conv2], 0.1)

    def forward(self, x):
        identity = x
        out = self.conv2(self.relu(self.conv1(x)))
        return identity + out * self.res_scale


class Upsample(nn.Sequential):
    """Upsample module.

    Args:
        scale (int): Scale factor. Supported scales: 2^n and 3.
        num_feat (int): Channel number of intermediate features.
    """

    def __init__(self, scale, num_feat):
        m = []
        if (scale & (scale - 1)) == 0:  # scale = 2^n
            for _ in range(int(math.log(scale, 2))):
                m.append(nn.Conv2d(num_feat, 4 * num_feat, 3, 1, 1))
                m.append(nn.PixelShuffle(2))
        elif scale == 3:
            m.append(nn.Conv2d(num_feat, 9 * num_feat, 3, 1, 1))
            m.append(nn.PixelShuffle(3))
        else:
            raise ValueError(f'scale {scale} is not supported. ' 'Supported scales: 2^n and 3.')
        super(Upsample, self).__init__(*m)


def flow_warp(x, flow, interp_mode='bilinear', padding_mode='zeros', align_corners=True):
    """Warp an image or feature map with optical flow.

    Args:
        x (Tensor): Tensor with size (n, c, h, w).
        flow (Tensor): Tensor with size (n, h, w, 2), normal value.
        interp_mode (str): 'nearest' or 'bilinear'. Default: 'bilinear'.
        padding_mode (str): 'zeros' or 'border' or 'reflection'.
            Default: 'zeros'.
        align_corners (bool): Before pytorch 1.3, the default value is
            align_corners=True. After pytorch 1.3, the default value is
            align_corners=False. Here, we use the True as default.

    Returns:
        Tensor: Warped image or feature map.
    """
    assert x.size()[-2:] == flow.size()[1:3]
    _, _, h, w = x.size()
    # create mesh grid
    grid_y, grid_x = torch.meshgrid(torch.arange(0, h).type_as(x), torch.arange(0, w).type_as(x))
    grid = torch.stack((grid_x, grid_y), 2).float()  # W(x), H(y), 2
    grid.requires_grad = False

    vgrid = grid + flow
    # scale grid to [-1,1]
    vgrid_x = 2.0 * vgrid[:, :, :, 0] / max(w - 1, 1) - 1.0
    vgrid_y = 2.0 * vgrid[:, :, :, 1] / max(h - 1, 1) - 1.0
    vgrid_scaled = torch.stack((vgrid_x, vgrid_y), dim=3)
    output = F.grid_sample(x, vgrid_scaled, mode=interp_mode, padding_mode=padding_mode, align_corners=align_corners)

    # TODO, what if align_corners=False
    return output


def resize_flow(flow, size_type, sizes, interp_mode='bilinear', align_corners=False):
    """Resize a flow according to ratio or shape.

    Args:
        flow (Tensor): Precomputed flow. shape [N, 2, H, W].
        size_type (str): 'ratio' or 'shape'.
        sizes (list[int | float]): the ratio for resizing or the final output
            shape.
            1) The order of ratio should be [ratio_h, ratio_w]. For
            downsampling, the ratio should be smaller than 1.0 (i.e., ratio
            < 1.0). For upsampling, the ratio should be larger than 1.0 (i.e.,
            ratio > 1.0).
            2) The order of output_size should be [out_h, out_w].
        interp_mode (str): The mode of interpolation for resizing.
            Default: 'bilinear'.
        align_corners (bool): Whether align corners. Default: False.

    Returns:
        Tensor: Resized flow.
    """
    _, _, flow_h, flow_w = flow.size()
    if size_type == 'ratio':
        output_h, output_w = int(flow_h * sizes[0]), int(flow_w * sizes[1])
    elif size_type == 'shape':
        output_h, output_w = sizes[0], sizes[1]
    else:
        raise ValueError(f'Size type should be ratio or shape, but got type {size_type}.')

    input_flow = flow.clone()
    ratio_h = output_h / flow_h
    ratio_w = output_w / flow_w
    input_flow[:, 0, :, :] *= ratio_w
    input_flow[:, 1, :, :] *= ratio_h
    resized_flow = F.interpolate(
        input=input_flow, size=(output_h, output_w), mode=interp_mode, align_corners=align_corners)
    return resized_flow


# TODO: may write a cpp file
def pixel_unshuffle(x, scale):
    """ Pixel unshuffle.

    Args:
        x (Tensor): Input feature with shape (b, c, hh, hw).
        scale (int): Downsample ratio.

    Returns:
        Tensor: the pixel unshuffled feature.
    """
    b, c, hh, hw = x.size()
    out_channel = c * (scale**2)
    assert hh % scale == 0 and hw % scale == 0
    h = hh // scale
    w = hw // scale
    x_view = x.view(b, c, h, scale, w, scale)
    return x_view.permute(0, 1, 3, 5, 2, 4).reshape(b, out_channel, h, w)


class DCNv2Pack(ModulatedDeformConvPack):
    """Modulated deformable conv for deformable alignment.

    Different from the official DCNv2Pack, which generates offsets and masks
    from the preceding features, this DCNv2Pack takes another different
    features to generate offsets and masks.

    Ref:
        Delving Deep into Deformable Alignment in Video Super-Resolution.
    """

    def forward(self, x, feat):
        out = self.conv_offset(feat)
        o1, o2, mask = torch.chunk(out, 3, dim=1)
        offset = torch.cat((o1, o2), dim=1)
        mask = torch.sigmoid(mask)

        offset_absmean = torch.mean(torch.abs(offset))
        if offset_absmean > 50:
            logger = get_root_logger()
            logger.warning(f'Offset abs mean is {offset_absmean}, larger than 50.')

        if LooseVersion(torchvision.__version__) >= LooseVersion('0.9.0'):
            return torchvision.ops.deform_conv2d(x, offset, self.weight, self.bias, self.stride, self.padding,
                                                 self.dilation, mask)
        else:
            return modulated_deform_conv(x, offset, mask, self.weight, self.bias, self.stride, self.padding,
                                         self.dilation, self.groups, self.deformable_groups)


def _no_grad_trunc_normal_(tensor, mean, std, a, b):
    # From: https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/layers/weight_init.py
    # Cut & paste from PyTorch official master until it's in a few official releases - RW
    # Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf
    def norm_cdf(x):
        # Computes standard normal cumulative distribution function
        return (1. + math.erf(x / math.sqrt(2.))) / 2.

    if (mean < a - 2 * std) or (mean > b + 2 * std):
        warnings.warn(
            'mean is more than 2 std from [a, b] in nn.init.trunc_normal_. '
            'The distribution of values may be incorrect.',
            stacklevel=2)

    with torch.no_grad():
        # Values are generated by using a truncated uniform distribution and
        # then using the inverse CDF for the normal distribution.
        # Get upper and lower cdf values
        low = norm_cdf((a - mean) / std)
        up = norm_cdf((b - mean) / std)

        # Uniformly fill tensor with values from [low, up], then translate to
        # [2l-1, 2u-1].
        tensor.uniform_(2 * low - 1, 2 * up - 1)

        # Use inverse cdf transform for normal distribution to get truncated
        # standard normal
        tensor.erfinv_()

        # Transform to proper mean, std
        tensor.mul_(std * math.sqrt(2.))
        tensor.add_(mean)

        # Clamp to ensure it's in the proper range
        tensor.clamp_(min=a, max=b)
        return tensor


def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.):
    r"""Fills the input Tensor with values drawn from a truncated
    normal distribution.

    From: https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/layers/weight_init.py

    The values are effectively drawn from the
    normal distribution :math:`\mathcal{N}(\text{mean}, \text{std}^2)`
    with values outside :math:`[a, b]` redrawn until they are within
    the bounds. The method used for generating the random values works
    best when :math:`a \leq \text{mean} \leq b`.

    Args:
        tensor: an n-dimensional `torch.Tensor`
        mean: the mean of the normal distribution
        std: the standard deviation of the normal distribution
        a: the minimum cutoff value
        b: the maximum cutoff value

    Examples:
        >>> w = torch.empty(3, 5)
        >>> nn.init.trunc_normal_(w)
    """
    return _no_grad_trunc_normal_(tensor, mean, std, a, b)


# From PyTorch
def _ntuple(n):

    def parse(x):
        if isinstance(x, collections.abc.Iterable):
            return x
        return tuple(repeat(x, n))

    return parse


to_1tuple = _ntuple(1)
to_2tuple = _ntuple(2)
to_3tuple = _ntuple(3)
to_4tuple = _ntuple(4)
to_ntuple = _ntuple


================================================
FILE: basicsr/archs/rfdnfinalB5_arch.py
================================================
'''
This repository is used to implement all upsamplers(only x4) and tools for Efficient SR
@author
    LI Zehyuan from SIAT
    LIU yingqi from SIAT
'''

from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import basicsr.archs.Blocks as Blocks
import basicsr.archs.Upsamplers as Upsamplers
from basicsr.utils.registry import ARCH_REGISTRY


class ESA(nn.Module):
    def __init__(self, num_feat=50, conv=nn.Conv2d, p=0.25):
        super(ESA, self).__init__()
        f = num_feat // 4
        BSConvS_kwargs = {}
        if conv.__name__ == 'BSConvS':
            BSConvS_kwargs = {'p': p}
        self.conv1 = nn.Linear(num_feat, f)
        self.conv_f = nn.Linear(f, f)
        self.maxPooling = nn.MaxPool2d(kernel_size=7, stride=3)
        self.conv_max = conv(f, f, kernel_size=3, **BSConvS_kwargs)
        self.conv2 = nn.Conv2d(f, f, 3, 2, 0)
        self.conv3 = conv(f, f, kernel_size=3, **BSConvS_kwargs)
        self.conv3_ = conv(f, f, kernel_size=3, **BSConvS_kwargs)
        self.conv4 = nn.Linear(f, num_feat)
        self.sigmoid = nn.Sigmoid()
        self.GELU = nn.GELU()

    def forward(self, input):
        x = input.permute(0, 2, 3, 1)
        c1_ = (self.conv1(x))
        c1 = self.conv2(c1_.permute(0, 3, 1, 2))
        v_max = self.maxPooling(c1)
        v_range = self.GELU(self.conv_max(v_max))
        c3 = self.GELU(self.conv3(v_range))
        c3 = self.conv3_(c3)
        c3 = F.interpolate(c3, (input.size(2), input.size(3)), mode='bilinear', align_corners=False)
        cf = self.conv_f(c1_)
        c4 = self.conv4((c3.permute(0, 2, 3, 1) + cf))
        m = self.sigmoid(c4.permute(0, 3, 1, 2))

        return input * m


class RFDB(nn.Module):
    def __init__(self, in_channels, out_channels, distillation_rate=0.25, conv=nn.Conv2d, p=0.25):
        super(RFDB, self).__init__()
        kwargs = {'padding': 1}
        if conv.__name__ == 'BSConvS':
            kwargs = {'p': p}

        self.dc = self.distilled_channels = in_channels // 2
        self.rc = self.remaining_channels = in_channels

        self.c1_d = nn.Linear(in_channels, self.dc)
        self.c1_r = conv(in_channels, self.rc, kernel_size=3,  **kwargs)
        self.c2_d = nn.Linear(self.remaining_channels, self.dc)
        self.c2_r = conv(self.remaining_channels, self.rc, kernel_size=3, **kwargs)
        self.c3_d = nn.Linear(self.remaining_channels, self.dc)
        self.c3_r = conv(self.remaining_channels, self.rc, kernel_size=3, **kwargs)

        self.c4 = conv(self.remaining_channels, self.dc, kernel_size=3, **kwargs)
        self.act = nn.GELU()

        self.c5 = nn.Linear(self.dc * 4, in_channels)
        self.esa = ESA(in_channels, conv)
        self.cw = nn.Parameter(torch.normal(mean=1, std=0.2, size=(1, in_channels)))
        self.conv_out = nn.Linear(in_channels, out_channels)

    def forward(self, input):

        distilled_c1 = self.act(self.c1_d(input.permute(0, 2, 3, 1)))
        r_c1 = (self.c1_r(input))
        r_c1 = self.act(r_c1 + input)

        distilled_c2 = self.act(self.c2_d(r_c1.permute(0, 2, 3, 1)))
        r_c2 = (self.c2_r(r_c1))
        r_c2 = self.act(r_c2 + r_c1)

        distilled_c3 = self.act(self.c3_d(r_c2.permute(0, 2, 3, 1)))
        r_c3 = (self.c3_r(r_c2))
        r_c3 = self.act(r_c3 + r_c2)

        r_c4 = self.act(self.c4(r_c3))

        out = torch.cat([distilled_c1, distilled_c2, distilled_c3, r_c4.permute(0, 2, 3, 1)], dim=3)
        out = self.c5(out).permute(0, 3, 1, 2)
        out_fused = self.esa(out)
        out_fused = out_fused.permute(0, 2, 3, 1) * self.cw
        out_fused = self.conv_out(out_fused)

        return out_fused.permute(0, 3, 1, 2) + input


def make_layer(block, n_layers):
    layers = []
    for _ in range(n_layers):
        layers.append(block())
    return nn.Sequential(*layers)


@ARCH_REGISTRY.register()
class RFDNFINALB5(nn.Module):
    def __init__(self, num_in_ch=3, num_feat=50, num_block=4, num_out_ch=3, upscale=4,
                 conv='BSConvU', upsampler='pixelshuffledirect', p=0.25):
        super(RFDNFINALB5, self).__init__()
        kwargs = {'padding': 1}
        if conv == 'BSConvS':
            kwargs = {'p': p}
        print(conv)
        if conv == 'DepthWiseConv':
            self.conv = Blocks.DepthWiseConv
        elif conv == 'BSConvU':
            self.conv = Blocks.BSConvU
        elif conv == 'BSConvS':
            self.conv = Blocks.BSConvS
        else:
            self.conv = nn.Conv2d
        self.fea_conv = self.conv(num_in_ch * 4, num_feat, kernel_size=3, **kwargs)

        # RFDB_block_f = functools.partial(RFDB, in_channels=num_feat, conv=self.conv, p=p)
        # RFDB_trunk = make_layer(RFDB_block_f, num_block)
        self.B1 = RFDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B2 = RFDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B3 = RFDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B4 = RFDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        self.B5 = RFDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        # self.B6 = RFDB(in_channels=num_feat, out_channels=num_feat, conv=self.conv, p=p)
        # self.B7 = RFDB(in_channels=num_feat, conv=self.conv, p=p)

        self.c1 = nn.Linear(num_feat * num_block, num_feat)
        self.GELU = nn.GELU()

        self.c2 = self.conv(num_feat, num_feat, kernel_size=3, **kwargs)


        if upsampler == 'pixelshuffledirect':
            self.upsampler = Upsamplers.PixelShuffleDirect(scale=upscale, num_feat=num_feat, num_out_ch=num_out_ch)
        elif upsampler == 'pixelshuffleblock':
            self.upsampler = Upsamplers.PixelShuffleBlcok(in_feat=num_feat, num_feat=num_feat, num_out_ch=num_out_ch)
        elif upsampler == 'nearestconv':
            self.upsampler = Upsamplers.NearestConv(in_ch=num_feat, num_feat=num_feat, num_out_ch=num_out_ch)
        elif upsampler == 'pa':
            self.upsampler = Upsamplers.PA_UP(nf=num_feat, unf=24, out_nc=num_out_ch)
        else:
            raise NotImplementedError(("Check the Upsampeler. None or not support yet"))

    def forward(self, input):
        input = torch.cat([input, input, input, input], dim=1)
        out_fea = self.fea_conv(input)
        out_B1 = self.B1(out_fea)
        out_B2 = self.B2(out_B1)
        out_B3 = self.B3(out_B2)
        out_B4 = self.B4(out_B3)
        out_B5 = self.B5(out_B4)
        # out_B6 = self.B6(out_B5)
        # out_B7 = self.B7(out_B6)
        trunk = torch.cat([out_B1, out_B2, out_B3, out_B4, out_B5], dim=1)
        out_B = self.c1(trunk.permute(0, 2, 3, 1))
        out_B = self.GELU(out_B.permute(0, 3, 1, 2))
        # print(out_B.shape)
        out_lr = self.c2(out_B) + out_fea

        # output = self.c3(out_lr)
        output = self.upsampler(out_lr)

        return output



================================================
FILE: basicsr/archs/vgg_arch.py
================================================
import os
import torch
from collections import OrderedDict
from torch import nn as nn
from torchvision.models import vgg as vgg

from basicsr.utils.registry import ARCH_REGISTRY

VGG_PRETRAIN_PATH = 'experiments/pretrained_models/vgg19-dcbb9e9d.pth'
NAMES = {
    'vgg11': [
        'conv1_1', 'relu1_1', 'pool1', 'conv2_1', 'relu2_1', 'pool2', 'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2',
        'pool3', 'conv4_1', 'relu4_1', 'conv4_2', 'relu4_2', 'pool4', 'conv5_1', 'relu5_1', 'conv5_2', 'relu5_2',
        'pool5'
    ],
    'vgg13': [
        'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1', 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2',
        'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'pool3', 'conv4_1', 'relu4_1', 'conv4_2', 'relu4_2', 'pool4',
        'conv5_1', 'relu5_1', 'conv5_2', 'relu5_2', 'pool5'
    ],
    'vgg16': [
        'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1', 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2',
        'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', 'relu3_3', 'pool3', 'conv4_1', 'relu4_1', 'conv4_2',
        'relu4_2', 'conv4_3', 'relu4_3', 'pool4', 'conv5_1', 'relu5_1', 'conv5_2', 'relu5_2', 'conv5_3', 'relu5_3',
        'pool5'
    ],
    'vgg19': [
        'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1', 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2',
        'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', 'relu3_3', 'conv3_4', 'relu3_4', 'pool3', 'conv4_1',
        'relu4_1', 'conv4_2', 'relu4_2', 'conv4_3', 'relu4_3', 'conv4_4', 'relu4_4', 'pool4', 'conv5_1', 'relu5_1',
        'conv5_2', 'relu5_2', 'conv5_3', 'relu5_3', 'conv5_4', 'relu5_4', 'pool5'
    ]
}


def insert_bn(names):
    """Insert bn layer after each conv.

    Args:
        names (list): The list of layer names.

    Returns:
        list: The list of layer names with bn layers.
    """
    names_bn = []
    for name in names:
        names_bn.append(name)
        if 'conv' in name:
            position = name.replace('conv', '')
            names_bn.append('bn' + position)
    return names_bn


@ARCH_REGISTRY.register()
class VGGFeatureExtractor(nn.Module):
    """VGG network for feature extraction.

    In this implementation, we allow users to choose whether use normalization
    in the input feature and the type of vgg network. Note that the pretrained
    path must fit the vgg type.

    Args:
        layer_name_list (list[str]): Forward function returns the corresponding
            features according to the layer_name_list.
            Example: {'relu1_1', 'relu2_1', 'relu3_1'}.
        vgg_type (str): Set the type of vgg network. Default: 'vgg19'.
        use_input_norm (bool): If True, normalize the input image. Importantly,
            the input feature must in the range [0, 1]. Default: True.
        range_norm (bool): If True, norm images with range [-1, 1] to [0, 1].
            Default: False.
        requires_grad (bool): If true, the parameters of VGG network will be
            optimized. Default: False.
        remove_pooling (bool): If true, the max pooling operations in VGG net
            will be removed. Default: False.
        pooling_stride (int): The stride of max pooling operation. Default: 2.
    """

    def __init__(self,
                 layer_name_list,
                 vgg_type='vgg19',
                 use_input_norm=True,
                 range_norm=False,
                 requires_grad=False,
                 remove_pooling=False,
                 pooling_stride=2):
        super(VGGFeatureExtractor, self).__init__()

        self.layer_name_list = layer_name_list
        self.use_input_norm = use_input_norm
        self.range_norm = range_norm

        self.names = NAMES[vgg_type.replace('_bn', '')]
        if 'bn' in vgg_type:
            self.names = insert_bn(self.names)

        # only borrow layers that will be used to avoid unused params
        max_idx = 0
        for v in layer_name_list:
            idx = self.names.index(v)
            if idx > max_idx:
                max_idx = idx

        if os.path.exists(VGG_PRETRAIN_PATH):
            vgg_net = getattr(vgg, vgg_type)(pretrained=False)
            state_dict = torch.load(VGG_PRETRAIN_PATH, map_location=lambda storage, loc: storage)
            vgg_net.load_state_dict(state_dict)
        else:
            vgg_net = getattr(vgg, vgg_type)(pretrained=True)

        features = vgg_net.features[:max_idx + 1]

        modified_net = OrderedDict()
        for k, v in zip(self.names, features):
            if 'pool' in k:
                # if remove_pooling is true, pooling operation will be removed
                if remove_pooling:
                    continue
                else:
                    # in some cases, we may want to change the default stride
                    modified_net[k] = nn.MaxPool2d(kernel_size=2, stride=pooling_stride)
            else:
                modified_net[k] = v

        self.vgg_net = nn.Sequential(modified_net)

        if not requires_grad:
            self.vgg_net.eval()
            for param in self.parameters():
                param.requires_grad = False
        else:
            self.vgg_net.train()
            for param in self.parameters():
                param.requires_grad = True

        if self.use_input_norm:
            # the mean is for image with range [0, 1]
            self.register_buffer('mean', torch.Tensor([0.485, 0.456, 0.406]).view(1, 3, 1, 1))
            # the std is for image with range [0, 1]
            self.register_buffer('std', torch.Tensor([0.229, 0.224, 0.225]).view(1, 3, 1, 1))

    def forward(self, x):
        """Forward function.

        Args:
            x (Tensor): Input tensor with shape (n, c, h, w).

        Returns:
            Tensor: Forward results.
        """
        if self.range_norm:
            x = (x + 1) / 2
        if self.use_input_norm:
            x = (x - self.mean) / self.std

        output = {}
        for key, layer in self.vgg_net._modules.items():
            x = layer(x)
            if key in self.layer_name_list:
                output[key] = x.clone()

        return output


================================================
FILE: basicsr/data/__init__.py
================================================
import importlib
import numpy as np
import random
import torch
import torch.utils.data
from copy import deepcopy
from functools import partial
from os import path as osp

from basicsr.data.prefetch_dataloader import PrefetchDataLoader
from basicsr.utils import get_root_logger, scandir
from basicsr.utils.dist_util import get_dist_info
from basicsr.utils.registry import DATASET_REGISTRY

__all__ = ['build_dataset', 'build_dataloader']

# automatically scan and import dataset modules for registry
# scan all the files under the data folder with '_dataset' in file names
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'basicsr.data.{file_name}') for file_name in dataset_filenames]


def build_dataset(dataset_opt):
    """Build dataset from options.

    Args:
        dataset_opt (dict): Configuration for dataset. It must contain:
            name (str): Dataset name.
            type (str): Dataset type.
    """
    dataset_opt = deepcopy(dataset_opt)
    dataset = DATASET_REGISTRY.get(dataset_opt['type'])(dataset_opt)
    logger = get_root_logger()
    logger.info(f'Dataset [{dataset.__class__.__name__}] - {dataset_opt["name"]} ' 'is built.')
    return dataset


def build_dataloader(dataset, dataset_opt, num_gpu=1, dist=False, sampler=None, seed=None):
    """Build dataloader.

    Args:
        dataset (torch.utils.data.Dataset): Dataset.
        dataset_opt (dict): Dataset options. It contains the following keys:
            phase (str): 'train' or 'val'.
            num_worker_per_gpu (int): Number of workers for each GPU.
            batch_size_per_gpu (int): Training batch size for each GPU.
        num_gpu (int): Number of GPUs. Used only in the train phase.
            Default: 1.
        dist (bool): Whether in distributed training. Used only in the train
            phase. Default: False.
        sampler (torch.utils.data.sampler): Data sampler. Default: None.
        seed (int | None): Seed. Default: None
    """
    phase = dataset_opt['phase']
    rank, _ = get_dist_info()
    if phase == 'train':
        if dist:  # distributed training
            batch_size = dataset_opt['batch_size_per_gpu']
            num_workers = dataset_opt['num_worker_per_gpu']
        else:  # non-distributed training
            multiplier = 1 if num_gpu == 0 else num_gpu
            batch_size = dataset_opt['batch_size_per_gpu'] * multiplier
            num_workers = dataset_opt['num_worker_per_gpu'] * multiplier
        dataloader_args = dict(
            dataset=dataset,
            batch_size=batch_size,
            shuffle=False,
            num_workers=num_workers,
            sampler=sampler,
            drop_last=True)
        if sampler is None:
            dataloader_args['shuffle'] = True
        dataloader_args['worker_init_fn'] = partial(
            worker_init_fn, num_workers=num_workers, rank=rank, seed=seed) if seed is not None else None
    elif phase in ['val', 'test']:  # validation
        dataloader_args = dict(dataset=dataset, batch_size=1, shuffle=False, num_workers=0)
    else:
        raise ValueError(f'Wrong dataset phase: {phase}. ' "Supported ones are 'train', 'val' and 'test'.")

    dataloader_args['pin_memory'] = dataset_opt.get('pin_memory', False)
    dataloader_args['persistent_workers'] = dataset_opt.get('persistent_workers', False)

    prefetch_mode = dataset_opt.get('prefetch_mode')
    if prefetch_mode == 'cpu':  # CPUPrefetcher
        num_prefetch_queue = dataset_opt.get('num_prefetch_queue', 1)
        logger = get_root_logger()
        logger.info(f'Use {prefetch_mode} prefetch dataloader: num_prefetch_queue = {num_prefetch_queue}')
        return PrefetchDataLoader(num_prefetch_queue=num_prefetch_queue, **dataloader_args)
    else:
        # prefetch_mode=None: Normal dataloader
        # prefetch_mode='cuda': dataloader for CUDAPrefetcher
        return torch.utils.data.DataLoader(**dataloader_args)


def worker_init_fn(worker_id, num_workers, rank, seed):
    # Set the worker seed to num_workers * rank + worker_id + seed
    worker_seed = num_workers * rank + worker_id + seed
    np.random.seed(worker_seed)
    random.seed(worker_seed)


================================================
FILE: basicsr/data/data_sampler.py
================================================
import math
import torch
from torch.utils.data.sampler import Sampler


class EnlargedSampler(Sampler):
    """Sampler that restricts data loading to a subset of the dataset.

    Modified from torch.utils.data.distributed.DistributedSampler
    Support enlarging the dataset for iteration-based training, for saving
    time when restart the dataloader after each epoch

    Args:
        dataset (torch.utils.data.Dataset): Dataset used for sampling.
        num_replicas (int | None): Number of processes participating in
            the training. It is usually the world_size.
        rank (int | None): Rank of the current process within num_replicas.
        ratio (int): Enlarging ratio. Default: 1.
    """

    def __init__(self, dataset, num_replicas, rank, ratio=1):
        self.dataset = dataset
        self.num_replicas = num_replicas
        self.rank = rank
        self.epoch = 0
        self.num_samples = math.ceil(len(self.dataset) * ratio / self.num_replicas)
        self.total_size = self.num_samples * self.num_replicas

    def __iter__(self):
        # deterministically shuffle based on epoch
        g = torch.Generator()
        g.manual_seed(self.epoch)
        indices = torch.randperm(self.total_size, generator=g).tolist()

        dataset_size = len(self.dataset)
        indices = [v % dataset_size for v in indices]

        # subsample
        indices = indices[self.rank:self.total_size:self.num_replicas]
        assert len(indices) == self.num_samples

        return iter(indices)

    def __len__(self):
        return self.num_samples

    def set_epoch(self, epoch):
        self.epoch = epoch


================================================
FILE: basicsr/data/data_util.py
================================================
import cv2
import numpy as np
import torch
from os import path as osp
from torch.nn import functional as F

from basicsr.data.transforms import mod_crop
from basicsr.utils import img2tensor, scandir


def read_img_seq(path, require_mod_crop=False, scale=1, return_imgname=False):
    """Read a sequence of images from a given folder path.

    Args:
        path (list[str] | str): List of image paths or image folder path.
        require_mod_crop (bool): Require mod crop for each image.
            Default: False.
        scale (int): Scale factor for mod_crop. Default: 1.
        return_imgname(bool): Whether return image names. Default False.

    Returns:
        Tensor: size (t, c, h, w), RGB, [0, 1].
        list[str]: Returned image name list.
    """
    if isinstance(path, list):
        img_paths = path
    else:
        img_paths = sorted(list(scandir(path, full_path=True)))
    imgs = [cv2.imread(v).astype(np.float32) / 255. for v in img_paths]

    if require_mod_crop:
        imgs = [mod_crop(img, scale) for img in imgs]
    imgs = img2tensor(imgs, bgr2rgb=True, float32=True)
    imgs = torch.stack(imgs, dim=0)

    if return_imgname:
        imgnames = [osp.splitext(osp.basename(path))[0] for path in img_paths]
        return imgs, imgnames
    else:
        return imgs


def generate_frame_indices(crt_idx, max_frame_num, num_frames, padding='reflection'):
    """Generate an index list for reading `num_frames` frames from a sequence
    of images.

    Args:
        crt_idx (int): Current center index.
        max_frame_num (int): Max number of the sequence of images (from 1).
        num_frames (int): Reading num_frames frames.
        padding (str): Padding mode, one of
            'replicate' | 'reflection' | 'reflection_circle' | 'circle'
            Examples: current_idx = 0, num_frames = 5
            The generated frame indices under different padding mode:
            replicate: [0, 0, 0, 1, 2]
            reflection: [2, 1, 0, 1, 2]
            reflection_circle: [4, 3, 0, 1, 2]
            circle: [3, 4, 0, 1, 2]

    Returns:
        list[int]: A list of indices.
    """
    assert num_frames % 2 == 1, 'num_frames should be an odd number.'
    assert padding in ('replicate', 'reflection', 'reflection_circle', 'circle'), f'Wrong padding mode: {padding}.'

    max_frame_num = max_frame_num - 1  # start from 0
    num_pad = num_frames // 2

    indices = []
    for i in range(crt_idx - num_pad, crt_idx + num_pad + 1):
        if i < 0:
            if padding == 'replicate':
                pad_idx = 0
            elif padding == 'reflection':
                pad_idx = -i
            elif padding == 'reflection_circle':
                pad_idx = crt_idx + num_pad - i
            else:
                pad_idx = num_frames + i
        elif i > max_frame_num:
            if padding == 'replicate':
                pad_idx = max_frame_num
            elif padding == 'reflection':
                pad_idx = max_frame_num * 2 - i
            elif padding == 'reflection_circle':
                pad_idx = (crt_idx - num_pad) - (i - max_frame_num)
            else:
                pad_idx = i - num_frames
        else:
            pad_idx = i
        indices.append(pad_idx)
    return indices


def paired_paths_from_lmdb(folders, keys):
    """Generate paired paths from lmdb files.

    Contents of lmdb. Taking the `lq.lmdb` for example, the file structure is:

    lq.lmdb
    ├── data.mdb
    ├── lock.mdb
    ├── meta_info.txt

    The data.mdb and lock.mdb are standard lmdb files and you can refer to
    https://lmdb.readthedocs.io/en/release/ for more details.

    The meta_info.txt is a specified txt file to record the meta information
    of our datasets. It will be automatically created when preparing
    datasets by our provided dataset tools.
    Each line in the txt file records
    1)image name (with extension),
    2)image shape,
    3)compression level, separated by a white space.
    Example: `baboon.png (120,125,3) 1`

    We use the image name without extension as the lmdb key.
    Note that we use the same key for the corresponding lq and gt images.

    Args:
        folders (list[str]): A list of folder path. The order of list should
            be [input_folder, gt_folder].
        keys (list[str]): A list of keys identifying folders. The order should
            be in consistent with folders, e.g., ['lq', 'gt'].
            Note that this key is different from lmdb keys.

    Returns:
        list[str]: Returned path list.
    """
    assert len(folders) == 2, ('The len of folders should be 2 with [input_folder, gt_folder]. '
                               f'But got {len(folders)}')
    assert len(keys) == 2, f'The len of keys should be 2 with [input_key, gt_key]. But got {len(keys)}'
    input_folder, gt_folder = folders
    input_key, gt_key = keys

    if not (input_folder.endswith('.lmdb') and gt_folder.endswith('.lmdb')):
        raise ValueError(f'{input_key} folder and {gt_key} folder should both in lmdb '
                         f'formats. But received {input_key}: {input_folder}; '
                         f'{gt_key}: {gt_folder}')
    # ensure that the two meta_info files are the same
    with open(osp.join(input_folder, 'meta_info.txt')) as fin:
        input_lmdb_keys = [line.split('.')[0] for line in fin]
    with open(osp.join(gt_folder, 'meta_info.txt')) as fin:
        gt_lmdb_keys = [line.split('.')[0] for line in fin]
    if set(input_lmdb_keys) != set(gt_lmdb_keys):
        raise ValueError(f'Keys in {input_key}_folder and {gt_key}_folder are different.')
    else:
        paths = []
        for lmdb_key in sorted(input_lmdb_keys):
            paths.append(dict([(f'{input_key}_path', lmdb_key), (f'{gt_key}_path', lmdb_key)]))
        return paths


def paired_paths_from_meta_info_file(folders, keys, meta_info_file, filename_tmpl):
    """Generate paired paths from an meta information file.

    Each line in the meta information file contains the image names and
    image shape (usually for gt), separated by a white space.

    Example of an meta information file:
    ```
    0001_s001.png (480,480,3)
    0001_s002.png (480,480,3)
    ```

    Args:
        folders (list[str]): A list of folder path. The order of list should
            be [input_folder, gt_folder].
        keys (list[str]): A list of keys identifying folders. The order should
            be in consistent with folders, e.g., ['lq', 'gt'].
        meta_info_file (str): Path to the meta information file.
        filename_tmpl (str): Template for each filename. Note that the
            template excludes the file extension. Usually the filename_tmpl is
            for files in the input folder.

    Returns:
        list[str]: Returned path list.
    """
    assert len(folders) == 2, ('The len of folders should be 2 with [input_folder, gt_folder]. '
                               f'But got {len(folders)}')
    assert len(keys) == 2, f'The len of keys should be 2 with [input_key, gt_key]. But got {len(keys)}'
    input_folder, gt_folder = folders
    input_key, gt_key = keys

    with open(meta_info_file, 'r') as fin:
        gt_names = [line.strip().split(' ')[0] for line in fin]

    paths = []
    for gt_name in gt_names:
        basename, ext = osp.splitext(osp.basename(gt_name))
        input_name = f'{filename_tmpl.format(basename)}{ext}'
        input_path = osp.join(input_folder, input_name)
        gt_path = osp.join(gt_folder, gt_name)
        paths.append(dict([(f'{input_key}_path', input_path), (f'{gt_key}_path', gt_path)]))
    return paths


def paired_paths_from_folder(folders, keys, filename_tmpl):
    """Generate paired paths from folders.

    Args:
        folders (list[str]): A list of folder path. The order of list should
            be [input_folder, gt_folder].
        keys (list[str]): A list of keys identifying folders. The order should
            be in consistent with folders, e.g., ['lq', 'gt'].
        filename_tmpl (str): Template for each filename. Note that the
            template excludes the file extension. Usually the filename_tmpl is
            for files in the input folder.

    Returns:
        list[str]: Returned path list.
    """
    assert len(folders) == 2, ('The len of folders should be 2 with [input_folder, gt_folder]. '
                               f'But got {len(folders)}')
    assert len(keys) == 2, f'The len of keys should be 2 with [input_key, gt_key]. But got {len(keys)}'
    input_folder, gt_folder = folders
    input_key, gt_key = keys

    input_paths = list(scandir(input_folder))
    gt_paths = list(scandir(gt_folder))
    assert len(input_paths) == len(gt_paths), (f'{input_key} and {gt_key} datasets have different number of images: '
                                               f'{len(input_paths)}, {len(gt_paths)}.')
    paths = []
    for gt_path in gt_paths:
        basename, ext = osp.splitext(osp.basename(gt_path))
        input_name = f'{filename_tmpl.format(basename)}{ext}'
        input_path = osp.join(input_folder, input_name)
        assert input_name in input_paths, f'{input_name} is not in {input_key}_paths.'
        gt_path = osp.join(gt_folder, gt_path)
        paths.append(dict([(f'{input_key}_path', input_path), (f'{gt_key}_path', gt_path)]))
    return paths


def paths_from_folder(folder):
    """Generate paths from folder.

    Args:
        folder (str): Folder path.

    Returns:
        list[str]: Returned path list.
    """

    paths = list(scandir(folder))
    paths = [osp.join(folder, path) for path in paths]
    return paths


def paths_from_lmdb(folder):
    """Generate paths from lmdb.

    Args:
        folder (str): Folder path.

    Returns:
        list[str]: Returned path list.
    """
    if not folder.endswith('.lmdb'):
        raise ValueError(f'Folder {folder}folder should in lmdb format.')
    with open(osp.join(folder, 'meta_info.txt')) as fin:
        paths = [line.split('.')[0] for line in fin]
    return paths


def generate_gaussian_kernel(kernel_size=13, sigma=1.6):
    """Generate Gaussian kernel used in `duf_downsample`.

    Args:
        kernel_size (int): Kernel size. Default: 13.
        sigma (float): Sigma of the Gaussian kernel. Default: 1.6.

    Returns:
        np.array: The Gaussian kernel.
    """
    from scipy.ndimage import filters as filters
    kernel = np.zeros((kernel_size, kernel_size))
    # set element at the middle to one, a dirac delta
    kernel[kernel_size // 2, kernel_size // 2] = 1
    # gaussian-smooth the dirac, resulting in a gaussian filter
    return filters.gaussian_filter(kernel, sigma)


def duf_downsample(x, kernel_size=13, scale=4):
    """Downsamping with Gaussian kernel used in the DUF official code.

    Args:
        x (Tensor): Frames to be downsampled, with shape (b, t, c, h, w).
        kernel_size (int): Kernel size. Default: 13.
        scale (int): Downsampling factor. Supported scale: (2, 3, 4).
            Default: 4.

    Returns:
        Tensor: DUF downsampled frames.
    """
    assert scale in (2, 3, 4), f'Only support scale (2, 3, 4), but got {scale}.'

    squeeze_flag = False
    if x.ndim == 4:
        squeeze_flag = True
        x = x.unsqueeze(0)
    b, t, c, h, w = x.size()
    x = x.view(-1, 1, h, w)
    pad_w, pad_h = kernel_size // 2 + scale * 2, kernel_size // 2 + scale * 2
    x = F.pad(x, (pad_w, pad_w, pad_h, pad_h), 'reflect')

    gaussian_filter = generate_gaussian_kernel(kernel_size, 0.4 * scale)
    gaussian_filter = torch.from_numpy(gaussian_filter).type_as(x).unsqueeze(0).unsqueeze(0)
    x = F.conv2d(x, gaussian_filter, stride=scale)
    x = x[:, :, 2:-2, 2:-2]
    x = x.view(b, t, c, x.size(2), x.size(3))
    if squeeze_flag:
        x = x.squeeze(0)
    return x


================================================
FILE: basicsr/data/degradations.py
================================================
import cv2
import math
import numpy as np
import random
import torch
from scipy import special
from scipy.stats import multivariate_normal
from torchvision.transforms.functional_tensor import rgb_to_grayscale

# -------------------------------------------------------------------- #
# --------------------------- blur kernels --------------------------- #
# -------------------------------------------------------------------- #


# --------------------------- util functions --------------------------- #
def sigma_matrix2(sig_x, sig_y, theta):
    """Calculate the rotated sigma matrix (two dimensional matrix).

    Args:
        sig_x (float):
        sig_y (float):
        theta (float): Radian measurement.

    Returns:
        ndarray: Rotated sigma matrix.
    """
    d_matrix = np.array([[sig_x**2, 0], [0, sig_y**2]])
    u_matrix = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]])
    return np.dot(u_matrix, np.dot(d_matrix, u_matrix.T))


def mesh_grid(kernel_size):
    """Generate the mesh grid, centering at zero.

    Args:
        kernel_size (int):

    Returns:
        xy (ndarray): with the shape (kernel_size, kernel_size, 2)
        xx (ndarray): with the shape (kernel_size, kernel_size)
        yy (ndarray): with the shape (kernel_size, kernel_size)
    """
    ax = np.arange(-kernel_size // 2 + 1., kernel_size // 2 + 1.)
    xx, yy = np.meshgrid(ax, ax)
    xy = np.hstack((xx.reshape((kernel_size * kernel_size, 1)), yy.reshape(kernel_size * kernel_size,
                                                                           1))).reshape(kernel_size, kernel_size, 2)
    return xy, xx, yy


def pdf2(sigma_matrix, grid):
    """Calculate PDF of the bivariate Gaussian distribution.

    Args:
        sigma_matrix (ndarray): with the shape (2, 2)
        grid (ndarray): generated by :func:`mesh_grid`,
            with the shape (K, K, 2), K is the kernel size.

    Returns:
        kernel (ndarrray): un-normalized kernel.
    """
    inverse_sigma = np.linalg.inv(sigma_matrix)
    kernel = np.exp(-0.5 * np.sum(np.dot(grid, inverse_sigma) * grid, 2))
    return kernel


def cdf2(d_matrix, grid):
    """Calculate the CDF of the standard bivariate Gaussian distribution.
        Used in skewed Gaussian distribution.

    Args:
        d_matrix (ndarrasy): skew matrix.
        grid (ndarray): generated by :func:`mesh_grid`,
            with the shape (K, K, 2), K is the kernel size.

    Returns:
        cdf (ndarray): skewed cdf.
    """
    rv = multivariate_normal([0, 0], [[1, 0], [0, 1]])
    grid = np.dot(grid, d_matrix)
    cdf = rv.cdf(grid)
    return cdf


def bivariate_Gaussian(kernel_size, sig_x, sig_y, theta, grid=None, isotropic=True):
    """Generate a bivariate isotropic or anisotropic Gaussian kernel.

    In the isotropic mode, only `sig_x` is used. `sig_y` and `theta` is ignored.

    Args:
        kernel_size (int):
        sig_x (float):
        sig_y (float):
        theta (float): Radian measurement.
        grid (ndarray, optional): generated by :func:`mesh_grid`,
            with the shape (K, K, 2), K is the kernel size. Default: None
        isotropic (bool):

    Returns:
        kernel (ndarray): normalized kernel.
    """
    if grid is None:
        grid, _, _ = mesh_grid(kernel_size)
    if isotropic:
        sigma_matrix = np.array([[sig_x**2, 0], [0, sig_x**2]])
    else:
        sigma_matrix = sigma_matrix2(sig_x, sig_y, theta)
    kernel = pdf2(sigma_matrix, grid)
    kernel = kernel / np.sum(kernel)
    return kernel


def bivariate_generalized_Gaussian(kernel_size, sig_x, sig_y, theta, beta, grid=None, isotropic=True):
    """Generate a bivariate generalized Gaussian kernel.
        Described in `Parameter Estimation For Multivariate Generalized
        Gaussian Distributions`_
        by Pascal et. al (2013).

    In the isotropic mode, only `sig_x` is used. `sig_y` and `theta` is ignored.

    Args:
        kernel_size (int):
        sig_x (float):
        sig_y (float):
        theta (float): Radian measurement.
        beta (float): shape parameter, beta = 1 is the normal distribution.
        grid (ndarray, optional): generated by :func:`mesh_grid`,
            with the shape (K, K, 2), K is the kernel size. Default: None

    Returns:
        kernel (ndarray): normalized kernel.

    .. _Parameter Estimation For Multivariate Generalized Gaussian
    Distributions: https://arxiv.org/abs/1302.6498
    """
    if grid is None:
        grid, _, _ = mesh_grid(kernel_size)
    if isotropic:
        sigma_matrix = np.array([[sig_x**2, 0], [0, sig_x**2]])
    else:
        sigma_matrix = sigma_matrix2(sig_x, sig_y, theta)
    inverse_sigma = np.linalg.inv(sigma_matrix)
    kernel = np.exp(-0.5 * np.power(np.sum(np.dot(grid, inverse_sigma) * grid, 2), beta))
    kernel = kernel / np.sum(kernel)
    return kernel


def bivariate_plateau(kernel_size, sig_x, sig_y, theta, beta, grid=None, isotropic=True):
    """Generate a plateau-like anisotropic kernel.
    1 / (1+x^(beta))

    Ref: https://stats.stackexchange.com/questions/203629/is-there-a-plateau-shaped-distribution

    In the isotropic mode, only `sig_x` is used. `sig_y` and `theta` is ignored.

    Args:
        kernel_size (int):
        sig_x (float):
        sig_y (float):
        theta (float): Radian measurement.
        beta (float): shape parameter, beta = 1 is the normal distribution.
        grid (ndarray, optional): generated by :func:`mesh_grid`,
            with the shape (K, K, 2), K is the kernel size. Default: None

    Returns:
        kernel (ndarray): normalized kernel.
    """
    if grid is None:
        grid, _, _ = mesh_grid(kernel_size)
    if isotropic:
        sigma_matrix = np.array([[sig_x**2, 0], [0, sig_x**2]])
    else:
        sigma_matrix = sigma_matrix2(sig_x, sig_y, theta)
    inverse_sigma = np.linalg.inv(sigma_matrix)
    kernel = np.reciprocal(np.power(np.sum(np.dot(grid, inverse_sigma) * grid, 2), beta) + 1)
    kernel = kernel / np.sum(kernel)
    return kernel


def random_bivariate_Gaussian(kernel_size,
                              sigma_x_range,
                              sigma_y_range,
                              rotation_range,
                              noise_range=None,
                              isotropic=True):
    """Randomly generate bivariate isotropic or anisotropic Gaussian kernels.

    In the isotropic mode, only `sigma_x_range` is used. `sigma_y_range` and `rotation_range` is ignored.

    Args:
        kernel_size (int):
        sigma_x_range (tuple): [0.6, 5]
        sigma_y_range (tuple): [0.6, 5]
        rotation range (tuple): [-math.pi, math.pi]
        noise_range(tuple, optional): multiplicative kernel noise,
            [0.75, 1.25]. Default: None

    Returns:
        kernel (ndarray):
    """
    assert kernel_size % 2 == 1, 'Kernel size must be an odd number.'
    assert sigma_x_range[0] < sigma_x_range[1], 'Wrong sigma_x_range.'
    sigma_x = np.random.uniform(sigma_x_range[0], sigma_x_range[1])
    if isotropic is False:
        assert sigma_y_range[0] < sigma_y_range[1], 'Wrong sigma_y_range.'
        assert rotation_range[0] < rotation_range[1], 'Wrong rotation_range.'
        sigma_y = np.random.uniform(sigma_y_range[0], sigma_y_range[1])
        rotation = np.random.uniform(rotation_range[0], rotation_range[1])
    else:
        sigma_y = sigma_x
        rotation = 0

    kernel = bivariate_Gaussian(kernel_size, sigma_x, sigma_y, rotation, isotropic=isotropic)

    # add multiplicative noise
    if noise_range is not None:
        assert noise_range[0] < noise_range[1], 'Wrong noise range.'
        noise = np.random.uniform(noise_range[0], noise_range[1], size=kernel.shape)
        kernel = kernel * noise
    kernel = kernel / np.sum(kernel)
    return kernel


def random_bivariate_generalized_Gaussian(kernel_size,
                                          sigma_x_range,
                                          sigma_y_range,
                                          rotation_range,
                                          beta_range,
                                          noise_range=None,
                                          isotropic=True):
    """Randomly generate bivariate generalized Gaussian kernels.

    In the isotropic mode, only `sigma_x_range` is used. `sigma_y_range` and `rotation_range` is ignored.

    Args:
        kernel_size (int):
        sigma_x_range (tuple): [0.6, 5]
        sigma_y_range (tuple): [0.6, 5]
        rotation range (tuple): [-math.pi, math.pi]
        beta_range (tuple): [0.5, 8]
        noise_range(tuple, optional): multiplicative kernel noise,
            [0.75, 1.25]. Default: None

    Returns:
        kernel (ndarray):
    """
    assert kernel_size % 2 == 1, 'Kernel size must be an odd number.'
    assert sigma_x_range[0] < sigma_x_range[1], 'Wrong sigma_x_range.'
    sigma_x = np.random.uniform(sigma_x_range[0], sigma_x_range[1])
    if isotropic is False:
        assert sigma_y_range[0] < sigma_y_range[1], 'Wrong sigma_y_range.'
        assert rotation_range[0] < rotation_range[1], 'Wrong rotation_range.'
        sigma_y = np.random.uniform(sigma_y_range[0], sigma_y_range[1])
        rotation = np.random.uniform(rotation_range[0], rotation_range[1])
    else:
        sigma_y = sigma_x
        rotation = 0

    # assume beta_range[0] < 1 < beta_range[1]
    if np.random.uniform() < 0.5:
        beta = np.random.uniform(beta_range[0], 1)
    else:
        beta = np.random.uniform(1, beta_range[1])

    kernel = bivariate_generalized_Gaussian(kernel_size, sigma_x, sigma_y, rotation, beta, isotropic=isotropic)

    # add multiplicative noise
    if noise_range is not None:
        assert noise_range[0] < noise_range[1], 'Wrong noise range.'
        noise = np.random.uniform(noise_range[0], noise_range[1], size=kernel.shape)
        kernel = kernel * noise
    kernel = kernel / np.sum(kernel)
    return kernel


def random_bivariate_plateau(kernel_size,
                             sigma_x_range,
                             sigma_y_range,
                             rotation_range,
                             beta_range,
                             noise_range=None,
                             isotropic=True):
    """Randomly generate bivariate plateau kernels.

    In the isotropic mode, only `sigma_x_range` is used. `sigma_y_range` and `rotation_range` is ignored.

    Args:
        kernel_size (int):
        sigma_x_range (tuple): [0.6, 5]
        sigma_y_range (tuple): [0.6, 5]
        rotation range (tuple): [-math.pi/2, math.pi/2]
        beta_range (tuple): [1, 4]
        noise_range(tuple, optional): multiplicative kernel noise,
            [0.75, 1.25]. Default: None

    Returns:
        kernel (ndarray):
    """
    assert kernel_size % 2 == 1, 'Kernel size must be an odd number.'
    assert sigma_x_range[0] < sigma_x_range[1], 'Wrong sigma_x_range.'
    sigma_x = np.random.uniform(sigma_x_range[0], sigma_x_range[1])
    if isotropic is False:
        assert sigma_y_range[0] < sigma_y_range[1], 'Wrong sigma_y_range.'
        assert rotation_range[0] < rotation_range[1], 'Wrong rotation_range.'
        sigma_y = np.random.uniform(sigma_y_range[0], sigma_y_range[1])
        rotation = np.random.uniform(rotation_range[0], rotation_range[1])
    else:
        sigma_y = sigma_x
        rotation = 0

    # TODO: this may be not proper
    if np.random.uniform() < 0.5:
        beta = np.random.uniform(beta_range[0], 1)
    else:
        beta = np.random.uniform(1, beta_range[1])

    kernel = bivariate_plateau(kernel_size, sigma_x, sigma_y, rotation, beta, isotropic=isotropic)
    # add multiplicative noise
    if noise_range is not None:
        assert noise_range[0] < noise_range[1], 'Wrong noise range.'
        noise = np.random.uniform(noise_range[0], noise_range[1], size=kernel.shape)
        kernel = kernel * noise
    kernel = kernel / np.sum(kernel)

    return kernel


def random_mixed_kernels(kernel_list,
                         kernel_prob,
                         kernel_size=21,
                         sigma_x_range=(0.6, 5),
                         sigma_y_range=(0.6, 5),
                         rotation_range=(-math.pi, math.pi),
                         betag_range=(0.5, 8),
                         betap_range=(0.5, 8),
                         noise_range=None):
    """Randomly generate mixed kernels.

    Args:
        kernel_list (tuple): a list name of kernel types,
            support ['iso', 'aniso', 'skew', 'generalized', 'plateau_iso',
            'plateau_aniso']
        kernel_prob (tuple): corresponding kernel probability for each
            kernel type
        kernel_size (int):
        sigma_x_range (tuple): [0.6, 5]
        sigma_y_range (tuple): [0.6, 5]
        rotation range (tuple): [-math.pi, math.pi]
        beta_range (tuple): [0.5, 8]
        noise_range(tuple, optional): multiplicative kernel noise,
            [0.75, 1.25]. Default: None

    Returns:
        kernel (ndarray):
    """
    kernel_type = random.choices(kernel_list, kernel_prob)[0]
    if kernel_type == 'iso':
        kernel = random_bivariate_Gaussian(
            kernel_size, sigma_x_range, sigma_y_range, rotation_range, noise_range=noise_range, isotropic=True)
    elif kernel_type == 'aniso':
        kernel = random_bivariate_Gaussian(
            kernel_size, sigma_x_range, sigma_y_range, rotation_range, noise_range=noise_range, isotropic=False)
    elif kernel_type == 'generalized_iso':
        kernel = random_bivariate_generalized_Gaussian(
            kernel_size,
            sigma_x_range,
            sigma_y_range,
            rotation_range,
            betag_range,
            noise_range=noise_range,
            isotropic=True)
    elif kernel_type == 'generalized_aniso':
        kernel = random_bivariate_generalized_Gaussian(
            kernel_size,
            sigma_x_range,
            sigma_y_range,
            rotation_range,
            betag_range,
            noise_range=noise_range,
            isotropic=False)
    elif kernel_type == 'plateau_iso':
        kernel = random_bivariate_plateau(
            kernel_size, sigma_x_range, sigma_y_range, rotation_range, betap_range, noise_range=None, isotropic=True)
    elif kernel_type == 'plateau_aniso':
        kernel = random_bivariate_plateau(
            kernel_size, sigma_x_range, sigma_y_range, rotation_range, betap_range, noise_range=None, isotropic=False)
    return kernel


np.seterr(divide='ignore', invalid='ignore')


def circular_lowpass_kernel(cutoff, kernel_size, pad_to=0):
    """2D sinc filter, ref: https://dsp.stackexchange.com/questions/58301/2-d-circularly-symmetric-low-pass-filter

    Args:
        cutoff (float): cutoff frequency in radians (pi is max)
        kernel_size (int): horizontal and vertical size, must be odd.
        pad_to (int): pad kernel size to desired size, must be odd or zero.
    """
    assert kernel_size % 2 == 1, 'Kernel size must be an odd number.'
    kernel = np.fromfunction(
        lambda x, y: cutoff * special.j1(cutoff * np.sqrt(
            (x - (kernel_size - 1) / 2)**2 + (y - (kernel_size - 1) / 2)**2)) / (2 * np.pi * np.sqrt(
                (x - (kernel_size - 1) / 2)**2 + (y - (kernel_size - 1) / 2)**2)), [kernel_size, kernel_size])
    kernel[(kernel_size - 1) // 2, (kernel_size - 1) // 2] = cutoff**2 / (4 * np.pi)
    kernel = kernel / np.sum(kernel)
    if pad_to > kernel_size:
        pad_size = (pad_to - kernel_size) // 2
        kernel = np.pad(kernel, ((pad_size, pad_size), (pad_size, pad_size)))
    return kernel


# ------------------------------------------------------------- #
# --------------------------- noise --------------------------- #
# ------------------------------------------------------------- #

# ----------------------- Gaussian Noise ----------------------- #


def generate_gaussian_noise(img, sigma=10, gray_noise=False):
    """Generate Gaussian noise.

    Args:
        img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32.
        sigma (float): Noise scale (measured in range 255). Default: 10.

    Returns:
        (Numpy array): Returned noisy image, shape (h, w, c), range[0, 1],
            float32.
    """
    if gray_noise:
        noise = np.float32(np.random.randn(*(img.shape[0:2]))) * sigma / 255.
        noise = np.expand_dims(noise, axis=2).repeat(3, axis=2)
    else:
        noise = np.float32(np.random.randn(*(img.shape))) * sigma / 255.
    return noise


def add_gaussian_noise(img, sigma=10, clip=True, rounds=False, gray_noise=False):
    """Add Gaussian noise.

    Args:
        img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32.
        sigma (float): Noise scale (measured in range 255). Default: 10.

    Returns:
        (Numpy array): Returned noisy image, shape (h, w, c), range[0, 1],
            float32.
    """
    noise = generate_gaussian_noise(img, sigma, gray_noise)
    out = img + noise
    if clip and rounds:
        out = np.clip((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = np.clip(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


def generate_gaussian_noise_pt(img, sigma=10, gray_noise=0):
    """Add Gaussian noise (PyTorch version).

    Args:
        img (Tensor): Shape (b, c, h, w), range[0, 1], float32.
        scale (float | Tensor): Noise scale. Default: 1.0.

    Returns:
        (Tensor): Returned noisy image, shape (b, c, h, w), range[0, 1],
            float32.
    """
    b, _, h, w = img.size()
    if not isinstance(sigma, (float, int)):
        sigma = sigma.view(img.size(0), 1, 1, 1)
    if isinstance(gray_noise, (float, int)):
        cal_gray_noise = gray_noise > 0
    else:
        gray_noise = gray_noise.view(b, 1, 1, 1)
        cal_gray_noise = torch.sum(gray_noise) > 0

    if cal_gray_noise:
        noise_gray = torch.randn(*img.size()[2:4], dtype=img.dtype, device=img.device) * sigma / 255.
        noise_gray = noise_gray.view(b, 1, h, w)

    # always calculate color noise
    noise = torch.randn(*img.size(), dtype=img.dtype, device=img.device) * sigma / 255.

    if cal_gray_noise:
        noise = noise * (1 - gray_noise) + noise_gray * gray_noise
    return noise


def add_gaussian_noise_pt(img, sigma=10, gray_noise=0, clip=True, rounds=False):
    """Add Gaussian noise (PyTorch version).

    Args:
        img (Tensor): Shape (b, c, h, w), range[0, 1], float32.
        scale (float | Tensor): Noise scale. Default: 1.0.

    Returns:
        (Tensor): Returned noisy image, shape (b, c, h, w), range[0, 1],
            float32.
    """
    noise = generate_gaussian_noise_pt(img, sigma, gray_noise)
    out = img + noise
    if clip and rounds:
        out = torch.clamp((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = torch.clamp(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


# ----------------------- Random Gaussian Noise ----------------------- #
def random_generate_gaussian_noise(img, sigma_range=(0, 10), gray_prob=0):
    sigma = np.random.uniform(sigma_range[0], sigma_range[1])
    if np.random.uniform() < gray_prob:
        gray_noise = True
    else:
        gray_noise = False
    return generate_gaussian_noise(img, sigma, gray_noise)


def random_add_gaussian_noise(img, sigma_range=(0, 1.0), gray_prob=0, clip=True, rounds=False):
    noise = random_generate_gaussian_noise(img, sigma_range, gray_prob)
    out = img + noise
    if clip and rounds:
        out = np.clip((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = np.clip(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


def random_generate_gaussian_noise_pt(img, sigma_range=(0, 10), gray_prob=0):
    sigma = torch.rand(
        img.size(0), dtype=img.dtype, device=img.device) * (sigma_range[1] - sigma_range[0]) + sigma_range[0]
    gray_noise = torch.rand(img.size(0), dtype=img.dtype, device=img.device)
    gray_noise = (gray_noise < gray_prob).float()
    return generate_gaussian_noise_pt(img, sigma, gray_noise)


def random_add_gaussian_noise_pt(img, sigma_range=(0, 1.0), gray_prob=0, clip=True, rounds=False):
    noise = random_generate_gaussian_noise_pt(img, sigma_range, gray_prob)
    out = img + noise
    if clip and rounds:
        out = torch.clamp((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = torch.clamp(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


# ----------------------- Poisson (Shot) Noise ----------------------- #


def generate_poisson_noise(img, scale=1.0, gray_noise=False):
    """Generate poisson noise.

    Ref: https://github.com/scikit-image/scikit-image/blob/main/skimage/util/noise.py#L37-L219

    Args:
        img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32.
        scale (float): Noise scale. Default: 1.0.
        gray_noise (bool): Whether generate gray noise. Default: False.

    Returns:
        (Numpy array): Returned noisy image, shape (h, w, c), range[0, 1],
            float32.
    """
    if gray_noise:
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    # round and clip image for counting vals correctly
    img = np.clip((img * 255.0).round(), 0, 255) / 255.
    vals = len(np.unique(img))
    vals = 2**np.ceil(np.log2(vals))
    out = np.float32(np.random.poisson(img * vals) / float(vals))
    noise = out - img
    if gray_noise:
        noise = np.repeat(noise[:, :, np.newaxis], 3, axis=2)
    return noise * scale


def add_poisson_noise(img, scale=1.0, clip=True, rounds=False, gray_noise=False):
    """Add poisson noise.

    Args:
        img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32.
        scale (float): Noise scale. Default: 1.0.
        gray_noise (bool): Whether generate gray noise. Default: False.

    Returns:
        (Numpy array): Returned noisy image, shape (h, w, c), range[0, 1],
            float32.
    """
    noise = generate_poisson_noise(img, scale, gray_noise)
    out = img + noise
    if clip and rounds:
        out = np.clip((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = np.clip(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


def generate_poisson_noise_pt(img, scale=1.0, gray_noise=0):
    """Generate a batch of poisson noise (PyTorch version)

    Args:
        img (Tensor): Input image, shape (b, c, h, w), range [0, 1], float32.
        scale (float | Tensor): Noise scale. Number or Tensor with shape (b).
            Default: 1.0.
        gray_noise (float | Tensor): 0-1 number or Tensor with shape (b).
            0 for False, 1 for True. Default: 0.

    Returns:
        (Tensor): Returned noisy image, shape (b, c, h, w), range[0, 1],
            float32.
    """
    b, _, h, w = img.size()
    if isinstance(gray_noise, (float, int)):
        cal_gray_noise = gray_noise > 0
    else:
        gray_noise = gray_noise.view(b, 1, 1, 1)
        cal_gray_noise = torch.sum(gray_noise) > 0
    if cal_gray_noise:
        img_gray = rgb_to_grayscale(img, num_output_channels=1)
        # round and clip image for counting vals correctly
        img_gray = torch.clamp((img_gray * 255.0).round(), 0, 255) / 255.
        # use for-loop to get the unique values for each sample
        vals_list = [len(torch.unique(img_gray[i, :, :, :])) for i in range(b)]
        vals_list = [2**np.ceil(np.log2(vals)) for vals in vals_list]
        vals = img_gray.new_tensor(vals_list).view(b, 1, 1, 1)
        out = torch.poisson(img_gray * vals) / vals
        noise_gray = out - img_gray
        noise_gray = noise_gray.expand(b, 3, h, w)

    # always calculate color noise
    # round and clip image for counting vals correctly
    img = torch.clamp((img * 255.0).round(), 0, 255) / 255.
    # use for-loop to get the unique values for each sample
    vals_list = [len(torch.unique(img[i, :, :, :])) for i in range(b)]
    vals_list = [2**np.ceil(np.log2(vals)) for vals in vals_list]
    vals = img.new_tensor(vals_list).view(b, 1, 1, 1)
    out = torch.poisson(img * vals) / vals
    noise = out - img
    if cal_gray_noise:
        noise = noise * (1 - gray_noise) + noise_gray * gray_noise
    if not isinstance(scale, (float, int)):
        scale = scale.view(b, 1, 1, 1)
    return noise * scale


def add_poisson_noise_pt(img, scale=1.0, clip=True, rounds=False, gray_noise=0):
    """Add poisson noise to a batch of images (PyTorch version).

    Args:
        img (Tensor): Input image, shape (b, c, h, w), range [0, 1], float32.
        scale (float | Tensor): Noise scale. Number or Tensor with shape (b).
            Default: 1.0.
        gray_noise (float | Tensor): 0-1 number or Tensor with shape (b).
            0 for False, 1 for True. Default: 0.

    Returns:
        (Tensor): Returned noisy image, shape (b, c, h, w), range[0, 1],
            float32.
    """
    noise = generate_poisson_noise_pt(img, scale, gray_noise)
    out = img + noise
    if clip and rounds:
        out = torch.clamp((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = torch.clamp(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


# ----------------------- Random Poisson (Shot) Noise ----------------------- #


def random_generate_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0):
    scale = np.random.uniform(scale_range[0], scale_range[1])
    if np.random.uniform() < gray_prob:
        gray_noise = True
    else:
        gray_noise = False
    return generate_poisson_noise(img, scale, gray_noise)


def random_add_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0, clip=True, rounds=False):
    noise = random_generate_poisson_noise(img, scale_range, gray_prob)
    out = img + noise
    if clip and rounds:
        out = np.clip((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = np.clip(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


def random_generate_poisson_noise_pt(img, scale_range=(0, 1.0), gray_prob=0):
    scale = torch.rand(
        img.size(0), dtype=img.dtype, device=img.device) * (scale_range[1] - scale_range[0]) + scale_range[0]
    gray_noise = torch.rand(img.size(0), dtype=img.dtype, device=img.device)
    gray_noise = (gray_noise < gray_prob).float()
    return generate_poisson_noise_pt(img, scale, gray_noise)


def random_add_poisson_noise_pt(img, scale_range=(0, 1.0), gray_prob=0, clip=True, rounds=False):
    noise = random_generate_poisson_noise_pt(img, scale_range, gray_prob)
    out = img + noise
    if clip and rounds:
        out = torch.clamp((out * 255.0).round(), 0, 255) / 255.
    elif clip:
        out = torch.clamp(out, 0, 1)
    elif rounds:
        out = (out * 255.0).round() / 255.
    return out


# ------------------------------------------------------------------------ #
# --------------------------- JPEG compression --------------------------- #
# ------------------------------------------------------------------------ #


def add_jpg_compression(img, quality=90):
    """Add JPG compression artifacts.

    Args:
        img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32.
        quality (float): JPG compression quality. 0 for lowest quality, 100 for
            best quality. Default: 90.

    Returns:
        (Numpy array): Returned image after JPG, shape (h, w, c), range[0, 1],
            float32.
    """
    img = np.clip(img, 0, 1)
    encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), quality]
    _, encimg = cv2.imencode('.jpg', img * 255., encode_param)
    img = np.float32(cv2.imdecode(encimg, 1)) / 255.
    return img


def random_add_jpg_compression(img, quality_range=(90, 100)):
    """Randomly add JPG compression artifacts.

    Args:
        img (Numpy array): Input image, shape (h, w, c), range [0, 1], float32.
        quality_range (tuple[float] | list[float]): JPG compression quality
            range. 0 for lowest quality, 100 for best quality.
            Default: (90, 100).

    Returns:
        (Numpy array): Returned image after JPG, shape (h, w, c), range[0, 1],
            float32.
    """
    quality = np.random.uniform(quality_range[0], quality_range[1])
    return add_jpg_compression(img, quality)


================================================
FILE: basicsr/data/ffhq_dataset.py
================================================
import random
import time
from os import path as osp
from torch.utils import data as data
from torchvision.transforms.functional import normalize

from basicsr.data.transforms import augment
from basicsr.utils import FileClient, get_root_logger, imfrombytes, img2tensor
from basicsr.utils.registry import DATASET_REGISTRY


@DATASET_REGISTRY.register()
class FFHQDataset(data.Dataset):
    """FFHQ dataset for StyleGAN.

    Args:
        opt (dict): Config for train datasets. It contains the following keys:
            dataroot_gt (str): Data root path for gt.
            io_backend (dict): IO backend type and other kwarg.
            mean (list | tuple): Image mean.
            std (list | tuple): Image std.
            use_hflip (bool): Whether to horizontally flip.

    """

    def __init__(self, opt):
        super(FFHQDataset, self).__init__()
        self.opt = opt
        # file client (io backend)
        self.file_client = None
        self.io_backend_opt = opt['io_backend']

        self.gt_folder = opt['dataroot_gt']
        self.mean = opt['mean']
        self.std = opt['std']

        if self.io_backend_opt['type'] == 'lmdb':
            self.io_backend_opt['db_paths'] = self.gt_folder
            if not self.gt_folder.endswith('.lmdb'):
                raise ValueError("'dataroot_gt' should end with '.lmdb', " f'but received {self.gt_folder}')
            with open(osp.join(self.gt_folder, 'meta_info.txt')) as fin:
                self.paths = [line.split('.')[0] for line in fin]
        else:
            # FFHQ has 70000 images in total
            self.paths = [osp.join(self.gt_folder, f'{v:08d}.png') for v in range(70000)]

    def __getitem__(self, index):
        if self.file_client is None:
            self.file_client = FileClient(self.io_backend_opt.pop('type'), **self.io_backend_opt)

        # load gt image
        gt_path = self.paths[index]
        # avoid errors caused by high latency in reading files
        retry = 3
        while retry > 0:
            try:
                img_bytes = self.file_client.get(gt_path)
            except Exception as e:
                logger = get_root_logger()
                logger.warning(f'File client error: {e}, remaining retry times: {retry - 1}')
                # change another file to read
                index = random.randint(0, self.__len__())
                gt_path = self.paths[index]
                time.sleep(1)  # sleep 1s for occasional server congestion
            else:
                break
            finally:
                retry -= 1
        img_gt = imfrombytes(img_bytes, float32=True)

        # random horizontal flip
        img_gt = augment(img_gt, hflip=self.opt['use_hflip'], rotation=False)
        # BGR to RGB, HWC to CHW, numpy to tensor
        img_gt = img2tensor(img_gt, bgr2rgb=True, float32=True)
        # normalize
        normalize(img_gt, self.mean, self.std, inplace=True)
        return {'gt': img_gt, 'gt_path': gt_path}

    def __len__(self):
        return len(self.paths)


================================================
FILE: basicsr/data/meta_info/meta_info_DIV2K800sub_GT.txt
================================================
0001_s001.png (480,480,3)
0001_s002.png (480,480,3)
0001_s003.png (480,480,3)
0001_s004.png (480,480,3)
0001_s005.png (480,480,3)
0001_s006.png (480,480,3)
0001_s007.png (480,480,3)
0001_s008.png (480,480,3)
0001_s009.png (480,480,3)
0001_s010.png (480,480,3)
0001_s011.png (480,480,3)
0001_s012.png (480,480,3)
0001_s013.png (480,480,3)
0001_s014.png (480,480,3)
0001_s015.png (480,480,3)
0001_s016.png (480,480,3)
0001_s017.png (480,480,3)
0001_s018.png (480,480,3)
0001_s019.png (480,480,3)
0001_s020.png (480,480,3)
0001_s021.png (480,480,3)
0001_s022.png (480,480,3)
0001_s023.png (480,480,3)
0001_s024.png (480,480,3)
0001_s025.png (480,480,3)
0001_s026.png (480,480,3)
0001_s027.png (480,480,3)
0001_s028.png (480,480,3)
0001_s029.png (480,480,3)
0001_s030.png (480,480,3)
0001_s031.png (480,480,3)
0001_s032.png (480,480,3)
0001_s033.png (480,480,3)
0001_s034.png (480,480,3)
0001_s035.png (480,480,3)
0001_s036.png (480,480,3)
0001_s037.png (480,480,3)
0001_s038.png (480,480,3)
0001_s039.png (480,480,3)
0001_s040.png (480,480,3)
0002_s001.png (480,480,3)
0002_s002.png (480,480,3)
0002_s003.png (480,480,3)
0002_s004.png (480,480,3)
0002_s005.png (480,480,3)
0002_s006.png (480,480,3)
0002_s007.png (480,480,3)
0002_s008.png (480,480,3)
0002_s009.png (480,480,3)
0002_s010.png (480,480,3)
0002_s011.png (480,480,3)
0002_s012.png (480,480,3)
0002_s013.png (480,480,3)
0002_s014.png (480,480,3)
0002_s015.png (480,480,3)
0002_s016.png (480,480,3)
0002_s017.png (480,480,3)
0002_s018.png (480,480,3)
0002_s019.png (480,480,3)
0002_s020.png (480,480,3)
0002_s021.png (480,480,3)
0002_s022.png (480,480,3)
0002_s023.png (480,480,3)
0002_s024.png (480,480,3)
0002_s025.png (480,480,3)
0002_s026.png (480,480,3)
0002_s027.png (480,480,3)
0002_s028.png (480,480,3)
0002_s029.png (480,480,3)
0002_s030.png (480,480,3)
0002_s031.png (480,480,3)
0002_s032.png (480,480,3)
0002_s033.png (480,480,3)
0002_s034.png (480,480,3)
0002_s035.png (480,480,3)
0002_s036.png (480,480,3)
0002_s037.png (480,480,3)
0002_s038.png (480,480,3)
0002_s039.png (480,480,3)
0002_s040.png (480,480,3)
0002_s041.png (480,480,3)
0002_s042.png (480,480,3)
0002_s043.png (480,480,3)
0002_s044.png (480,480,3)
0002_s045.png (480,480,3)
0002_s046.png (480,480,3)
0002_s047.png (480,480,3)
0002_s048.png (480,480,3)
0002_s049.png (480,480,3)
0002_s050.png (480,480,3)
0002_s051.png (480,480,3)
0002_s052.png (480,480,3)
0002_s053.png (480,480,3)
0002_s054.png (480,480,3)
0002_s055.png (480,480,3)
0002_s056.png (480,480,3)
0003_s001.png (480,480,3)
0003_s002.png (480,480,3)
0003_s003.png (480,480,3)
0003_s004.png (480,480,3)
0003_s005.png (480,480,3)
0003_s006.png (480,480,3)
0003_s007.png (480,480,3)
0003_s008.png (480,480,3)
0003_s009.png (480,480,3)
0003_s010.png (480,480,3)
0003_s011.png (480,480,3)
0003_s012.png (480,480,3)
0003_s013.png (480,480,3)
0003_s014.png (480,480,3)
0003_s015.png (480,480,3)
0003_s016.png (480,480,3)
0003_s017.png (480,480,3)
0003_s018.png (480,480,3)
0003_s019.png (480,480,3)
0003_s020.png (480,480,3)
0003_s021.png (480,480,3)
0003_s022.png (480,480,3)
0003_s023.png (480,480,3)
0003_s024.png (480,480,3)
0003_s025.png (480,480,3)
0003_s026.png (480,480,3)
0003_s027.png (480,480,3)
0003_s028.png (480,480,3)
0003_s029.png (480,480,3)
0003_s030.png (480,480,3)
0003_s031.png (480,480,3)
0003_s032.png (480,480,3)
0003_s033.png (480,480,3)
0003_s034.png (480,480,3)
0003_s035.png (480,480,3)
0003_s036.png (480,480,3)
0003_s037.png (480,480,3)
0003_s038.png (480,480,3)
0003_s039.png (480,480,3)
0003_s040.png (480,480,3)
0004_s001.png (480,480,3)
0004_s002.png (480,480,3)
0004_s003.png (480,480,3)
0004_s004.png (480,480,3)
0004_s005.png (480,480,3)
0004_s006.png (480,480,3)
0004_s007.png (480,480,3)
0004_s008.png (480,480,3)
0004_s009.png (480,480,3)
0004_s010.png (480,480,3)
0004_s011.png (480,480,3)
0004_s012.png (480,480,3)
0004_s013.png (480,480,3)
0004_s014.png (480,480,3)
0004_s015.png (480,480,3)
0004_s016.png (480,480,3)
0004_s017.png (480,480,3)
0004_s018.png (480,480,3)
0004_s019.png (480,480,3)
0004_s020.png (480,480,3)
0004_s021.png (480,480,3)
0004_s022.png (480,480,3)
0004_s023.png (480,480,3)
0004_s024.png (480,480,3)
0004_s025.png (480,480,3)
0004_s026.png (480,480,3)
0004_s027.png (480,480,3)
0004_s028.png (480,480,3)
0004_s029.png (480,480,3)
0004_s030.png (480,480,3)
0004_s031.png (480,480,3)
0004_s032.png (480,480,3)
0004_s033.png (480,480,3)
0004_s034.png (480,480,3)
0004_s035.png (480,480,3)
0004_s036.png (480,480,3)
0004_s037.png (480,480,3)
0004_s038.png (480,480,3)
0004_s039.png (480,480,3)
0004_s040.png (480,480,3)
0005_s001.png (480,480,3)
0005_s002.png (480,480,3)
0005_s003.png (480,480,3)
0005_s004.png (480,480,3)
0005_s005.png (480,480,3)
0005_s006.png (480,480,3)
0005_s007.png (480,480,3)
0005_s008.png (480,480,3)
0005_s009.png (480,480,3)
0005_s010.png (480,480,3)
0005_s011.png (480,480,3)
0005_s012.png (480,480,3)
0005_s013.png (480,480,3)
0005_s014.png (480,480,3)
0005_s015.png (480,480,3)
0005_s016.png (480,480,3)
0005_s017.png (480,480,3)
0005_s018.png (480,480,3)
0005_s019.png (480,480,3)
0005_s020.png (480,480,3)
0005_s021.png (480,480,3)
0005_s022.png (480,480,3)
0005_s023.png (480,480,3)
0005_s024.png (480,480,3)
0005_s025.png (480,480,3)
0005_s026.png (480,480,3)
0005_s027.png (480,480,3)
0005_s028.png (480,480,3)
0005_s029.png (480,480,3)
0005_s030.png (480,480,3)
0005_s031.png (480,480,3)
0005_s032.png (480,480,3)
0005_s033.png (480,480,3)
0005_s034.png (480,480,3)
0005_s035.png (480,480,3)
0005_s036.png (480,480,3)
0005_s037.png (480,480,3)
0005_s038.png (480,480,3)
0005_s039.png (480,480,3)
0005_s040.png (480,480,3)
0005_s041.png (480,480,3)
0005_s042.png (480,480,3)
0005_s043.png (480,480,3)
0005_s044.png (480,480,3)
0005_s045.png (480,480,3)
0005_s046.png (480,480,3)
0005_s047.png (480,480,3)
0005_s048.png (480,480,3)
0006_s001.png (480,480,3)
0006_s002.png (480,480,3)
0006_s003.png (480,480,3)
0006_s004.png (480,480,3)
0006_s005.png (480,480,3)
0006_s006.png (480,480,3)
0006_s007.png (480,480,3)
0006_s008.png (480,480,3)
0006_s009.png (480,480,3)
0006_s010.png (480,480,3)
0006_s011.png (480,480,3)
0006_s012.png (480,480,3)
0006_s013.png (480,480,3)
0006_s014.png (480,480,3)
0006_s015.png (480,480,3)
0006_s016.png (480,480,3)
0006_s017.png (480,480,3)
0006_s018.png (480,480,3)
0006_s019.png (480,480,3)
0006_s020.png (480,480,3)
0006_s021.png (480,480,3)
0006_s022.png (480,480,3)
0006_s023.png (480,480,3)
0006_s024.png (480,480,3)
0006_s025.png (480,480,3)
0006_s026.png (480,480,3)
0006_s027.png (480,480,3)
0006_s028.png (480,480,3)
0006_s029.png (480,480,3)
0006_s030.png (480,480,3)
0006_s031.png (480,480,3)
0006_s032.png (480,480,3)
0006_s033.png (480,480,3)
0006_s034.png (480,480,3)
0006_s035.png (480,480,3)
0006_s036.png (480,480,3)
0006_s037.png (480,480,3)
0006_s038.png (480,480,3)
0006_s039.png (480,480,3)
0006_s040.png (480,480,3)
0007_s001.png (480,480,3)
0007_s002.png (480,480,3)
0007_s003.png (480,480,3)
0007_s004.png (480,480,3)
0007_s005.png (480,480,3)
0007_s006.png (480,480,3)
0007_s007.png (480,480,3)
0007_s008.png (480,480,3)
0007_s009.png (480,480,3)
0007_s010.png (480,480,3)
0007_s011.png (480,480,3)
0007_s012.png (480,480,3)
0007_s013.png (480,480,3)
0007_s014.png (480,480,3)
0007_s015.png (480,480,3)
0007_s016.png (480,480,3)
0007_s017.png (480,480,3)
0007_s018.png (480,480,3)
0007_s019.png (480,480,3)
0007_s020.png (480,480,3)
0007_s021.png (480,480,3)
0007_s022.png (480,480,3)
0007_s023.png (480,480,3)
0007_s024.png (480,480,3)
0007_s025.png (480,480,3)
0007_s026.png (480,480,3)
0007_s027.png (480,480,3)
0007_s028.png (480,480,3)
0007_s029.png (480,480,3)
0007_s030.png (480,480,3)
0007_s031.png (480,480,3)
0007_s032.png (480,480,3)
0007_s033.png (480,480,3)
0007_s034.png (480,480,3)
0007_s035.png (480,480,3)
0007_s036.png (480,480,3)
0007_s037.png (480,480,3)
0007_s038.png (480,480,3)
0007_s039.png (480,480,3)
0007_s040.png (480,480,3)
0008_s001.png (480,480,3)
0008_s002.png (480,480,3)
0008_s003.png (480,480,3)
0008_s004.png (480,480,3)
0008_s005.png (480,480,3)
0008_s006.png (480,480,3)
0008_s007.png (480,480,3)
0008_s008.png (480,480,3)
0008_s009.png (480,480,3)
0008_s010.png (480,480,3)
0008_s011.png (480,480,3)
0008_s012.png (480,480,3)
0008_s013.png (480,480,3)
0008_s014.png (480,480,3)
0008_s015.png (480,480,3)
0008_s016.png (480,480,3)
0008_s017.png (480,480,3)
0008_s018.png (480,480,3)
0008_s019.png (480,480,3)
0008_s020.png (480,480,3)
0008_s021.png (480,480,3)
0008_s022.png (480,480,3)
0008_s023.png (480,480,3)
0008_s024.png (480,480,3)
0008_s025.png (480,480,3)
0008_s026.png (480,480,3)
0008_s027.png (480,480,3)
0008_s028.png (480,480,3)
0008_s029.png (480,480,3)
0008_s030.png (480,480,3)
0008_s031.png (480,480,3)
0008_s032.png (480,480,3)
0008_s033.png (480,480,3)
0008_s034.png (480,480,3)
0008_s035.png (480,480,3)
0008_s036.png (480,480,3)
0008_s037.png (480,480,3)
0008_s038.png (480,480,3)
0008_s039.png (480,480,3)
0008_s040.png (480,480,3)
0009_s001.png (480,480,3)
0009_s002.png (480,480,3)
0009_s003.png (480,480,3)
0009_s004.png (480,480,3)
0009_s005.png (480,480,3)
0009_s006.png (480,480,3)
0009_s007.png (480,480,3)
0009_s008.png (480,480,3)
0009_s009.png (480,480,3)
0009_s010.png (480,480,3)
0009_s011.png (480,480,3)
0009_s012.png (480,480,3)
0009_s013.png (480,480,3)
0009_s014.png (480,480,3)
0009_s015.png (480,480,3)
0009_s016.png (480,480,3)
0009_s017.png (480,480,3)
0009_s018.png (480,480,3)
0009_s019.png (480,480,3)
0009_s020.png (480,480,3)
0009_s021.png (480,480,3)
0009_s022.png (480,480,3)
0009_s023.png (480,480,3)
0009_s024.png (480,480,3)
0009_s025.png (480,480,3)
0009_s026.png (480,480,3)
0009_s027.png (480,480,3)
0009_s028.png (480,480,3)
0009_s029.png (480,480,3)
0009_s030.png (480,480,3)
0009_s031.png (480,480,3)
0009_s032.png (480,480,3)
0009_s033.png (480,480,3)
0009_s034.png (480,480,3)
0009_s035.png (480,480,3)
0009_s036.png (480,480,3)
0009_s037.png (480,480,3)
0009_s038.png (480,480,3)
0009_s039.png (480,480,3)
0009_s040.png (480,480,3)
0009_s041.png (480,480,3)
0009_s042.png (480,480,3)
0009_s043.png (480,480,3)
0009_s044.png (480,480,3)
0009_s045.png (480,480,3)
0009_s046.png (480,480,3)
0009_s047.png (480,480,3)
0009_s048.png (480,480,3)
0010_s001.png (480,480,3)
0010_s002.png (480,480,3)
0010_s003.png (480,480,3)
0010_s004.png (480,480,3)
0010_s005.png (480,480,3)
0010_s006.png (480,480,3)
0010_s007.png (480,480,3)
0010_s008.png (480,480,3)
0010_s009.png (480,480,3)
0010_s010.png (480,480,3)
0010_s011.png (480,480,3)
0010_s012.png (480,480,3)
0010_s013.png (480,480,3)
0010_s014.png (480,480,3)
0010_s015.png (480,480,3)
0010_s016.png (480,480,3)
0010_s017.png (480,480,3)
0010_s018.png (480,480,3)
0010_s019.png (480,480,3)
0010_s020.png (480,480,3)
0010_s021.png (480,480,3)
0010_s022.png (480,480,3)
0010_s023.png (480,480,3)
0010_s024.png (480,480,3)
0010_s025.png (480,480,3)
0010_s026.png (480,480,3)
0010_s027.png (480,480,3)
0010_s028.png (480,480,3)
0010_s029.png (480,480,3)
0010_s030.png (480,480,3)
0010_s031.png (480,480,3)
0010_s032.png (480,480,3)
0010_s033.png (480,480,3)
0010_s034.png (480,480,3)
0010_s035.png (480,480,3)
0010_s036.png (480,480,3)
0010_s037.png (480,480,3)
0010_s038.png (480,480,3)
0010_s039.png (480,480,3)
0010_s040.png (480,480,3)
0010_s041.png (480,480,3)
0010_s042.png (480,480,3)
0010_s043.png (480,480,3)
0010_s044.png (480,480,3)
0010_s045.png (480,480,3)
0010_s046.png (480,480,3)
0010_s047.png (480,480,3)
0010_s048.png (480,480,3)
0011_s001.png (480,480,3)
0011_s002.png (480,480,3)
0011_s003.png (480,480,3)
0011_s004.png (480,480,3)
0011_s005.png (480,480,3)
0011_s006.png (480,480,3)
0011_s007.png (480,480,3)
0011_s008.png (480,480,3)
0011_s009.png (480,480,3)
0011_s010.png (480,480,3)
0011_s011.png (480,480,3)
0011_s012.png (480,480,3)
0011_s013.png (480,480,3)
0011_s014.png (480,480,3)
0011_s015.png (480,480,3)
0011_s016.png (480,480,3)
0011_s017.png (480,480,3)
0011_s018.png (480,480,3)
0011_s019.png (480,480,3)
0011_s020.png (480,480,3)
0011_s021.png (480,480,3)
0011_s022.png (480,480,3)
0011_s023.png (480,480,3)
0011_s024.png (480,480,3)
0011_s025.png (480,480,3)
0011_s026.png (480,480,3)
0011_s027.png (480,480,3)
0011_s028.png (480,480,3)
0011_s029.png (480,480,3)
0011_s030.png (480,480,3)
0011_s031.png (480,480,3)
0011_s032.png (480,480,3)
0011_s033.png (480,480,3)
0011_s034.png (480,480,3)
0011_s035.png (480,480,3)
0011_s036.png (480,480,3)
0011_s037.png (480,480,3)
0011_s038.png (480,480,3)
0011_s039.png (480,480,3)
0011_s040.png (480,480,3)
0012_s001.png (480,480,3)
0012_s002.png (480,480,3)
0012_s003.png (480,480,3)
0012_s004.png (480,480,3)
0012_s005.png (480,480,3)
0012_s006.png (480,480,3)
0012_s007.png (480,480,3)
0012_s008.png (480,480,3)
0012_s009.png (480,480,3)
0012_s010.png (480,480,3)
0012_s011.png (480,480,3)
0012_s012.png (480,480,3)
0012_s013.png (480,480,3)
0012_s014.png (480,480,3)
0012_s015.png (480,480,3)
0012_s016.png (480,480,3)
0012_s017.png (480,480,3)
0012_s018.png (480,480,3)
0012_s019.png (480,480,3)
0012_s020.png (480,480,3)
0012_s021.png (480,480,3)
0012_s022.png (480,480,3)
0012_s023.png (480,480,3)
0012_s024.png (480,480,3)
0012_s025.png (480,480,3)
0012_s026.png (480,480,3)
0012_s027.png (480,480,3)
0012_s028.png (480,480,3)
0012_s029.png (480,480,3)
0012_s030.png (480,480,3)
0012_s031.png (480,480,3)
0012_s032.png (480,480,3)
0012_s033.png (480,480,3)
0012_s034.png (480,480,3)
0012_s035.png (480,480,3)
0012_s036.png (480,480,3)
0012_s037.png (480,480,3)
0012_s038.png (480,480,3)
0012_s039.png (480,480,3)
0012_s040.png (480,480,3)
0013_s001.png (480,480,3)
0013_s002.png (480,480,3)
0013_s003.png (480,480,3)
0013_s004.png (480,480,3)
0013_s005.png (480,480,3)
0013_s006.png (480,480,3)
0013_s007.png (480,480,3)
0013_s008.png (480,480,3)
0013_s009.png (480,480,3)
0013_s010.png (480,480,3)
0013_s011.png (480,480,3)
0013_s012.png (480,480,3)
0013_s013.png (480,480,3)
0013_s014.png (480,480,3)
0013_s015.png (480,480,3)
0013_s016.png (480,480,3)
0013_s017.png (480,480,3)
0013_s018.png (480,480,3)
0013_s019.png (480,480,3)
0013_s020.png (480,480,3)
0013_s021.png (480,480,3)
0013_s022.png (480,480,3)
0013_s023.png (480,480,3)
0013_s024.png (480,480,3)
0013_s025.png (480,480,3)
0013_s026.png (480,480,3)
0013_s027.png (480,480,3)
0013_s028.png (480,480,3)
0013_s029.png (480,480,3)
0013_s030.png (480,480,3)
0013_s031.png (480,480,3)
0013_s032.png (480,480,3)
0013_s033.png (480,480,3)
0013_s034.png (480,480,3)
0013_s035.png (480,480,3)
0013_s036.png (480,480,3)
0013_s037.png (480,480,3)
0013_s038.png (480,480,3)
0013_s039.png (480,480,3)
0013_s040.png (480,480,3)
0014_s001.png (480,480,3)
0014_s002.png (480,480,3)
0014_s003.png (480,480,3)
0014_s004.png (480,480,3)
0014_s005.png (480,480,3)
0014_s006.png (480,480,3)
0014_s007.png (480,480,3)
0014_s008.png (480,480,3)
0014_s009.png (480,480,3)
0014_s010.png (480,480,3)
0014_s011.png (480,480,3)
0014_s012.png (480,480,3)
0014_s013.png (480,480,3)
0014_s014.png (480,480,3)
0014_s015.png (480,480,3)
0014_s016.png (480,480,3)
0014_s017.png (480,480,3)
0014_s018.png (480,480,3)
0014_s019.png (480,480,3)
0014_s020.png (480,480,3)
0014_s021.png (480,480,3)
0014_s022.png (480,480,3)
0014_s023.png (480,480,3)
0014_s024.png (480,480,3)
0014_s025.png (480,480,3)
0014_s026.png (480,480,3)
0014_s027.png (480,480,3)
0014_s028.png (480,480,3)
0014_s029.png (480,480,3)
0014_s030.png (480,480,3)
0014_s031.png (480,480,3)
0014_s032.png (480,480,3)
0014_s033.png (480,480,3)
0014_s034.png (480,480,3)
0014_s035.png (480,480,3)
0014_s036.png (480,480,3)
0014_s037.png (480,480,3)
0014_s038.png (480,480,3)
0014_s039.png (480,480,3)
0014_s040.png (480,480,3)
0015_s001.png (480,480,3)
0015_s002.png (480,480,3)
0015_s003.png (480,480,3)
0015_s004.png (480,480,3)
0015_s005.png (480,480,3)
0015_s006.png (480,480,3)
0015_s007.png (480,480,3)
0015_s008.png (480,480,3)
0015_s009.png (480,480,3)
0015_s010.png (480,480,3)
0015_s011.png (480,480,3)
0015_s012.png (480,480,3)
0015_s013.png (480,480,3)
0015_s014.png (480,480,3)
0015_s015.png (480,480,3)
0015_s016.png (480,480,3)
0015_s017.png (480,480,3)
0015_s018.png (480,480,3)
0015_s019.png (480,480,3)
0015_s020.png (480,480,3)
0015_s021.png (480,480,3)
0015_s022.png (480,480,3)
0015_s023.png (480,480,3)
0015_s024.png (480,480,3)
0015_s025.png (480,480,3)
0015_s026.png (480,480,3)
0015_s027.png (480,480,3)
0015_s028.png (480,480,3)
0015_s029.png (480,480,3)
0015_s030.png (480,480,3)
0015_s031.png (480,480,3)
0015_s032.png (480,480,3)
0015_s033.png (480,480,3)
0015_s034.png (480,480,3)
0015_s035.png (480,480,3)
0015_s036.png (480,480,3)
0015_s037.png (480,480,3)
0015_s038.png (480,480,3)
0015_s039.png (480,480,3)
0015_s040.png (480,480,3)
0016_s001.png (480,480,3)
0016_s002.png (480,480,3)
0016_s003.png (480,480,3)
0016_s004.png (480,480,3)
0016_s005.png (480,480,3)
0016_s006.png (480,480,3)
0016_s007.png (480,480,3)
0016_s008.png (480,480,3)
0016_s009.png (480,480,3)
0016_s010.png (480,480,3)
0016_s011.png (480,480,3)
0016_s012.png (480,480,3)
0016_s013.png (480,480,3)
0016_s014.png (480,480,3)
0016_s015.png (480,480,3)
0016_s016.png (480,480,3)
0016_s017.png (480,480,3)
0016_s018.png (480,480,3)
0016_s019.png (480,480,3)
0016_s020.png (480,480,3)
0016_s021.png (480,480,3)
0016_s022.png (480,480,3)
0016_s023.png (480,480,3)
0016_s024.png (480,480,3)
0016_s025.png (480,480,3)
0016_s026.png (480,480,3)
0016_s027.png (480,480,3)
0016_s028.png (480,480,3)
0016_s029.png (480,480,3)
0016_s030.png (480,480,3)
0016_s031.png (480,480,3)
0016_s032.png (480,480,3)
0016_s033.png (480,480,3)
0016_s034.png (480,480,3)
0016_s035.png (480,480,3)
0016_s036.png (480,480,3)
0016_s037.png (480,480,3)
0016_s038.png (480,480,3)
0016_s039.png (480,480,3)
0016_s040.png (480,480,3)
0017_s001.png (480,480,3)
0017_s002.png (480,480,3)
0017_s003.png (480,480,3)
0017_s004.png (480,480,3)
0017_s005.png (480,480,3)
0017_s006.png (480,480,3)
0017_s007.png (480,480,3)
0017_s008.png (480,480,3)
0017_s009.png (480,480,3)
0017_s010.png (480,480,3)
0017_s011.png (480,480,3)
0017_s012.png (480,480,3)
0017_s013.png (480,480,3)
0017_s014.png (480,480,3)
0017_s015.png (480,480,3)
0017_s016.png (480,480,3)
0017_s017.png (480,480,3)
0017_s018.png (480,480,3)
0017_s019.png (480,480,3)
0017_s020.png (480,480,3)
0017_s021.png (480,480,3)
0017_s022.png (480,480,3)
0017_s023.png (480,480,3)
0017_s024.png (480,480,3)
0017_s025.png (480,480,3)
0017_s026.png (480,480,3)
0017_s027.png (480,480,3)
0017_s028.png (480,480,3)
0017_s029.png (480,480,3)
0017_s030.png (480,480,3)
0017_s031.png (480,480,3)
0017_s032.png (480,480,3)
0017_s033.png (480,480,3)
0017_s034.png (480,480,3)
0017_s035.png (480,480,3)
0017_s036.png (480,480,3)
0017_s037.png (480,480,3)
0017_s038.png (480,480,3)
0017_s039.png (480,480,3)
0017_s040.png (480,480,3)
0018_s001.png (480,480,3)
0018_s002.png (480,480,3)
0018_s003.png (480,480,3)
0018_s004.png (480,480,3)
0018_s005.png (480,480,3)
0018_s006.png (480,480,3)
0018_s007.png (480,480,3)
0018_s008.png (480,480,3)
0018_s009.png (480,480,3)
0018_s010.png (480,480,3)
0018_s011.png (480,480,3)
0018_s012.png (480,480,3)
0018_s013.png (480,480,3)
0018_s014.png (480,480,3)
0018_s015.png (480,480,3)
0018_s016.png (480,480,3)
0018_s017.png (480,480,3)
0018_s018.png (480,480,3)
0018_s019.png (480,480,3)
0018_s020.png (480,480,3)
0018_s021.png (480,480,3)
0018_s022.png (480,480,3)
0018_s023.png (480,480,3)
0018_s024.png (480,480,3)
0018_s025.png (480,480,3)
0018_s026.png (480,480,3)
0018_s027.png (480,480,3)
0018_s028.png (480,480,3)
0018_s029.png (480,480,3)
0018_s030.png (480,480,3)
0018_s031.png (480,480,3)
0018_s032.png (480,480,3)
0018_s033.png (480,480,3)
0018_s034.png (480,480,3)
0018_s035.png (480,480,3)
0018_s036.png (480,480,3)
0018_s037.png (480,480,3)
0018_s038.png (480,480,3)
0018_s039.png (480,480,3)
0018_s040.png (480,480,3)
0019_s001.png (480,480,3)
0019_s002.png (480,480,3)
0019_s003.png (480,480,3)
0019_s004.png (480,480,3)
0019_s005.png (480,480,3)
0019_s006.png (480,480,3)
0019_s007.png (480,480,3)
0019_s008.png (480,480,3)
0019_s009.png (480,480,3)
0019_s010.png (480,480,3)
0019_s011.png (480,480,3)
0019_s012.png (480,480,3)
0019_s013.png (480,480,3)
0019_s014.png (480,480,3)
0019_s015.png (480,480,3)
0019_s016.png (480,480,3)
0019_s017.png (480,480,3)
0019_s018.png (480,480,3)
0019_s019.png (480,480,3)
0019_s020.png (480,480,3)
0019_s021.png (480,480,3)
0019_s022.png (480,480,3)
0019_s023.png (480,480,3)
0019_s024.png (480,480,3)
0019_s025.png (480,480,3)
0019_s026.png (480,480,3)
0019_s027.png (480,480,3)
0019_s028.png (480,480,3)
0019_s029.png (480,480,3)
0019_s030.png (480,480,3)
0019_s031.png (480,480,3)
0019_s032.png (480,480,3)
0019_s033.png (480,480,3)
0019_s034.png (480,480,3)
0019_s035.png (480,480,3)
0019_s036.png (480,480,3)
0019_s037.png (480,480,3)
0019_s038.png (480,480,3)
0019_s039.png (480,480,3)
0019_s040.png (480,480,3)
0019_s041.png (480,480,3)
0019_s042.png (480,480,3)
0019_s043.png (480,480,3)
0019_s044.png (480,480,3)
0019_s045.png (480,480,3)
0019_s046.png (480,480,3)
0019_s047.png (480,480,3)
0019_s048.png (480,480,3)
0020_s001.png (480,480,3)
0020_s002.png (480,480,3)
0020_s003.png (480,480,3)
0020_s004.png (480,480,3)
0020_s005.png (480,480,3)
0020_s006.png (480,480,3)
0020_s007.png (480,480,3)
0020_s008.png (480,480,3)
0020_s009.png (480,480,3)
0020_s010.png (480,480,3)
0020_s011.png (480,480,3)
0020_s012.png (480,480,3)
0020_s013.png (480,480,3)
0020_s014.png (480,480,3)
0020_s015.png (480,480,3)
0020_s016.png (480,480,3)
0020_s017.png (480,480,3)
0020_s018.png (480,480,3)
0020_s019.png (480,480,3)
0020_s020.png (480,480,3)
0020_s021.png (480,480,3)
0020_s022.png (480,480,3)
0020_s023.png (480,480,3)
0020_s024.png (480,480,3)
0020_s025.png (480,480,3)
0020_s026.png (480,480,3)
0020_s027.png (480,480,3)
0020_s028.png (480,480,3)
0020_s029.png (480,480,3)
0020_s030.png (480,480,3)
0020_s031.png (480,480,3)
0020_s032.png (480,480,3)
0020_s033.png (480,480,3)
0020_s034.png (480,480,3)
0020_s035.png (480,480,3)
0020_s036.png (480,480,3)
0020_s037.png (480,480,3)
0020_s038.png (480,480,3)
0020_s039.png (480,480,3)
0020_s040.png (480,480,3)
0021_s001.png (480,480,3)
0021_s002.png (480,480,3)
0021_s003.png (480,480,3)
0021_s004.png (480,480,3)
0021_s005.png (480,480,3)
0021_s006.png (480,480,3)
0021_s007.png (480,480,3)
0021_s008.png (480,480,3)
0021_s009.png (480,480,3)
0021_s010.png (480,480,3)
0021_s011.png (480,480,3)
0021_s012.png (480,480,3)
0021_s013.png (480,480,3)
0021_s014.png (480,480,3)
0021_s015.png (480,480,3)
0021_s016.png (480,480,3)
0021_s017.png (480,480,3)
0021_s018.png (480,480,3)
0021_s019.png (480,480,3)
0021_s020.png (480,480,3)
0021_s021.png (480,480,3)
0021_s022.png (480,480,3)
0021_s023.png (480,480,3)
0021_s024.png (480,480,3)
0022_s001.png (480,480,3)
0022_s002.png (480,480,3)
0022_s003.png (480,480,3)
0022_s004.png (480,480,3)
0022_s005.png (480,480,3)
0022_s006.png (480,480,3)
0022_s007.png (480,480,3)
0022_s008.png (480,480,3)
0022_s009.png (480,480,3)
0022_s010.png (480,480,3)
0022_s011.png (480,480,3)
0022_s012.png (480,480,3)
0022_s013.png (480,480,3)
0022_s014.png (480,480,3)
0022_s015.png (480,480,3)
0022_s016.png (480,480,3)
0022_s017.png (480,480,3)
0022_s018.png (480,480,3)
0022_s019.png (480,480,3)
0022_s020.png (480,480,3)
0022_s021.png (480,480,3)
0022_s022.png (480,480,3)
0022_s023.png (480,480,3)
0022_s024.png (480,480,3)
0023_s001.png (480,480,3)
0023_s002.png (480,480,3)
0023_s003.png (480,480,3)
0023_s004.png (480,480,3)
0023_s005.png (480,480,3)
0023_s006.png (480,480,3)
0023_s007.png (480,480,3)
0023_s008.png (480,480,3)
0023_s009.png (480,480,3)
0023_s010.png (480,480,3)
0023_s011.png (480,480,3)
0023_s012.png (480,480,3)
0023_s013.png (480,480,3)
0023_s014.png (480,480,3)
0023_s015.png (480,480,3)
0023_s016.png (480,480,3)
0023_s017.png (480,480,3)
0023_s018.png (480,480,3)
0023_s019.png (480,480,3)
0023_s020.png (480,480,3)
0023_s021.png (480,480,3)
0023_s022.png (480,480,3)
0023_s023.png (480,480,3)
0023_s024.png (480,480,3)
0023_s025.png (480,480,3)
0023_s026.png (480,480,3)
0023_s027.png (480,480,3)
0023_s028.png (480,480,3)
0023_s029.png (480,480,3)
0023_s030.png (480,480,3)
0023_s031.png (480,480,3)
0023_s032.png (480,480,3)
0023_s033.png (480,480,3)
0023_s034.png (480,480,3)
0023_s035.png (480,480,3)
0023_s036.png (480,480,3)
0023_s037.png (480,480,3)
0023_s038.png (480,480,3)
0023_s039.png (480,480,3)
0023_s040.png (480,480,3)
0024_s001.png (480,480,3)
0024_s002.png (480,480,3)
0024_s003.png (480,480,3)
0024_s004.png (480,480,3)
0024_s005.png (480,480,3)
0024_s006.png (480,480,3)
0024_s007.png (480,480,3)
0024_s008.png (480,480,3)
0024_s009.png (480,480,3)
0024_s010.png (480,480,3)
0024_s011.png (480,480,3)
0024_s012.png (480,480,3)
0024_s013.png (480,480,3)
0024_s014.png (480,480,3)
0024_s015.png (480,480,3)
0024_s016.png (480,480,3)
0024_s017.png (480,480,3)
0024_s018.png (480,480,3)
0024_s019.png (480,480,3)
0024_s020.png (480,480,3)
0024_s021.png (480,480,3)
0024_s022.png (480,480,3)
0024_s023.png (480,480,3)
0024_s024.png (480,480,3)
0024_s025.png (480,480,3)
0024_s026.png (480,480,3)
0024_s027.png (480,480,3)
0024_s028.png (480,480,3)
0024_s029.png (480,480,3)
0024_s030.png (480,480,3)
0024_s031.png (480,480,3)
0024_s032.png (480,480,3)
0024_s033.png (480,480,3)
0024_s034.png (480,480,3)
0024_s035.png (480,480,3)
0024_s036.png (480,480,3)
0024_s037.png (480,480,3)
0024_s038.png (480,480,3)
0024_s039.png (480,480,3)
0024_s040.png (480,480,3)
0025_s001.png (480,480,3)
0025_s002.png (480,480,3)
0025_s003.png (480,480,3)
0025_s004.png (480,480,3)
0025_s005.png (480,480,3)
0025_s006.png (480,480,3)
0025_s007.png (480,480,3)
0025_s008.png (480,480,3)
0025_s009.png (480,480,3)
0025_s010.png (480,480,3)
0025_s011.png (480,480,3)
0025_s012.png (480,480,3)
0025_s013.png (480,480,3)
0025_s014.png (480,480,3)
0025_s015.png (480,480,3)
0025_s016.png (480,480,3)
0025_s017.png (480,480,3)
0025_s018.png (480,480,3)
0025_s019.png (480,480,3)
0025_s020.png (480,480,3)
0025_s021.png (480,480,3)
0025_s022.png (480,480,3)
0025_s023.png (480,480,3)
0025_s024.png (480,480,3)
0025_s025.png (480,480,3)
0025_s026.png (480,480,3)
0025_s027.png (480,480,3)
0025_s028.png (480,480,3)
0025_s029.png (480,480,3)
0025_s030.png (480,480,3)
0025_s031.png (480,480,3)
0025_s032.png (480,480,3)
0026_s001.png (480,480,3)
0026_s002.png (480,480,3)
0026_s003.png (480,480,3)
0026_s004.png (480,480,3)
0026_s005.png (480,480,3)
0026_s006.png (480,480,3)
0026_s007.png (480,480,3)
0026_s008.png (480,480,3)
0026_s009.png (480,480,3)
0026_s010.png (480,480,3)
0026_s011.png (480,480,3)
0026_s012.png (480,480,3)
0026_s013.png (480,480,3)
0026_s014.png (480,480,3)
0026_s015.png (480,480,3)
0026_s016.png (480,480,3)
0026_s017.png (480,480,3)
0026_s018.png (480,480,3)
0026_s019.png (480,480,3)
0026_s020.png (480,480,3)
0026_s021.png (480,480,3)
0026_s022.png (480,480,3)
0026_s023.png (480,480,3)
0026_s024.png (480,480,3)
0026_s025.png (480,480,3)
0026_s026.png (480,480,3)
0026_s027.png (480,480,3)
0026_s028.png (480,480,3)
0026_s029.png (480,480,3)
0026_s030.png (480,480,3)
0026_s031.png (480,480,3)
0026_s032.png (480,480,3)
0026_s033.png (480,480,3)
0026_s034.png (480,480,3)
0026_s035.png (480,480,3)
0026_s036.png (480,480,3)
0026_s037.png (480,480,3)
0026_s038.png (480,480,3)
0026_s039.png (480,480,3)
0026_s040.png (480,480,3)
0026_s041.png (480,480,3)
0026_s042.png (480,480,3)
0026_s043.png (480,480,3)
0026_s044.png (480,480,3)
0026_s045.png (480,480,3)
0026_s046.png (480,480,3)
0026_s047.png (480,480,3)
0026_s048.png (480,480,3)
0027_s001.png (480,480,3)
0027_s002.png (480,480,3)
0027_s003.png (480,480,3)
0027_s004.png (480,480,3)
0027_s005.png (480,480,3)
0027_s006.png (480,480,3)
0027_s007.png (480,480,3)
0027_s008.png (480,480,3)
0027_s009.png (480,480,3)
0027_s010.png (480,480,3)
0027_s011.png (480,480,3)
0027_s012.png (480,480,3)
0027_s013.png (480,480,3)
0027_s014.png (480,480,3)
0027_s015.png (480,480,3)
0027_s016.png (480,480,3)
0027_s017.png (480,480,3)
0027_s018.png (480,480,3)
0027_s019.png (480,480,3)
0027_s020.png (480,480,3)
0027_s021.png (480,480,3)
0027_s022.png (480,480,3)
0027_s023.png (480,480,3)
0027_s024.png (480,480,3)
0027_s025.png (480,480,3)
0027_s026.png (480,480,3)
0027_s027.png (480,480,3)
0027_s028.png (480,480,3)
0027_s029.png (480,480,3)
0027_s030.png (480,480,3)
0027_s031.png (480,480,3)
0027_s032.png (480,480,3)
0027_s033.png (480,480,3)
0027_s034.png (480,480,3)
0027_s035.png (480,480,3)
0027_s036.png (480,480,3)
0027_s037.png (480,480,3)
0027_s038.png (480,480,3)
0027_s039.png (480,480,3)
0027_s040.png (480,480,3)
0027_s041.png (480,480,3)
0027_s042.png (480,480,3)
0027_s043.png (480,480,3)
0027_s044.png (480,480,3)
0027_s045.png (480,480,3)
0027_s046.png (480,480,3)
0027_s047.png (480,480,3)
0027_s048.png (480,480,3)
0028_s001.png (480,480,3)
0028_s002.png (480,480,3)
0028_s003.png (480,480,3)
0028_s004.png (480,480,3)
0028_s005.png (480,480,3)
0028_s006.png (480,480,3)
0028_s007.png (480,480,3)
0028_s008.png (480,480,3)
0028_s009.png (480,480,3)
0028_s010.png (480,480,3)
0028_s011.png (480,480,3)
0028_s012.png (480,480,3)
0028_s013.png (480,480,3)
0028_s014.png (480,480,3)
0028_s015.png (480,480,3)
0028_s016.png (480,480,3)
0028_s017.png (480,480,3)
0028_s018.png (480,480,3)
0028_s019.png (480,480,3)
0028_s020.png (480,480,3)
0028_s021.png (480,480,3)
0028_s022.png (480,480,3)
0028_s023.png (480,480,3)
0028_s024.png (480,480,3)
0028_s025.png (480,480,3)
0028_s026.png (480,480,3)
0028_s027.png (480,480,3)
0028_s028.png (480,480,3)
0028_s029.png (480,480,3)
0028_s030.png (480,480,3)
0028_s031.png (480,480,3)
0028_s032.png (480,480,3)
0028_s033.png (480,480,3)
0028_s034.png (480,480,3)
0028_s035.png (480,480,3)
0028_s036.png (480,480,3)
0028_s037.png (480,480,3)
0028_s038.png (480,480,3)
0028_s039.png (480,480,3)
0028_s040.png (480,480,3)
0028_s041.png (480,480,3)
0028_s042.png (480,480,3)
0028_s043.png (480,480,3)
0028_s044.png (480,480,3)
0028_s045.png (480,480,3)
0028_s046.png (480,480,3)
0028_s047.png (480,480,3)
0028_s048.png (480,480,3)
0028_s049.png (480,480,3)
0028_s050.png (480,480,3)
0028_s051.png (480,480,3)
0028_s052.png (480,480,3)
0028_s053.png (480,480,3)
0028_s054.png (480,480,3)
0028_s055.png (480,480,3)
0028_s056.png (480,480,3)
0028_s057.png (480,480,3)
0028_s058.png (480,480,3)
0028_s059.png (480,480,3)
0028_s060.png (480,480,3)
0028_s061.png (480,480,3)
0028_s062.png (480,480,3)
0028_s063.png (480,480,3)
0028_s064.png (480,480,3)
0029_s001.png (480,480,3)
0029_s002.png (480,480,3)
0029_s003.png (480,480,3)
0029_s004.png (480,480,3)
0029_s005.png (480,480,3)
0029_s006.png (480,480,3)
0029_s007.png (480,480,3)
0029_s008.png (480,480,3)
0029_s009.png (480,480,3)
0029_s010.png (480,480,3)
0029_s011.png (480,480,3)
0029_s012.png (480,480,3)
0029_s013.png (480,480,3)
0029_s014.png (480,480,3)
0029_s015.png (480,480,3)
0029_s016.png (480,480,3)
0029_s017.png (480,480,3)
0029_s018.png (480,480,3)
0029_s019.png (480,480,3)
0029_s020.png (480,480,3)
0029_s021.png (480,480,3)
0029_s022.png (480,480,3)
0029_s023.png (480,480,3)
0029_s024.png (480,480,3)
0029_s025.png (480,480,3)
0029_s026.png (480,480,3)
0029_s027.png (480,480,3)
0029_s028.png (480,480,3)
0029_s029.png (480,480,3)
0029_s030.png (480,480,3)
0029_s031.png (480,480,3)
0029_s032.png (480,480,3)
0029_s033.png (480,480,3)
0029_s034.png (480,480,3)
0029_s035.png (480,480,3)
0029_s036.png (480,480,3)
0029_s037.png (480,480,3)
0029_s038.png (480,480,3)
0029_s039.png (480,480,3)
0029_s040.png (480,480,3)
0030_s001.png (480,480,3)
0030_s002.png (480,480,3)
0030_s003.png (480,480,3)
0030_s004.png (480,480,3)
0030_s005.png (480,480,3)
0030_s006.png (480,480,3)
0030_s007.png (480,480,3)
0030_s008.png (480,480,3)
0030_s009.png (480,480,3)
0030_s010.png (480,480,3)
0030_s011.png (480,480,3)
0030_s012.png (480,480,3)
0030_s013.png (480,480,3)
0030_s014.png (480,480,3)
0030_s015.png (480,480,3)
0030_s016.png (480,480,3)
0030_s017.png (480,480,3)
0030_s018.png (480,480,3)
0030_s019.png (480,480,3)
0030_s020.png (480,480,3)
0030_s021.png (480,480,3)
0030_s022.png (480,480,3)
0030_s023.png (480,480,3)
0030_s024.png (480,480,3)
0030_s025.png (480,480,3)
0030_s026.png (480,480,3)
0030_s027.png (480,480,3)
0030_s028.png (480,480,3)
0030_s029.png (480,480,3)
0030_s030.png (480,480,3)
0030_s031.png (480,480,3)
0030_s032.png (480,480,3)
0030_s033.png (480,480,3)
0030_s034.png (480,480,3)
0030_s035.png (480,480,3)
0030_s036.png (480,480,3)
0030_s037.png (480,480,3)
0030_s038.png (480,480,3)
0030_s039.png (480,480,3)
0030_s040.png (480,480,3)
0031_s001.png (480,480,3)
0031_s002.png (480,480,3)
0031_s003.png (480,480,3)
0031_s004.png (480,480,3)
0031_s005.png (480,480,3)
0031_s006.png (480,480,3)
0031_s007.png (480,480,3)
0031_s008.png (480,480,3)
0031_s009.png (480,480,3)
0031_s010.png (480,480,3)
0031_s011.png (480,480,3)
0031_s012.png (480,480,3)
0031_s013.png (480,480,3)
0031_s014.png (480,480,3)
0031_s015.png (480,480,3)
0031_s016.png (480,480,3)
0031_s017.png (480,480,3)
0031_s018.png (480,480,3)
0031_s019.png (480,480,3)
0031_s020.png (480,480,3)
0031_s021.png (480,480,3)
0031_s022.png (480,480,3)
0031_s023.png (480,480,3)
0031_s024.png (480,480,3)
0031_s025.png (480,480,3)
0031_s026.png (480,480,3)
0031_s027.png (480,480,3)
0031_s028.png (480,480,3)
0031_s029.png (480,480,3)
0031_s030.png (480,480,3)
0031_s031.png (480,480,3)
0031_s032.png (480,480,3)
0031_s033.png (480,480,3)
0031_s034.png (480,480,3)
0031_s035.png (480,480,3)
0031_s036.png (480,480,3)
0031_s037.png (480,480,3)
0031_s038.png (480,480,3)
0031_s039.png (480,480,3)
0031_s040.png (480,480,3)
0032_s001.png (480,480,3)
0032_s002.png (480,480,3)
0032_s003.png (480,480,3)
0032_s004.png (480,480,3)
0032_s005.png (480,480,3)
0032_s006.png (480,480,3)
0032_s007.png (480,480,3)
0032_s008.png (480,480,3)
0032_s009.png (480,480,3)
0032_s010.png (480,480,3)
0032_s011.png (480,480,3)
0032_s012.png (480,480,3)
0032_s013.png (480,480,3)
0032_s014.png (480,480,3)
0032_s015.png (480,480,3)
0032_s016.png (480,480,3)
0032_s017.png (480,480,3)
0032_s018.png (480,480,3)
0032_s019.png (480,480,3)
0032_s020.png (480,480,3)
0032_s021.png (480,480,3)
0032_s022.png (480,480,3)
0032_s023.png (480,480,3)
0032_s024.png (480,480,3)
0032_s025.png (480,480,3)
0032_s026.png (480,480,3)
0032_s027.png (480,480,3)
0032_s028.png (480,480,3)
0032_s029.png (480,480,3)
0032_s030.png (480,480,3)
0032_s031.png (480,480,3)
0032_s032.png (480,480,3)
0032_s033.png (480,480,3)
0032_s034.png (480,480,3)
0032_s035.png (480,480,3)
0032_s036.png (480,480,3)
0032_s037.png (480,480,3)
0032_s038.png (480,480,3)
0032_s039.png (480,480,3)
0032_s040.png (480,480,3)
0033_s001.png (480,480,3)
0033_s002.png (480,480,3)
0033_s003.png (480,480,3)
0033_s004.png (480,480,3)
0033_s005.png (480,480,3)
0033_s006.png (480,480,3)
0033_s007.png (480,480,3)
0033_s008.png (480,480,3)
0033_s009.png (480,480,3)
0033_s010.png (480,480,3)
0033_s011.png (480,480,3)
0033_s012.png (480,480,3)
0033_s013.png (480,480,3)
0033_s014.png (480,480,3)
0033_s015.png (480,480,3)
0033_s016.png (480,480,3)
0033_s017.png (480,480,3)
0033_s018.png (480,480,3)
0033_s019.png (480,480,3)
0033_s020.png (480,480,3)
0033_s021.png (480,480,3)
0033_s022.png (480,480,3)
0033_s023.png (480,480,3)
0033_s024.png (480,480,3)
0033_s025.png (480,480,3)
0033_s026.png (480,480,3)
0033_s027.png (480,480,3)
0033_s028.png (480,480,3)
0033_s029.png (480,480,3)
0033_s030.png (480,480,3)
0033_s031.png (480,480,3)
0033_s032.png (480,480,3)
0033_s033.png (480,480,3)
0033_s034.png (480,480,3)
0033_s035.png (480,480,3)
0033_s036.png (480,480,3)
0033_s037.png (480,480,3)
0033_s038.png (480,480,3)
0033_s039.png (480,480,3)
0033_s040.png (480,480,3)
0034_s001.png (480,480,3)
0034_s002.png (480,480,3)
0034_s003.png (480,480,3)
0034_s004.png (480,480,3)
0034_s005.png (480,480,3)
0034_s006.png (480,480,3)
0034_s007.png (480,480,3)
0034_s008.png (480,480,3)
0034_s009.png (480,480,3)
0034_s010.png (480,480,3)
0034_s011.png (480,480,3)
0034_s012.png (480,480,3)
0034_s013.png (480,480,3)
0034_s014.png (480,480,3)
0034_s015.png (480,480,3)
0034_s016.png (480,480,3)
0034_s017.png (480,480,3)
0034_s018.png (480,480,3)
0034_s019.png (480,480,3)
0034_s020.png (480,480,3)
0034_s021.png (480,480,3)
0034_s022.png (480,480,3)
0034_s023.png (480,480,3)
0034_s024.png (480,480,3)
0034_s025.png (480,480,3)
0034_s026.png (480,480,3)
0034_s027.png (480,480,3)
0034_s028.png (480,480,3)
0034_s029.png (480,480,3)
0034_s030.png (480,480,3)
0034_s031.png (480,480,3)
0034_s032.png (480,480,3)
0034_s033.png (480,480,3)
0034_s034.png (480,480,3)
0034_s035.png (480,480,3)
0034_s036.png (480,480,3)
0034_s037.png (480,480,3)
0034_s038.png (480,480,3)
0034_s039.png (480,480,3)
0034_s040.png (480,480,3)
0035_s001.png (480,480,3)
0035_s002.png (480,480,3)
0035_s003.png (480,480,3)
0035_s004.png (480,480,3)
0035_s005.png (480,480,3)
0035_s006.png (480,480,3)
0035_s007.png (480,480,3)
0035_s008.png (480,480,3)
0035_s009.png (480,480,3)
0035_s010.png (480,480,3)
0035_s011.png (480,480,3)
0035_s012.png (480,480,3)
0035_s013.png (480,480,3)
0035_s014.png (480,480,3)
0035_s015.png (480,480,3)
0035_s016.png (480,480,3)
0035_s017.png (480,480,3)
0035_s018.png (480,480,3)
0035_s019.png (480,480,3)
0035_s020.png (480,480,3)
0035_s021.png (480,480,3)
0035_s022.png (480,480,3)
0035_s023.png (480,480,3)
0035_s024.png (480,480,3)
0035_s025.png (480,480,3)
0035_s026.png (480,480,3)
0035_s027.png (480,480,3)
0035_s028.png (480,480,3)
0035_s029.png (480,480,3)
0035_s030.png (480,480,3)
0035_s031.png (480,480,3)
0035_s032.png (480,480,3)
0035_s033.png (480,480,3)
0035_s034.png (480,480,3)
0035_s035.png (480,480,3)
0035_s036.png (480,480,3)
0035_s037.png (480,480,3)
0035_s038.png (480,480,3)
0035_s039.png (480,480,3)
0035_s040.png (480,480,3)
0036_s001.png (480,480,3)
0036_s002.png (480,480,3)
0036_s003.png (480,480,3)
0036_s004.png (480,480,3)
0036_s005.png (480,480,3)
0036_s006.png (480,480,3)
0036_s007.png (480,480,3)
0036_s008.png (480,480,3)
0036_s009.png (480,480,3)
0036_s010.png (480,480,3)
0036_s011.png (480,480,3)
0036_s012.png (480,480,3)
0036_s013.png (480,480,3)
0036_s014.png (480,480,3)
0036_s015.png (480,480,3)
0036_s016.png (480,480,3)
0036_s017.png (480,480,3)
0036_s018.png (480,480,3)
0036_s019.png (480,480,3)
0036_s020.png (480,480,3)
0036_s021.png (480,480,3)
0036_s022.png (480,480,3)
0036_s023.png (480,480,3)
0036_s024.png (480,480,3)
0036_s025.png (480,480,3)
0036_s026.png (480,480,3)
0036_s027.png (480,480,3)
0036_s028.png (480,480,3)
0036_s029.png (480,480,3)
0036_s030.png (480,480,3)
0036_s031.png (480,480,3)
0036_s032.png (480,480,3)
0036_s033.png (480,480,3)
0036_s034.png (480,480,3)
0036_s035.png (480,480,3)
0036_s036.png (480,480,3)
0036_s037.png (480,480,3)
0036_s038.png (480,480,3)
0036_s039.png (480,480,3)
0036_s040.png (480,480,3)
0036_s041.png (480,480,3)
0036_s042.png (480,480,3)
0036_s043.png (480,480,3)
0036_s044.png (480,480,3)
0036_s045.png (480,480,3)
0036_s046.png (480,480,3)
0036_s047.png (480,480,3)
0036_s048.png (480,480,3)
0037_s001.png (480,480,3)
0037_s002.png (480,480,3)
0037_s003.png (480,480,3)
0037_s004.png (480,480,3)
0037_s005.png (480,480,3)
0037_s006.png (480,480,3)
0037_s007.png (480,480,3)
0037_s008.png (480,480,3)
0037_s009.png (480,480,3)
0037_s010.png (480,480,3)
0037_s011.png (480,480,3)
0037_s012.png (480,480,3)
0037_s013.png (480,480,3)
0037_s014.png (480,480,3)
0037_s015.png (480,480,3)
0037_s016.png (480,480,3)
0037_s017.png (480,480,3)
0037_s018.png (480,480,3)
0037_s019.png (480,480,3)
0037_s020.png (480,480,3)
0037_s021.png (480,480,3)
0037_s022.png (480,480,3)
0037_s023.png (480,480,3)
0037_s024.png (480,480,3)
0037_s025.png (480,480,3)
0037_s026.png (480,480,3)
0037_s027.png (480,480,3)
0037_s028.png (480,480,3)
0037_s029.png (480,480,3)
0037_s030.png (480,480,3)
0037_s031.png (480,480,3)
0037_s032.png (480,480,3)
0037_s033.png (480,480,3)
0037_s034.png (480,480,3)
0037_s035.png (480,480,3)
0037_s036.png (480,480,3)
0037_s037.png (480,480,3)
0037_s038.png (480,480,3)
0037_s039.png (480,480,3)
0037_s040.png (480,480,3)
0038_s001.png (480,480,3)
0038_s002.png (480,480,3)
0038_s003.png (480,480,3)
0038_s004.png (480,480,3)
0038_s005.png (480,480,3)
0038_s006.png (480,480,3)
0038_s007.png (480,480,3)
0038_s008.png (480,480,3)
0038_s009.png (480,480,3)
0038_s010.png (480,480,3)
0038_s011.png (480,480,3)
0038_s012.png (480,480,3)
0038_s013.png (480,480,3)
0038_s014.png (480,480,3)
0038_s015.png (480,480,3)
0038_s016.png (480,480,3)
0038_s017.png (480,480,3)
0038_s018.png (480,480,3)
0038_s019.png (480,480,3)
0038_s020.png (480,480,3)
0038_s021.png (480,480,3)
0038_s022.png (480,480,3)
0038_s023.png (480,480,3)
0038_s024.png (480,480,3)
0038_s025.png (480,480,3)
0038_s026.png (480,480,3)
0038_s027.png (480,480,3)
0038_s028.png (480,480,3)
0038_s029.png (480,480,3)
0038_s030.png (480,480,3)
0038_s031.png (480,480,3)
0038_s032.png (480,480,3)
0038_s033.png (480,480,3)
0038_s034.png (480,480,3)
0038_s035.png (480,480,3)
0038_s036.png (480,480,3)
0038_s037.png (480,480,3)
0038_s038.png (480,480,3)
0038_s039.png (480,480,3)
0038_s040.png (480,480,3)
0039_s001.png (480,480,3)
0039_s002.png (480,480,3)
0039_s003.png (480,480,3)
0039_s004.png (480,480,3)
0039_s005.png (480,480,3)
0039_s006.png (480,480,3)
0039_s007.png (480,480,3)
0039_s008.png (480,480,3)
0039_s009.png (480,480,3)
0039_s010.png (480,480,3)
0039_s011.png (480,480,3)
0039_s012.png (480,480,3)
0039_s013.png (480,480,3)
0039_s014.png (480,480,3)
0039_s015.png (480,480,3)
0039_s016.png (480,480,3)
0039_s017.png (480,480,3)
0039_s018.png (480,480,3)
0039_s019.png (480,480,3)
0039_s020.png (480,480,3)
0039_s021.png (480,480,3)
0039_s022.png (480,480,3)
0039_s023.png (480,480,3)
0039_s024.png (480,480,3)
0039_s025.png (480,480,3)
0039_s026.png (480,480,3)
0039_s027.png (480,480,3)
0039_s028.png (480,480,3)
0039_s029.png (480,480,3)
0039_s030.png (480,480,3)
0039_s031.png (480,480,3)
0039_s032.png (480,480,3)
0039_s033.png (480,480,3)
0039_s034.png (480,480,3)
0039_s035.png (480,480,3)
0039_s036.png (480,480,3)
0039_s037.png (480,480,3)
0039_s038.png (480,480,3)
0039_s039.png (480,480,3)
0039_s040.png (480,480,3)
0040_s001.png (480,480,3)
0040_s002.png (480,480,3)
0040_s003.png (480,480,3)
0040_s004.png (480,480,3)
0040_s005.png (480,480,3)
0040_s006.png (480,480,3)
0040_s007.png (480,480,3)
0040_s008.png (480,480,3)
0040_s009.png (480,480,3)
0040_s010.png (480,480,3)
0040_s011.png (480,480,3)
0040_s012.png (480,480,3)
0040_s013.png (480,480,3)
0040_s014.png (480,480,3)
0040_s015.png (480,480,3)
0040_s016.png (480,480,3)
0040_s017.png (480,480,3)
0040_s018.png (480,480,3)
0040_s019.png (480,480,3)
0040_s020.png (480,480,3)
0040_s021.png (480,480,3)
0040_s022.png (480,480,3)
0040_s023.png (480,480,3)
0040_s024.png (480,480,3)
0040_s025.png (480,480,3)
0040_s026.png (480,480,3)
0040_s027.png (480,480,3)
0040_s028.png (480,480,3)
0040_s029.png (480,480,3)
0040_s030.png (480,480,3)
0040_s031.png (480,480,3)
0040_s032.png (480,480,3)
0040_s033.png (480,480,3)
0040_s034.png (480,480,3)
0040_s035.png (480,480,3)
0040_s036.png (480,480,3)
0040_s037.png (480,480,3)
0040_s038.png (480,480,3)
0040_s039.png (480,480,3)
0040_s040.png (480,480,3)
0041_s001.png (480,480,3)
0041_s002.png (480,480,3)
0041_s003.png (480,480,3)
0041_s004.png (480,480,3)
0041_s005.png (480,480,3)
0041_s006.png (480,480,3)
0041_s007.png (480,480,3)
0041_s008.png (480,480,3)
0041_s009.png (480,480,3)
0041_s010.png (480,480,3)
0041_s011.png (480,480,3)
0041_s012.png (480,480,3)
0041_s013.png (480,480,3)
0041_s014.png (480,480,3)
0041_s015.png (480,480,3)
0041_s016.png (480,480,3)
0041_s017.png (480,480,3)
0041_s018.png (480,480,3)
0041_s019.png (480,480,3)
0041_s020.png (480,480,3)
0041_s021.png (480,480,3)
0041_s022.png (480,480,3)
0041_s023.png (480,480,3)
0041_s024.png (480,480,3)
0041_s025.png (480,480,3)
0041_s026.png (480,480,3)
0041_s027.png (480,480,3)
0041_s028.png (480,480,3)
0041_s029.png (480,480,3)
0041_s030.png (480,480,3)
0041_s031.png (480,480,3)
0041_s032.png (480,480,3)
0041_s033.png (480,480,3)
0041_s034.png (480,480,3)
0041_s035.png (480,480,3)
0041_s036.png (480,480,3)
0041_s037.png (480,480,3)
0041_s038.png (480,480,3)
0041_s039.png (480,480,3)
0041_s040.png (480,480,3)
0042_s001.png (480,480,3)
0042_s002.png (480,480,3)
0042_s003.png (480,480,3)
0042_s004.png (480,480,3)
0042_s005.png (480,480,3)
0042_s006.png (480,480,3)
0042_s007.png (480,480,3)
0042_s008.png (480,480,3)
0042_s009.png (480,480,3)
0042_s010.png (480,480,3)
0042_s011.png (480,480,3)
0042_s012.png (480,480,3)
0042_s013.png (480,480,3)
0042_s014.png (480,480,3)
0042_s015.png (480,480,3)
0042_s016.png (480,480,3)
0042_s017.png (480,480,3)
0042_s018.png (480,480,3)
0042_s019.png (480,480,3)
0042_s020.png (480,480,3)
0042_s021.png (480,480,3)
0042_s022.png (480,480,3)
0042_s023.png (480,480,3)
0042_s024.png (480,480,3)
0042_s025.png (480,480,3)
0042_s026.png (480,480,3)
0042_s027.png (480,480,3)
0042_s028.png (480,480,3)
0042_s029.png (480,480,3)
0042_s030.png (480,480,3)
0042_s031.png (480,480,3)
0042_s032.png (480,480,3)
0042_s033.png (480,480,3)
0042_s034.png (480,480,3)
0042_s035.png (480,480,3)
0042_s036.png (480,480,3)
0042_s037.png (480,480,3)
0042_s038.png (480,480,3)
0042_s039.png (480,480,3)
0042_s040.png (480,480,3)
0043_s001.png (480,480,3)
0043_s002.png (480,480,3)
0043_s003.png (480,480,3)
0043_s004.png (480,480,3)
0043_s005.png (480,480,3)
0043_s006.png (480,480,3)
0043_s007.png (480,480,3)
0043_s008.png (480,480,3)
0043_s009.png (480,480,3)
0043_s010.png (480,480,3)
0043_s011.png (480,480,3)
0043_s012.png (480,480,3)
0043_s013.png (480,480,3)
0043_s014.png (480,480,3)
0043_s015.png (480,480,3)
0043_s016.png (480,480,3)
0043_s017.png (480,480,3)
0043_s018.png (480,480,3)
0043_s019.png (480,480,3)
0043_s020.png (480,480,3)
0043_s021.png (480,480,3)
0043_s022.png (480,480,3)
0043_s023.png (480,480,3)
0043_s024.png (480,480,3)
0043_s025.png (480,480,3)
0043_s026.png (480,480,3)
0043_s027.png (480,480,3)
0043_s028.png (480,480,3)
0043_s029.png (480,480,3)
0043_s030.png (480,480,3)
0043_s031.png (480,480,3)
0043_s032.png (480,480,3)
0043_s033.png (480,480,3)
0043_s034.png (480,480,3)
0043_s035.png (480,480,3)
0043_s036.png (480,480,3)
0043_s037.png (480,480,3)
0043_s038.png (480,480,3)
0043_s039.png (480,480,3)
0043_s040.png (480,480,3)
0044_s001.png (480,480,3)
0044_s002.png (480,480,3)
0044_s003.png (480,480,3)
0044_s004.png (480,480,3)
0044_s005.png (480,480,3)
0044_s006.png (480,480,3)
0044_s007.png (480,480,3)
0044_s008.png (480,480,3)
0044_s009.png (480,480,3)
0044_s010.png (480,480,3)
0044_s011.png (480,480,3)
0044_s012.png (480,480,3)
0044_s013.png (480,480,3)
0044_s014.png (480,480,3)
0044_s015.png (480,480,3)
0044_s016.png (480,480,3)
0044_s017.png (480,480,3)
0044_s018.png (480,480,3)
0044_s019.png (480,480,3)
0044_s020.png (480,480,3)
0044_s021.png (480,480,3)
0044_s022.png (480,480,3)
0044_s023.png (480,480,3)
0044_s024.png (480,480,3)
0044_s025.png (480,480,3)
0044_s026.png (480,480,3)
0044_s027.png (480,480,3)
0044_s028.png (480,480,3)
0044_s029.png (480,480,3)
0044_s030.png (480,480,3)
0044_s031.png (480,480,3)
0044_s032.png (480,480,3)
0044_s033.png (480,480,3)
0044_s034.png (480,480,3)
0044_s035.png (480,480,3)
0044_s036.png (480,480,3)
0044_s037.png (480,480,3)
0044_s038.png (480,480,3)
0044_s039.png (480,480,3)
0044_s040.png (480,480,3)
0044_s041.png (480,480,3)
0044_s042.png (480,480,3)
0044_s043.png (480,480,3)
0044_s044.png (480,480,3)
0044_s045.png (480,480,3)
0044_s046.png (480,480,3)
0044_s047.png (480,480,3)
0044_s048.png (480,480,3)
0044_s049.png (480,480,3)
0044_s050.png (480,480,3)
0044_s051.png (480,480,3)
0044_s052.png (480,480,3)
0044_s053.png (480,480,3)
0044_s054.png (480,480,3)
0044_s055.png (480,480,3)
0044_s056.png (480,480,3)
0044_s057.png (480,480,3)
0044_s058.png (480,480,3)
0044_s059.png (480,480,3)
0044_s060.png (480,480,3)
0044_s061.png (480,480,3)
0044_s062.png (480,480,3)
0044_s063.png (480,480,3)
0044_s064.png (480,480,3)
0045_s001.png (480,480,3)
0045_s002.png (480,480,3)
0045_s003.png (480,480,3)
0045_s004.png (480,480,3)
0045_s005.png (480,480,3)
0045_s006.png (480,480,3)
0045_s007.png (480,480,3)
0045_s008.png (480,480,3)
0045_s009.png (480,480,3)
0045_s010.png (480,480,3)
0045_s011.png (480,480,3)
0045_s012.png (480,480,3)
0045_s013.png (480,480,3)
0045_s014.png (480,480,3)
0045_s015.png (480,480,3)
0045_s016.png (480,480,3)
0045_s017.png (480,480,3)
0045_s018.png (480,480,3)
0045_s019.png (480,480,3)
0045_s020.png (480,480,3)
0045_s021.png (480,480,3)
0045_s022.png (480,480,3)
0045_s023.png (480,480,3)
0045_s024.png (480,480,3)
0045_s025.png (480,480,3)
0045_s026.png (480,480,3)
0045_s027.png (480,480,3)
0045_s028.png (480,480,3)
0045_s029.png (480,480,3)
0045_s030.png (480,480,3)
0045_s031.png (480,480,3)
0045_s032.png (480,480,3)
0046_s001.png (480,480,3)
0046_s002.png (480,480,3)
0046_s003.png (480,480,3)
0046_s004.png (480,480,3)
0046_s005.png (480,480,3)
0046_s006.png (480,480,3)
0046_s007.png (480,480,3)
0046_s008.png (480,480,3)
0046_s009.png (480,480,3)
0046_s010.png (480,480,3)
0046_s011.png (480,480,3)
0046_s012.png (480,480,3)
0046_s013.png (480,480,3)
0046_s014.png (480,480,3)
0046_s015.png (480,480,3)
0046_s016.png (480,480,3)
0046_s017.png (480,480,3)
0046_s018.png (480,480,3)
0046_s019.png (480,480,3)
0046_s020.png (480,480,3)
0046_s021.png (480,480,3)
0046_s022.png (480,480,3)
0046_s023.png (480,480,3)
0046_s024.png (480,480,3)
0046_s025.png (480,480,3)
0046_s026.png (480,480,3)
0046_s027.png (480,480,3)
0046_s028.png (480,480,3)
0046_s029.png (480,480,3)
0046_s030.png (480,480,3)
0046_s031.png (480,480,3)
0046_s032.png (480,480,3)
0046_s033.png (480,480,3)
0046_s034.png (480,480,3)
0046_s035.png (480,480,3)
0046_s036.png (480,480,3)
0046_s037.png (480,480,3)
0046_s038.png (480,480,3)
0046_s039.png (480,480,3)
0046_s040.png (480,480,3)
0047_s001.png (480,480,3)
0047_s002.png (480,480,3)
0047_s003.png (480,480,3)
0047_s004.png (480,480,3)
0047_s005.png (480,480,3)
0047_s006.png (480,480,3)
0047_s007.png (480,480,3)
0047_s008.png (480,480,3)
0047_s009.png (480,480,3)
0047_s010.png (480,480,3)
0047_s011.png (480,480,3)
0047_s012.png (480,480,3)
0047_s013.png (480,480,3)
0047_s014.png (480,480,3)
0047_s015.png (480,480,3)
0047_s016.png (480,480,3)
0047_s017.png (480,480,3)
0047_s018.png (480,480,3)
0047_s019.png (480,480,3)
0047_s020.png (480,480,3)
0047_s021.png (480,480,3)
0047_s022.png (480,480,3)
0047_s023.png (480,480,3)
0047_s024.png (480,480,3)
0047_s025.png (480,480,3)
0047_s026.png (480,480,3)
0047_s027.png (480,480,3)
0047_s028.png (480,480,3)
0047_s029.png (480,480,3)
0047_s030.png (480,480,3)
0047_s031.png (480,480,3)
0047_s032.png (480,480,3)
0047_s033.png (480,480,3)
0047_s034.png (480,480,3)
0047_s035.png (480,480,3)
0047_s036.png (480,480,3)
0047_s037.png (480,480,3)
0047_s038.png (480,480,3)
0047_s039.png (480,480,3)
0047_s040.png (480,480,3)
0048_s001.png (480,480,3)
0048_s002.png (480,480,3)
0048_s003.png (480,480,3)
0048_s004.png (480,480,3)
0048_s005.png (480,480,3)
0048_s006.png (480,480,3)
0048_s007.png (480,480,3)
0048_s008.png (480,480,3)
0048_s009.png (480,480,3)
0048_s010.png (480,480,3)
0048_s011.png (480,480,3)
0048_s012.png (480,480,3)
0048_s013.png (480,480,3)
0048_s014.png (480,480,3)
0048_s015.png (480,480,3)
0048_s016.png (480,480,3)
0048_s017.png (480,480,3)
0048_s018.png (480,480,3)
0048_s019.png (480,480,3)
0048_s020.png (480,480,3)
0048_s021.png (480,480,3)
0048_s022.png (480,480,3)
0048_s023.png (480,480,3)
0048_s024.png (480,480,3)
0048_s025.png (480,480,3)
0048_s026.png (480,480,3)
0048_s027.png (480,480,3)
0048_s028.png (480,480,3)
0048_s029.png (480,480,3)
0048_s030.png (480,480,3)
0048_s031.png (480,480,3)
0048_s032.png (480,480,3)
0048_s033.png (480,480,3)
0048_s034.png (480,480,3)
0048_s035.png (480,480,3)
0048_s036.png (480,480,3)
0048_s037.png (480,480,3)
0048_s038.png (480,480,3)
0048_s039.png (480,480,3)
0048_s040.png (480,480,3)
0049_s001.png (480,480,3)
0049_s002.png (480,480,3)
0049_s003.png (480,480,3)
0049_s004.png (480,480,3)
0049_s005.png (480,480,3)
0049_s006.png (480,480,3)
0049_s007.png (480,480,3)
0049_s008.png (480,480,3)
0049_s009.png (480,480,3)
0049_s010.png (480,480,3)
0049_s011.png (480,480,3)
0049_s012.png (480,480,3)
0049_s013.png (480,480,3)
0049_s014.png (480,480,3)
0049_s015.png (480,480,3)
0049_s016.png (480,480,3)
0049_s017.png (480,480,3)
0049_s018.png (480,480,3)
0049_s019.png (480,480,3)
0049_s020.png (480,480,3)
0049_s021.png (480,480,3)
0049_s022.png (480,480,3)
0049_s023.png (480,480,3)
0049_s024.png (480,480,3)
0049_s025.png (480,480,3)
0049_s026.png (480,480,3)
0049_s027.png (480,480,3)
0049_s028.png (480,480,3)
0049_s029.png (480,480,3)
0049_s030.png (480,480,3)
0049_s031.png (480,480,3)
0049_s032.png (480,480,3)
0049_s033.png (480,480,3)
0049_s034.png (480,480,3)
0049_s035.png (480,480,3)
0049_s036.png (480,480,3)
0049_s037.png (480,480,3)
0049_s038.png (480,480,3)
0049_s039.png (480,480,3)
0049_s040.png (480,480,3)
0050_s001.png (480,480,3)
0050_s002.png (480,480,3)
0050_s003.png (480,480,3)
0050_s004.png (480,480,3)
0050_s005.png (480,480,3)
0050_s006.png (480,480,3)
0050_s007.png (480,480,3)
0050_s008.png (480,480,3)
0050_s009.png (480,480,3)
0050_s010.png (480,480,3)
0050_s011.png (480,480,3)
0050_s012.png (480,480,3)
0050_s013.png (480,480,3)
0050_s014.png (480,480,3)
0050_s015.png (480,480,3)
0050_s016.png (480,480,3)
0050_s017.png (480,480,3)
0050_s018.png (480,480,3)
0050_s019.png (480,480,3)
0050_s020.png (480,480,3)
0050_s021.png (480,480,3)
0050_s022.png (480,480,3)
0050_s023.png (480,480,3)
0050_s024.png (480,480,3)
0050_s025.png (480,480,3)
0050_s026.png (480,480,3)
0050_s027.png (480,480,3)
0050_s028.png (480,480,3)
0050_s029.png (480,480,3)
0050_s030.png (480,480,3)
0050_s031.png (480,480,3)
0050_s032.png (480,480,3)
0050_s033.png (480,480,3)
0050_s034.png (480,480,3)
0050_s035.png (480,480,3)
0050_s036.png (480,480,3)
0050_s037.png (480,480,3)
0050_s038.png (480,480,3)
0050_s039.png (480,480,3)
0050_s040.png (480,480,3)
0051_s001.png (480,480,3)
0051_s002.png (480,480,3)
0051_s003.png (480,480,3)
0051_s004.png (480,480,3)
0051_s005.png (480,480,3)
0051_s006.png (480,480,3)
0051_s007.png (480,480,3)
0051_s008.png (480,480,3)
0051_s009.png (480,480,3)
0051_s010.png (480,480,3)
0051_s011.png (480,480,3)
0051_s012.png (480,480,3)
0051_s013.png (480,480,3)
0051_s014.png (480,480,3)
0051_s015.png (480,480,3)
0051_s016.png (480,480,3)
0051_s017.png (480,480,3)
0051_s018.png (480,480,3)
0051_s019.png (480,480,3)
0051_s020.png (480,480,3)
0051_s021.png (480,480,3)
0051_s022.png (480,480,3)
0051_s023.png (480,480,3)
0051_s024.png (480,480,3)
0051_s025.png (480,480,3)
0051_s026.png (480,480,3)
0051_s027.png (480,480,3)
0051_s028.png (480,480,3)
0051_s029.png (480,480,3)
0051_s030.png (480,480,3)
0051_s031.png (480,480,3)
0051_s032.png (480,480,3)
0051_s033.png (480,480,3)
0051_s034.png (480,480,3)
0051_s035.png (480,480,3)
0051_s036.png (480,480,3)
0051_s037.png (480,480,3)
0051_s038.png (480,480,3)
0051_s039.png (480,480,3)
0051_s040.png (480,480,3)
0052_s001.png (480,480,3)
0052_s002.png (480,480,3)
0052_s003.png (480,480,3)
0052_s004.png (480,480,3)
0052_s005.png (480,480,3)
0052_s006.png (480,480,3)
0052_s007.png (480,480,3)
0052_s008.png (480,480,3)
0052_s009.png (480,480,3)
0052_s010.png (480,480,3)
0052_s011.png (480,480,3)
0052_s012.png (480,480,3)
0052_s013.png (480,480,3)
0052_s014.png (480,480,3)
0052_s015.png (480,480,3)
0052_s016.png (480,480,3)
0052_s017.png (480,480,3)
0052_s018.png (480,480,3)
0052_s019.png (480,480,3)
0052_s020.png (480,480,3)
0052_s021.png (480,480,3)
0052_s022.png (480,480,3)
0052_s023.png (480,480,3)
0052_s024.png (480,480,3)
0052_s025.png (480,480,3)
0052_s026.png (480,480,3)
0052_s027.png (480,480,3)
0052_s028.png (480,480,3)
0052_s029.png (480,480,3)
0052_s030.png (480,480,3)
0052_s031.png (480,480,3)
0052_s032.png (480,480,3)
0052_s033.png (480,480,3)
0052_s034.png (480,480,3)
0052_s035.png (480,480,3)
0052_s036.png (480,480,3)
0052_s037.png (480,480,3)
0052_s038.png (480,480,3)
0052_s039.png (480,480,3)
0052_s040.png (480,480,3)
0053_s001.png (480,480,3)
0053_s002.png (480,480,3)
0053_s003.png (480,480,3)
0053_s004.png (480,480,3)
0053_s005.png (480,480,3)
0053_s006.png (480,480,3)
0053_s007.png (480,480,3)
0053_s008.png (480,480,3)
0053_s009.png (480,480,3)
0053_s010.png (480,480,3)
0053_s011.png (480,480,3)
0053_s012.png (480,480,3)
0053_s013.png (480,480,3)
0053_s014.png (480,480,3)
0053_s015.png (480,480,3)
0053_s016.png (480,480,3)
0053_s017.png (480,480,3)
0053_s018.png (480,480,3)
0053_s019.png (480,480,3)
0053_s020.png (480,480,3)
0053_s021.png (480,480,3)
0053_s022.png (480,480,3)
0053_s023.png (480,480,3)
0053_s024.png (480,480,3)
0053_s025.png (480,480,3)
0053_s026.png (480,480,3)
0053_s027.png (480,480,3)
0053_s028.png (480,480,3)
0053_s029.png (480,480,3)
0053_s030.png (480,480,3)
0053_s031.png (480,480,3)
0053_s032.png (480,480,3)
0053_s033.png (480,480,3)
0053_s034.png (480,480,3)
0053_s035.png (480,480,3)
0053_s036.png (480,480,3)
0053_s037.png (480,480,3)
0053_s038.png (480,480,3)
0053_s039.png (480,480,3)
0053_s040.png (480,480,3)
0054_s001.png (480,480,3)
0054_s002.png (480,480,3)
0054_s003.png (480,480,3)
0054_s004.png (480,480,3)
0054_s005.png (480,480,3)
0054_s006.png (480,480,3)
0054_s007.png (480,480,3)
0054_s008.png (480,480,3)
0054_s009.png (480,480,3)
0054_s010.png (480,480,3)
0054_s011.png (480,480,3)
0054_s012.png (480,480,3)
0054_s013.png (480,480,3)
0054_s014.png (480,480,3)
0054_s015.png (480,480,3)
0054_s016.png (480,480,3)
0054_s017.png (480,480,3)
0054_s018.png (480,480,3)
0054_s019.png (480,480,3)
0054_s020.png (480,480,3)
0054_s021.png (480,480,3)
0054_s022.png (480,480,3)
0054_s023.png (480,480,3)
0054_s024.png (480,480,3)
0054_s025.png (480,480,3)
0054_s026.png (480,480,3)
0054_s027.png (480,480,3)
0054_s028.png (480,480,3)
0054_s029.png (480,480,3)
0054_s030.png (480,480,3)
0054_s031.png (480,480,3)
0054_s032.png (480,480,3)
0054_s033.png (480,480,3)
0054_s034.png (480,480,3)
0054_s035.png (480,480,3)
0054_s036.png (480,480,3)
0054_s037.png (480,480,3)
0054_s038.png (480,480,3)
0054_s039.png (480,480,3)
0054_s040.png (480,480,3)
0055_s001.png (480,480,3)
0055_s002.png (480,480,3)
0055_s003.png (480,480,3)
0055_s004.png (480,480,3)
0055_s005.png (480,480,3)
0055_s006.png (480,480,3)
0055_s007.png (480,480,3)
0055_s008.png (480,480,3)
0055_s009.png (480,480,3)
0055_s010.png (480,480,3)
0055_s011.png (480,480,3)
0055_s012.png (480,480,3)
0055_s013.png (480,480,3)
0055_s014.png (480,480,3)
0055_s015.png (480,480,3)
0055_s016.png (480,480,3)
0055_s017.png (480,480,3)
0055_s018.png (480,480,3)
0055_s019.png (480,480,3)
0055_s020.png (480,480,3)
0055_s021.png (480,480,3)
0055_s022.png (480,480,3)
0055_s023.png (480,480,3)
0055_s024.png (480,480,3)
0055_s025.png (480,480,3)
0055_s026.png (480,480,3)
0055_s027.png (480,480,3)
0055_s028.png (480,480,3)
0055_s029.png (480,480,3)
0055_s030.png (480,480,3)
0055_s031.png (480,480,3)
0055_s032.png (480,480,3)
0056_s001.png (480,480,3)
0056_s002.png (480,480,3)
0056_s003.png (480,480,3)
0056_s004.png (480,480,3)
0056_s005.png (480,480,3)
0056_s006.png (480,480,3)
0056_s007.png (480,480,3)
0056_s008.png (480,480,3)
0056_s009.png (480,480,3)
0056_s010.png (480,480,3)
0056_s011.png (480,480,3)
0056_s012.png (480,480,3)
0056_s013.png (480,480,3)
0056_s014.png (480,480,3)
0056_s015.png (480,480,3)
0056_s016.png (480,480,3)
0056_s017.png (480,480,3)
0056_s018.png (480,480,3)
0056_s019.png (480,480,3)
0056_s020.png (480,480,3)
0056_s021.png (480,480,3)
0056_s022.png (480,480,3)
0056_s023.png (480,480,3)
0056_s024.png (480,480,3)
0056_s025.png (480,480,3)
0056_s026.png (480,480,3)
0056_s027.png (480,480,3)
0056_s028.png (480,480,3)
0056_s029.png (480,480,3)
0056_s030.png (480,480,3)
0056_s031.png (480,480,3)
0056_s032.png (480,480,3)
0056_s033.png (480,480,3)
0056_s034.png (480,480,3)
0056_s035.png (480,480,3)
0056_s036.png (480,480,3)
0056_s037.png (480,480,3)
0056_s038.png (480,480,3)
0056_s039.png (480,480,3)
0056_s040.png (480,480,3)
0057_s001.png (480,480,3)
0057_s002.png (480,480,3)
0057_s003.png (480,480,3)
0057_s004.png (480,480,3)
0057_s005.png (480,480,3)
0057_s006.png (480,480,3)
0057_s007.png (480,480,3)
0057_s008.png (480,480,3)
0057_s009.png (480,480,3)
0057_s010.png (480,480,3)
0057_s011.png (480,480,3)
0057_s012.png (480,480,3)
0057_s013.png (480,480,3)
0057_s014.png (480,480,3)
0057_s015.png (480,480,3)
0057_s016.png (480,480,3)
0057_s017.png (480,480,3)
0057_s018.png (480,480,3)
0057_s019.png (480,480,3)
0057_s020.png (480,480,3)
0057_s021.png (480,480,3)
0057_s022.png (480,480,3)
0057_s023.png (480,480,3)
0057_s024.png (480,480,3)
0057_s025.png (480,480,3)
0057_s026.png (480,480,3)
0057_s027.png (480,480,3)
0057_s028.png (480,480,3)
0057_s029.png (480,480,3)
0057_s030.png (480,480,3)
0057_s031.png (480,480,3)
0057_s032.png (480,480,3)
0057_s033.png (480,480,3)
0057_s034.png (480,480,3)
0057_s035.png (480,480,3)
0057_s036.png (480,480,3)
0057_s037.png (480,480,3)
0057_s038.png (480,480,3)
0057_s039.png (480,480,3)
0057_s040.png (480,480,3)
0058_s001.png (480,480,3)
0058_s002.png (480,480,3)
0058_s003.png (480,480,3)
0058_s004.png (480,480,3)
0058_s005.png (480,480,3)
0058_s006.png (480,480,3)
0058_s007.png (480,480,3)
0058_s008.png (480,480,3)
0058_s009.png (480,480,3)
0058_s010.png (480,480,3)
0058_s011.png (480,480,3)
0058_s012.png (480,480,3)
0058_s013.png (480,480,3)
0058_s014.png (480,480,3)
0058_s015.png (480,480,3)
0058_s016.png (480,480,3)
0058_s017.png (480,480,3)
0058_s018.png (480,480,3)
0058_s019.png (480,480,3)
0058_s020.png (480,480,3)
0058_s021.png (480,480,3)
0058_s022.png (480,480,3)
0058_s023.png (480,480,3)
0058_s024.png (480,480,3)
0058_s025.png (480,480,3)
0058_s026.png (480,480,3)
0058_s027.png (480,480,3)
0058_s028.png (480,480,3)
0058_s029.png (480,480,3)
0058_s030.png (480,480,3)
0058_s031.png (480,480,3)
0058_s032.png (480,480,3)
0058_s033.png (480,480,3)
0058_s034.png (480,480,3)
0058_s035.png (480,480,3)
0058_s036.png (480,480,3)
0058_s037.png (480,480,3)
0058_s038.png (480,480,3)
0058_s039.png (480,480,3)
0058_s040.png (480,480,3)
0059_s001.png (480,480,3)
0059_s002.png (480,480,3)
0059_s003.png (480,480,3)
0059_s004.png (480,480,3)
0059_s005.png (480,480,3)
0059_s006.png (480,480,3)
0059_s007.png (480,480,3)
0059_s008.png (480,480,3)
0059_s009.png (480,480,3)
0059_s010.png (480,480,3)
0059_s011.png (480,480,3)
0059_s012.png (480,480,3)
0059_s013.png (480,480,3)
0059_s014.png (480,480,3)
0059_s015.png (480,480,3)
0059_s016.png (480,480,3)
0059_s017.png (480,480,3)
0059_s018.png (480,480,3)
0059_s019.png (480,480,3)
0059_s020.png (480,480,3)
0059_s021.png (480,480,3)
0059_s022.png (480,480,3)
0059_s023.png (480,480,3)
0059_s024.png (480,480,3)
0059_s025.png (480,480,3)
0059_s026.png (480,480,3)
0059_s027.png (480,480,3)
0059_s028.png (480,480,3)
0059_s029.png (480,480,3)
0059_s030.png (480,480,3)
0059_s031.png (480,480,3)
0059_s032.png (480,480,3)
0059_s033.png (480,480,3)
0059_s034.png (480,480,3)
0059_s035.png (480,480,3)
0059_s036.png (480,480,3)
0059_s037.png (480,480,3)
0059_s038.png (480,480,3)
0059_s039.png (480,480,3)
0059_s040.png (480,480,3)
0059_s041.png (480,480,3)
0059_s042.png (480,480,3)
0059_s043.png (480,480,3)
0059_s044.png (480,480,3)
0059_s045.png (480,480,3)
0059_s046.png (480,480,3)
0059_s047.png (480,480,3)
0059_s048.png (480,480,3)
0060_s001.png (480,480,3)
0060_s002.png (480,480,3)
0060_s003.png (480,480,3)
0060_s004.png (480,480,3)
0060_s005.png (480,480,3)
0060_s006.png (480,480,3)
0060_s007.png (480,480,3)
0060_s008.png (480,480,3)
0060_s009.png (480,480,3)
0060_s010.png (480,480,3)
0060_s011.png (480,480,3)
0060_s012.png (480,480,3)
0060_s013.png (480,480,3)
0060_s014.png (480,480,3)
0060_s015.png (480,480,3)
0060_s016.png (480,480,3)
0060_s017.png (480,480,3)
0060_s018.png (480,480,3)
0060_s019.png (480,480,3)
0060_s020.png (480,480,3)
0060_s021.png (480,480,3)
0060_s022.png (480,480,3)
0060_s023.png (480,480,3)
0060_s024.png (480,480,3)
0060_s025.png (480,480,3)
0060_s026.png (480,480,3)
0060_s027.png (480,480,3)
0060_s028.png (480,480,3)
0060_s029.png (480,480,3)
0060_s030.png (480,480,3)
0060_s031.png (480,480,3)
0060_s032.png (480,480,3)
0060_s033.png (480,480,3)
0060_s034.png (480,480,3)
0060_s035.png (480,480,3)
0060_s036.png (480,480,3)
0060_s037.png (480,480,3)
0060_s038.png (480,480,3)
0060_s039.png (480,480,3)
0060_s040.png (480,480,3)
0061_s001.png (480,480,3)
0061_s002.png (480,480,3)
0061_s003.png (480,480,3)
0061_s004.png (480,480,3)
0061_s005.png (480,480,3)
0061_s006.png (480,480,3)
0061_s007.png (480,480,3)
0061_s008.png (480,480,3)
0061_s009.png (480,480,3)
0061_s010.png (480,480,3)
0061_s011.png (480,480,3)
0061_s012.png (480,480,3)
0061_s013.png (480,480,3)
0061_s014.png (480,480,3)
0061_s015.png (480,480,3)
0061_s016.png (480,480,3)
0061_s017.png (480,480,3)
0061_s018.png (480,480,3)
0061_s019.png (480,480,3)
0061_s020.png (480,480,3)
0061_s021.png (480,480,3)
0061_s022.png (480,480,3)
0061_s023.png (480,480,3)
0061_s024.png (480,480,3)
0061_s025.png (480,480,3)
0061_s026.png (480,480,3)
0061_s027.png (480,480,3)
0061_s028.png (480,480,3)
0061_s029.png (480,480,3)
0061_s030.png (480,480,3)
0061_s031.png (480,480,3)
0061_s032.png (480,480,3)
0061_s033.png (480,480,3)
0061_s034.png (480,480,3)
0061_s035.png (480,480,3)
0061_s036.png (480,480,3)
0061_s037.png (480,480,3)
0061_s038.png (480,480,3)
0061_s039.png (480,480,3)
0061_s040.png (480,480,3)
0062_s001.png (480,480,3)
0062_s002.png (480,480,3)
0062_s003.png (480,480,3)
0062_s004.png (480,480,3)
0062_s005.png (480,480,3)
0062_s006.png (480,480,3)
0062_s007.png (480,480,3)
0062_s008.png (480,480,3)
0062_s009.png (480,480,3)
0062_s010.png (480,480,3)
0062_s011.png (480,480,3)
0062_s012.png (480,480,3)
0062_s013.png (480,480,3)
0062_s014.png (480,480,3)
0062_s015.png (480,480,3)
0062_s016.png (480,480,3)
0062_s017.png (480,480,3)
0062_s018.png (480,480,3)
0062_s019.png (480,480,3)
0062_s020.png (480,480,3)
0062_s021.png (480,480,3)
0062_s022.png (480,480,3)
0062_s023.png (480,480,3)
0062_s024.png (480,480,3)
0062_s025.png (480,480,3)
0062_s026.png (480,480,3)
0062_s027.png (480,480,3)
0062_s028.png (480,480,3)
0062_s029.png (480,480,3)
0062_s030.png (480,480,3)
0062_s031.png (480,480,3)
0062_s032.png (480,480,3)
0062_s033.png (480,480,3)
0062_s034.png (480,480,3)
0062_s035.png (480,480,3)
0062_s036.png (480,480,3)
0062_s037.png (480,480,3)
0062_s038.png (480,480,3)
0062_s039.png (480,480,3)
0062_s040.png (480,480,3)
0063_s001.png (480,480,3)
0063_s002.png (480,480,3)
0063_s003.png (480,480,3)
0063_s004.png (480,480,3)
0063_s005.png (480,480,3)
0063_s006.png (480,480,3)
0063_s007.png (480,480,3)
0063_s008.png (480,480,3)
0063_s009.png (480,480,3)
0063_s010.png (480,480,3)
0063_s011.png (480,480,3)
0063_s012.png (480,480,3)
0063_s013.png (480,480,3)
0063_s014.png (480,480,3)
0063_s015.png (480,480,3)
0063_s016.png (480,480,3)
0063_s017.png (480,480,3)
0063_s018.png (480,480,3)
0063_s019.png (480,480,3)
0063_s020.png (480,480,3)
0063_s021.png (480,480,3)
0063_s022.png (480,480,3)
0063_s023.png (480,480,3)
0063_s024.png (480,480,3)
0063_s025.png (480,480,3)
0063_s026.png (480,480,3)
0063_s027.png (480,480,3)
0063_s028.png (480,480,3)
0063_s029.png (480,480,3)
0063_s030.png (480,480,3)
0063_s031.png (480,480,3)
0063_s032.png (480,480,3)
0063_s033.png (480,480,3)
0063_s034.png (480,480,3)
0063_s035.png (480,480,3)
0063_s036.png (480,480,3)
0063_s037.png (480,480,3)
0063_s038.png (480,480,3)
0063_s039.png (480,480,3)
0063_s040.png (480,480,3)
0063_s041.png (480,480,3)
0063_s042.png (480,480,3)
0063_s043.png (480,480,3)
0063_s044.png (480,480,3)
0063_s045.png (480,480,3)
0063_s046.png (480,480,3)
0063_s047.png (480,480,3)
0063_s048.png (480,480,3)
0064_s001.png (480,480,3)
0064_s002.png (480,480,3)
0064_s003.png (480,480,3)
0064_s004.png (480,480,3)
0064_s005.png (480,480,3)
0064_s006.png (480,480,3)
0064_s007.png (480,480,3)
0064_s008.png (480,480,3)
0064_s009.png (480,480,3)
0064_s010.png (480,480,3)
0064_s011.png (480,480,3)
0064_s012.png (480,480,3)
0064_s013.png (480,480,3)
0064_s014.png (480,480,3)
0064_s015.png (480,480,3)
0064_s016.png (480,480,3)
0064_s017.png (480,480,3)
0064_s018.png (480,480,3)
0064_s019.png (480,480,3)
0064_s020.png (480,480,3)
0064_s021.png (480,480,3)
0064_s022.png (480,480,3)
0064_s023.png (480,480,3)
0064_s024.png (480,480,3)
0064_s025.png (480,480,3)
0064_s026.png (480,480,3)
0064_s027.png (480,480,3)
0064_s028.png (480,480,3)
0064_s029.png (480,480,3)
0064_s030.png (480,480,3)
0064_s031.png (480,480,3)
0064_s032.png (480,480,3)
0064_s033.png (480,480,3)
0064_s034.png (480,480,3)
0064_s035.png (480,480,3)
0064_s036.png (480,480,3)
0064_s037.png (480,480,3)
0064_s038.png (480,480,3)
0064_s039.png (480,480,3)
0064_s040.png (480,480,3)
0065_s001.png (480,480,3)
0065_s002.png (480,480,3)
0065_s003.png (480,480,3)
0065_s004.png (480,480,3)
0065_s005.png (480,480,3)
0065_s006.png (480,480,3)
0065_s007.png (480,480,3)
0065_s008.png (480,480,3)
0065_s009.png (480,480,3)
0065_s010.png (480,480,3)
0065_s011.png (480,480,3)
0065_s012.png (480,480,3)
0065_s013.png (480,480,3)
0065_s014.png (480,480,3)
0065_s015.png (480,480,3)
0065_s016.png (480,480,3)
0065_s017.png (480,480,3)
00
Download .txt
gitextract_k1iv7nsr/

├── .gitignore
├── .pre-commit-config.yaml
├── INSTALL.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── VERSION
├── basicsr/
│   ├── __init__.py
│   ├── archs/
│   │   ├── BSRN_arch.py
│   │   ├── Blocks.py
│   │   ├── RFDN_arch.py
│   │   ├── Upsamplers.py
│   │   ├── __init__.py
│   │   ├── arch_util.py
│   │   ├── rfdnfinalB5_arch.py
│   │   └── vgg_arch.py
│   ├── data/
│   │   ├── __init__.py
│   │   ├── data_sampler.py
│   │   ├── data_util.py
│   │   ├── degradations.py
│   │   ├── ffhq_dataset.py
│   │   ├── meta_info/
│   │   │   ├── meta_info_DIV2K800sub_GT.txt
│   │   │   ├── meta_info_REDS4_test_GT.txt
│   │   │   ├── meta_info_REDS_GT.txt
│   │   │   ├── meta_info_REDSofficial4_test_GT.txt
│   │   │   ├── meta_info_REDSval_official_test_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_fast_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_medium_GT.txt
│   │   │   ├── meta_info_Vimeo90K_test_slow_GT.txt
│   │   │   └── meta_info_Vimeo90K_train_GT.txt
│   │   ├── paired_image_dataset.py
│   │   ├── prefetch_dataloader.py
│   │   ├── reds_dataset.py
│   │   ├── single_image_dataset.py
│   │   ├── transforms.py
│   │   ├── video_test_dataset.py
│   │   └── vimeo90k_dataset.py
│   ├── losses/
│   │   ├── __init__.py
│   │   ├── loss_util.py
│   │   └── losses.py
│   ├── metrics/
│   │   ├── __init__.py
│   │   ├── fid.py
│   │   ├── metric_util.py
│   │   ├── niqe.py
│   │   ├── niqe_pris_params.npz
│   │   └── psnr_ssim.py
│   ├── models/
│   │   ├── __init__.py
│   │   ├── base_model.py
│   │   ├── edvr_model.py
│   │   ├── esrgan_model.py
│   │   ├── hifacegan_model.py
│   │   ├── lr_scheduler.py
│   │   ├── sr_model.py
│   │   ├── srgan_model.py
│   │   ├── stylegan2_model.py
│   │   ├── swinir_model.py
│   │   ├── video_base_model.py
│   │   ├── video_gan_model.py
│   │   ├── video_recurrent_gan_model.py
│   │   └── video_recurrent_model.py
│   ├── ops/
│   │   ├── __init__.py
│   │   ├── dcn/
│   │   │   ├── __init__.py
│   │   │   ├── deform_conv.py
│   │   │   └── src/
│   │   │       ├── deform_conv_cuda.cpp
│   │   │       ├── deform_conv_cuda_kernel.cu
│   │   │       └── deform_conv_ext.cpp
│   │   ├── fused_act/
│   │   │   ├── __init__.py
│   │   │   ├── fused_act.py
│   │   │   └── src/
│   │   │       ├── fused_bias_act.cpp
│   │   │       └── fused_bias_act_kernel.cu
│   │   └── upfirdn2d/
│   │       ├── __init__.py
│   │       ├── src/
│   │       │   ├── upfirdn2d.cpp
│   │       │   └── upfirdn2d_kernel.cu
│   │       └── upfirdn2d.py
│   ├── summary.py
│   ├── test.py
│   ├── train.py
│   └── utils/
│       ├── __init__.py
│       ├── diffjpeg.py
│       ├── dist_util.py
│       ├── download_util.py
│       ├── face_util.py
│       ├── file_client.py
│       ├── flow_util.py
│       ├── img_process_util.py
│       ├── img_util.py
│       ├── lmdb_util.py
│       ├── logger.py
│       ├── matlab_functions.py
│       ├── misc.py
│       ├── options.py
│       └── registry.py
├── colab/
│   └── README.md
├── datasets/
│   └── README.md
├── docs/
│   ├── Config.md
│   ├── Config_CN.md
│   ├── DatasetPreparation.md
│   ├── DatasetPreparation_CN.md
│   ├── Datasets.md
│   ├── Datasets_CN.md
│   ├── DesignConvention.md
│   ├── DesignConvention_CN.md
│   ├── HOWTOs.md
│   ├── HOWTOs_CN.md
│   ├── Logging.md
│   ├── Logging_CN.md
│   ├── Makefile
│   ├── Metrics.md
│   ├── Metrics_CN.md
│   ├── ModelZoo.md
│   ├── ModelZoo_CN.md
│   ├── Models.md
│   ├── Models_CN.md
│   ├── TrainTest.md
│   ├── TrainTest_CN.md
│   ├── api.rst
│   ├── conf.py
│   ├── history_updates.md
│   ├── index.rst
│   └── make.bat
├── experiments/
│   └── pretrained_models/
│       ├── net_g_BSRN-S.pth
│       ├── net_g_BSRN_x2.pth
│       ├── net_g_BSRN_x3.pth
│       └── net_g_BSRN_x4.pth
├── options/
│   ├── test/
│   │   ├── benchmark_BSRN-S_x4.yml
│   │   ├── benchmark_BSRN_x2.yml
│   │   ├── benchmark_BSRN_x3.yml
│   │   └── benchmark_BSRN_x4.yml
│   └── train/
│       ├── train_BSRN-S_x4.yml
│       ├── train_BSRN_x2.yml
│       ├── train_BSRN_x3.yml
│       └── train_BSRN_x4.yml
├── requirements.txt
├── scripts/
│   ├── data_preparation/
│   │   ├── create_lmdb.py
│   │   ├── download_datasets.py
│   │   ├── extract_images_from_tfrecords.py
│   │   ├── extract_subimages.py
│   │   ├── generate_meta_info.py
│   │   ├── prepare_hifacegan_dataset.py
│   │   └── regroup_reds_dataset.py
│   ├── dist_test.sh
│   ├── dist_train.sh
│   ├── download_gdrive.py
│   ├── download_pretrained_models.py
│   ├── matlab_scripts/
│   │   ├── back_projection/
│   │   │   ├── backprojection.m
│   │   │   ├── main_bp.m
│   │   │   └── main_reverse_filter.m
│   │   ├── generate_LR_Vimeo90K.m
│   │   └── generate_bicubic_img.m
│   ├── metrics/
│   │   ├── calculate_fid_folder.py
│   │   ├── calculate_fid_stats_from_datasets.py
│   │   ├── calculate_lpips.py
│   │   ├── calculate_niqe.py
│   │   ├── calculate_psnr_ssim.py
│   │   └── calculate_stylegan2_fid.py
│   ├── model_conversion/
│   │   ├── convert_dfdnet.py
│   │   ├── convert_models.py
│   │   ├── convert_ridnet.py
│   │   └── convert_stylegan.py
│   └── publish_models.py
├── setup.cfg
├── setup.py
└── tests/
    ├── README.md
    ├── data/
    │   ├── gt.lmdb/
    │   │   ├── data.mdb
    │   │   ├── lock.mdb
    │   │   └── meta_info.txt
    │   ├── lq.lmdb/
    │   │   ├── data.mdb
    │   │   ├── lock.mdb
    │   │   └── meta_info.txt
    │   ├── meta_info_gt.txt
    │   └── meta_info_pair.txt
    ├── test_archs/
    │   ├── test_basicvsr_arch.py
    │   ├── test_discriminator_arch.py
    │   ├── test_duf_arch.py
    │   ├── test_ecbsr_arch.py
    │   └── test_srresnet_arch.py
    ├── test_data/
    │   ├── test_paired_image_dataset.py
    │   └── test_single_image_dataset.py
    ├── test_losses/
    │   └── test_losses.py
    ├── test_metrics/
    │   └── test_psnr_ssim.py
    └── test_models/
        └── test_sr_model.py
Download .txt
SYMBOL INDEX (673 symbols across 94 files)

FILE: basicsr/archs/BSRN_arch.py
  class DepthWiseConv (line 17) | class DepthWiseConv(nn.Module):
    method __init__ (line 18) | def __init__(self, in_ch, out_ch, kernel_size=3, stride=1, padding=1,
    method forward (line 45) | def forward(self, input):
  class BSConvU (line 51) | class BSConvU(torch.nn.Module):
    method __init__ (line 52) | def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,...
    method forward (line 85) | def forward(self, fea):
  class BSConvS (line 91) | class BSConvS(torch.nn.Module):
    method __init__ (line 92) | def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,...
    method forward (line 139) | def forward(self, x):
    method _reg_loss (line 145) | def _reg_loss(self):
  function stdv_channels (line 152) | def stdv_channels(F):
  function mean_channels (line 159) | def mean_channels(F):
  class CCALayer (line 165) | class CCALayer(nn.Module):
    method __init__ (line 166) | def __init__(self, channel, reduction=16):
    method forward (line 178) | def forward(self, x):
  class ChannelAttention (line 184) | class ChannelAttention(nn.Module):
    method __init__ (line 192) | def __init__(self, num_feat, squeeze_factor=16):
    method forward (line 198) | def forward(self, x):
  class ESA (line 203) | class ESA(nn.Module):
    method __init__ (line 204) | def __init__(self, num_feat=50, conv=nn.Conv2d, p=0.25):
    method forward (line 221) | def forward(self, input):
  class ESDB (line 236) | class ESDB(nn.Module):
    method __init__ (line 237) | def __init__(self, in_channels, out_channels, conv=nn.Conv2d, p=0.25):
    method forward (line 260) | def forward(self, input):
  function make_layer (line 283) | def make_layer(block, n_layers):
  class BSRN (line 291) | class BSRN(nn.Module):
    method __init__ (line 292) | def __init__(self, num_in_ch=3, num_feat=64, num_block=8, num_out_ch=3...
    method forward (line 335) | def forward(self, input):

FILE: basicsr/archs/Blocks.py
  class DepthWiseConv (line 18) | class DepthWiseConv(nn.Module):
    method __init__ (line 19) | def __init__(self, in_ch, out_ch, kernel_size=3, stride=1, padding=1,
    method forward (line 37) | def forward(self, input):
  class BSConvU (line 45) | class BSConvU(torch.nn.Module):
    method __init__ (line 46) | def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,...
    method forward (line 83) | def forward(self, fea):
  class BSConvS (line 92) | class BSConvS(torch.nn.Module):
    method __init__ (line 93) | def __init__(self, in_channels, out_channels, kernel_size=3, stride=1,...
    method forward (line 150) | def forward(self, x):
    method _reg_loss (line 161) | def _reg_loss(self):
  class ChannelReplicate (line 169) | class ChannelReplicate(nn.Module):
    method __init__ (line 170) | def __init__(self, factor=3):
    method forward (line 174) | def forward(self, input):
  class ShuffleV1Block (line 183) | class ShuffleV1Block(nn.Module):
    method __init__ (line 184) | def __init__(self, inp, oup, *, group, first_group, mid_channels, ksiz...
    method forward (line 221) | def forward(self, old_x):
  class ShuffleV2Block (line 249) | class ShuffleV2Block(nn.Module):
    method __init__ (line 250) | def __init__(self, inp, oup, mid_channels, *, ksize, stride):
    method forward (line 292) | def forward(self, old_x):
    method channel_shuffle_v2 (line 303) | def channel_shuffle_v2(self, x):
  class FeatureMap (line 321) | class FeatureMap(nn.Module):
    method __init__ (line 323) | def __init__(self, query_dims):
    method new_feature_map (line 327) | def new_feature_map(self, device):
    method forward_queries (line 332) | def forward_queries(self, x):
    method forward_keys (line 336) | def forward_keys(self, x):
    method forward (line 340) | def forward(self, x):
    method factory (line 347) | def factory(cls, *args, **kwargs):
  class ActivationFunctionFeatureMap (line 358) | class ActivationFunctionFeatureMap(FeatureMap):
    method __init__ (line 361) | def __init__(self, query_dims, activation_function):
    method new_feature_map (line 365) | def new_feature_map(self, device):
    method forward (line 368) | def forward(self, x):
  class LinearAttention (line 372) | class LinearAttention(nn.Module):
    method __init__ (line 393) | def __init__(self, query_dimensions, feature_map=None, eps=1e-6,
    method forward (line 406) | def forward(self, queries, keys, values, attn_mask, query_lengths,

FILE: basicsr/archs/RFDN_arch.py
  function conv_layer (line 8) | def conv_layer(in_channels, out_channels, kernel_size, stride=1, dilatio...
  function norm (line 14) | def norm(norm_type, nc):
  function pad (line 25) | def pad(pad_type, padding):
  function get_valid_padding (line 38) | def get_valid_padding(kernel_size, dilation):
  function conv_block (line 44) | def conv_block(in_nc, out_nc, kernel_size, stride=1, dilation=1, groups=...
  function activation (line 57) | def activation(act_type, inplace=True, neg_slope=0.05, n_prelu=1):
  class ShortcutBlock (line 70) | class ShortcutBlock(nn.Module):
    method __init__ (line 71) | def __init__(self, submodule):
    method forward (line 75) | def forward(self, x):
  function mean_channels (line 80) | def mean_channels(F):
  function stdv_channels (line 86) | def stdv_channels(F):
  function sequential (line 93) | def sequential(*args):
  class ESA (line 108) | class ESA(nn.Module):
    method __init__ (line 109) | def __init__(self, n_feats, conv):
    method forward (line 122) | def forward(self, x):
  class RFDB (line 137) | class RFDB(nn.Module):
    method __init__ (line 138) | def __init__(self, in_channels, distillation_rate=0.25):
    method forward (line 153) | def forward(self, input):
  function pixelshuffle_block (line 174) | def pixelshuffle_block(in_channels, out_channels, upscale_factor=2, kern...
  function make_model (line 180) | def make_model(args, parent=False):
  class RFDN (line 186) | class RFDN(nn.Module):
    method __init__ (line 187) | def __init__(self, in_nc=3, nf=50, num_modules=4, out_nc=3, upscale=4):
    method forward (line 205) | def forward(self, input):
    method set_scale (line 220) | def set_scale(self, scale_idx):

FILE: basicsr/archs/Upsamplers.py
  class PA (line 14) | class PA(nn.Module):
    method __init__ (line 17) | def __init__(self, nf):
    method forward (line 22) | def forward(self, x):
  class PA_UP (line 30) | class PA_UP(nn.Module):
    method __init__ (line 31) | def __init__(self, nf, unf, out_nc, scale=4, conv=nn.Conv2d):
    method forward (line 45) | def forward(self, fea):
  class PA_UP_Dropout (line 55) | class PA_UP_Dropout(nn.Module):
    method __init__ (line 56) | def __init__(self, nf, unf, out_nc, scale=4, conv=nn.Conv2d, P=0.7):
    method forward (line 71) | def forward(self, fea):
  class UpsampleOneStep (line 82) | class UpsampleOneStep(nn.Sequential):
    method __init__ (line 90) | def __init__(self, scale, num_feat, num_out_ch, input_resolution=None):
    method flops (line 98) | def flops(self):
  class PixelShuffleDirect (line 104) | class PixelShuffleDirect(nn.Module):
    method __init__ (line 105) | def __init__(self, scale, num_feat, num_out_ch, input_resolution=None):
    method forward (line 109) | def forward(self, x):
  class PixelShuffleBlcok (line 113) | class PixelShuffleBlcok(nn.Module):
    method __init__ (line 114) | def __init__(self, in_feat, num_feat, num_out_ch):
    method forward (line 126) | def forward(self, x):
  class NearestConv (line 132) | class NearestConv(nn.Module):
    method __init__ (line 133) | def __init__(self, in_ch, num_feat, num_out_ch, conv=nn.Conv2d):
    method forward (line 143) | def forward(self, x):
  class NearestConvDropout (line 151) | class NearestConvDropout(nn.Module):
    method __init__ (line 152) | def __init__(self, in_ch, num_feat, num_out_ch, P=0.7):
    method forward (line 163) | def forward(self, x):

FILE: basicsr/archs/__init__.py
  function build_network (line 19) | def build_network(opt):

FILE: basicsr/archs/arch_util.py
  function default_init_weights (line 18) | def default_init_weights(module_list, scale=1, bias_fill=0, **kwargs):
  function make_layer (line 48) | def make_layer(basic_block, num_basic_block, **kwarg):
  class ResidualBlockNoBN (line 64) | class ResidualBlockNoBN(nn.Module):
    method __init__ (line 79) | def __init__(self, num_feat=64, res_scale=1, pytorch_init=False):
    method forward (line 89) | def forward(self, x):
  class Upsample (line 95) | class Upsample(nn.Sequential):
    method __init__ (line 103) | def __init__(self, scale, num_feat):
  function flow_warp (line 117) | def flow_warp(x, flow, interp_mode='bilinear', padding_mode='zeros', ali...
  function resize_flow (line 151) | def resize_flow(flow, size_type, sizes, interp_mode='bilinear', align_co...
  function pixel_unshuffle (line 190) | def pixel_unshuffle(x, scale):
  class DCNv2Pack (line 209) | class DCNv2Pack(ModulatedDeformConvPack):
    method forward (line 220) | def forward(self, x, feat):
  function _no_grad_trunc_normal_ (line 239) | def _no_grad_trunc_normal_(tensor, mean, std, a, b):
  function trunc_normal_ (line 277) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.):
  function _ntuple (line 304) | def _ntuple(n):

FILE: basicsr/archs/rfdnfinalB5_arch.py
  class ESA (line 18) | class ESA(nn.Module):
    method __init__ (line 19) | def __init__(self, num_feat=50, conv=nn.Conv2d, p=0.25):
    method forward (line 36) | def forward(self, input):
  class RFDB (line 52) | class RFDB(nn.Module):
    method __init__ (line 53) | def __init__(self, in_channels, out_channels, distillation_rate=0.25, ...
    method forward (line 77) | def forward(self, input):
  function make_layer (line 102) | def make_layer(block, n_layers):
  class RFDNFINALB5 (line 110) | class RFDNFINALB5(nn.Module):
    method __init__ (line 111) | def __init__(self, num_in_ch=3, num_feat=50, num_block=4, num_out_ch=3...
    method forward (line 155) | def forward(self, input):

FILE: basicsr/archs/vgg_arch.py
  function insert_bn (line 36) | def insert_bn(names):
  class VGGFeatureExtractor (line 55) | class VGGFeatureExtractor(nn.Module):
    method __init__ (line 78) | def __init__(self,
    method forward (line 141) | def forward(self, x):

FILE: basicsr/data/__init__.py
  function build_dataset (line 25) | def build_dataset(dataset_opt):
  function build_dataloader (line 40) | def build_dataloader(dataset, dataset_opt, num_gpu=1, dist=False, sample...
  function worker_init_fn (line 97) | def worker_init_fn(worker_id, num_workers, rank, seed):

FILE: basicsr/data/data_sampler.py
  class EnlargedSampler (line 6) | class EnlargedSampler(Sampler):
    method __init__ (line 21) | def __init__(self, dataset, num_replicas, rank, ratio=1):
    method __iter__ (line 29) | def __iter__(self):
    method __len__ (line 44) | def __len__(self):
    method set_epoch (line 47) | def set_epoch(self, epoch):

FILE: basicsr/data/data_util.py
  function read_img_seq (line 11) | def read_img_seq(path, require_mod_crop=False, scale=1, return_imgname=F...
  function generate_frame_indices (line 43) | def generate_frame_indices(crt_idx, max_frame_num, num_frames, padding='...
  function paired_paths_from_lmdb (line 95) | def paired_paths_from_lmdb(folders, keys):
  function paired_paths_from_meta_info_file (line 154) | def paired_paths_from_meta_info_file(folders, keys, meta_info_file, file...
  function paired_paths_from_folder (line 198) | def paired_paths_from_folder(folders, keys, filename_tmpl):
  function paths_from_folder (line 234) | def paths_from_folder(folder):
  function paths_from_lmdb (line 249) | def paths_from_lmdb(folder):
  function generate_gaussian_kernel (line 265) | def generate_gaussian_kernel(kernel_size=13, sigma=1.6):
  function duf_downsample (line 283) | def duf_downsample(x, kernel_size=13, scale=4):

FILE: basicsr/data/degradations.py
  function sigma_matrix2 (line 16) | def sigma_matrix2(sig_x, sig_y, theta):
  function mesh_grid (line 32) | def mesh_grid(kernel_size):
  function pdf2 (line 50) | def pdf2(sigma_matrix, grid):
  function cdf2 (line 66) | def cdf2(d_matrix, grid):
  function bivariate_Gaussian (line 84) | def bivariate_Gaussian(kernel_size, sig_x, sig_y, theta, grid=None, isot...
  function bivariate_generalized_Gaussian (line 112) | def bivariate_generalized_Gaussian(kernel_size, sig_x, sig_y, theta, bet...
  function bivariate_plateau (line 147) | def bivariate_plateau(kernel_size, sig_x, sig_y, theta, beta, grid=None,...
  function random_bivariate_Gaussian (line 179) | def random_bivariate_Gaussian(kernel_size,
  function random_bivariate_generalized_Gaussian (line 223) | def random_bivariate_generalized_Gaussian(kernel_size,
  function random_bivariate_plateau (line 275) | def random_bivariate_plateau(kernel_size,
  function random_mixed_kernels (line 327) | def random_mixed_kernels(kernel_list,
  function circular_lowpass_kernel (line 392) | def circular_lowpass_kernel(cutoff, kernel_size, pad_to=0):
  function generate_gaussian_noise (line 420) | def generate_gaussian_noise(img, sigma=10, gray_noise=False):
  function add_gaussian_noise (line 439) | def add_gaussian_noise(img, sigma=10, clip=True, rounds=False, gray_nois...
  function generate_gaussian_noise_pt (line 461) | def generate_gaussian_noise_pt(img, sigma=10, gray_noise=0):
  function add_gaussian_noise_pt (line 493) | def add_gaussian_noise_pt(img, sigma=10, gray_noise=0, clip=True, rounds...
  function random_generate_gaussian_noise (line 516) | def random_generate_gaussian_noise(img, sigma_range=(0, 10), gray_prob=0):
  function random_add_gaussian_noise (line 525) | def random_add_gaussian_noise(img, sigma_range=(0, 1.0), gray_prob=0, cl...
  function random_generate_gaussian_noise_pt (line 537) | def random_generate_gaussian_noise_pt(img, sigma_range=(0, 10), gray_pro...
  function random_add_gaussian_noise_pt (line 545) | def random_add_gaussian_noise_pt(img, sigma_range=(0, 1.0), gray_prob=0,...
  function generate_poisson_noise (line 560) | def generate_poisson_noise(img, scale=1.0, gray_noise=False):
  function add_poisson_noise (line 587) | def add_poisson_noise(img, scale=1.0, clip=True, rounds=False, gray_nois...
  function generate_poisson_noise_pt (line 610) | def generate_poisson_noise_pt(img, scale=1.0, gray_noise=0):
  function add_poisson_noise_pt (line 658) | def add_poisson_noise_pt(img, scale=1.0, clip=True, rounds=False, gray_n...
  function random_generate_poisson_noise (line 686) | def random_generate_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0):
  function random_add_poisson_noise (line 695) | def random_add_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0, cli...
  function random_generate_poisson_noise_pt (line 707) | def random_generate_poisson_noise_pt(img, scale_range=(0, 1.0), gray_pro...
  function random_add_poisson_noise_pt (line 715) | def random_add_poisson_noise_pt(img, scale_range=(0, 1.0), gray_prob=0, ...
  function add_jpg_compression (line 732) | def add_jpg_compression(img, quality=90):
  function random_add_jpg_compression (line 751) | def random_add_jpg_compression(img, quality_range=(90, 100)):

FILE: basicsr/data/ffhq_dataset.py
  class FFHQDataset (line 13) | class FFHQDataset(data.Dataset):
    method __init__ (line 26) | def __init__(self, opt):
    method __getitem__ (line 47) | def __getitem__(self, index):
    method __len__ (line 79) | def __len__(self):

FILE: basicsr/data/paired_image_dataset.py
  class PairedImageDataset (line 12) | class PairedImageDataset(data.Dataset):
    method __init__ (line 41) | def __init__(self, opt):
    method __getitem__ (line 66) | def __getitem__(self, index):
    method __len__ (line 108) | def __len__(self):

FILE: basicsr/data/prefetch_dataloader.py
  class PrefetchGenerator (line 7) | class PrefetchGenerator(threading.Thread):
    method __init__ (line 18) | def __init__(self, generator, num_prefetch_queue):
    method run (line 25) | def run(self):
    method __next__ (line 30) | def __next__(self):
    method __iter__ (line 36) | def __iter__(self):
  class PrefetchDataLoader (line 40) | class PrefetchDataLoader(DataLoader):
    method __init__ (line 55) | def __init__(self, num_prefetch_queue, **kwargs):
    method __iter__ (line 59) | def __iter__(self):
  class CPUPrefetcher (line 63) | class CPUPrefetcher():
    method __init__ (line 70) | def __init__(self, loader):
    method next (line 74) | def next(self):
    method reset (line 80) | def reset(self):
  class CUDAPrefetcher (line 84) | class CUDAPrefetcher():
    method __init__ (line 97) | def __init__(self, loader, opt):
    method preload (line 105) | def preload(self):
    method next (line 117) | def next(self):
    method reset (line 123) | def reset(self):

FILE: basicsr/data/reds_dataset.py
  class REDSDataset (line 14) | class REDSDataset(data.Dataset):
    method __init__ (line 53) | def __init__(self, opt):
    method __getitem__ (line 99) | def __getitem__(self, index):
    method __len__ (line 208) | def __len__(self):
  class REDSRecurrentDataset (line 213) | class REDSRecurrentDataset(data.Dataset):
    method __init__ (line 252) | def __init__(self, opt):
    method __getitem__ (line 298) | def __getitem__(self, index):
    method __len__ (line 359) | def __len__(self):

FILE: basicsr/data/single_image_dataset.py
  class SingleImageDataset (line 12) | class SingleImageDataset(data.Dataset):
    method __init__ (line 28) | def __init__(self, opt):
    method __getitem__ (line 48) | def __getitem__(self, index):
    method __len__ (line 68) | def __len__(self):

FILE: basicsr/data/transforms.py
  function mod_crop (line 6) | def mod_crop(img, scale):
  function paired_random_crop (line 26) | def paired_random_crop(img_gts, img_lqs, gt_patch_size, scale, gt_path=N...
  function augment (line 94) | def augment(imgs, hflip=True, rotation=True, flows=None, return_status=F...
  function img_rotate (line 161) | def img_rotate(img, angle, center=None, scale=1.0):

FILE: basicsr/data/video_test_dataset.py
  class VideoTestDataset (line 12) | class VideoTestDataset(data.Dataset):
    method __init__ (line 45) | def __init__(self, opt):
    method __getitem__ (line 101) | def __getitem__(self, index):
    method __len__ (line 128) | def __len__(self):
  class VideoTestVimeo90KDataset (line 133) | class VideoTestVimeo90KDataset(data.Dataset):
    method __init__ (line 153) | def __init__(self, opt):
    method __getitem__ (line 181) | def __getitem__(self, index):
    method __len__ (line 197) | def __len__(self):
  class VideoTestDUFDataset (line 202) | class VideoTestDUFDataset(VideoTestDataset):
    method __getitem__ (line 215) | def __getitem__(self, index):
  class VideoRecurrentTestDataset (line 255) | class VideoRecurrentTestDataset(VideoTestDataset):
    method __init__ (line 266) | def __init__(self, opt):
    method __getitem__ (line 271) | def __getitem__(self, index):
    method __len__ (line 286) | def __len__(self):

FILE: basicsr/data/vimeo90k_dataset.py
  class Vimeo90KDataset (line 12) | class Vimeo90KDataset(data.Dataset):
    method __init__ (line 52) | def __init__(self, opt):
    method __getitem__ (line 77) | def __getitem__(self, index):
    method __len__ (line 125) | def __len__(self):
  class Vimeo90KRecurrentDataset (line 130) | class Vimeo90KRecurrentDataset(Vimeo90KDataset):
    method __init__ (line 132) | def __init__(self, opt):
    method __getitem__ (line 138) | def __getitem__(self, index):
    method __len__ (line 191) | def __len__(self):

FILE: basicsr/losses/__init__.py
  function build_loss (line 14) | def build_loss(opt):

FILE: basicsr/losses/loss_util.py
  function reduce_loss (line 5) | def reduce_loss(loss, reduction):
  function weight_reduce_loss (line 25) | def weight_reduce_loss(loss, weight=None, reduction='mean'):
  function weighted_loss (line 57) | def weighted_loss(loss_func):

FILE: basicsr/losses/losses.py
  function l1_loss (line 15) | def l1_loss(pred, target):
  function mse_loss (line 20) | def mse_loss(pred, target):
  function charbonnier_loss (line 25) | def charbonnier_loss(pred, target, eps=1e-12):
  class L1Loss (line 30) | class L1Loss(nn.Module):
    method __init__ (line 39) | def __init__(self, loss_weight=1.0, reduction='mean'):
    method forward (line 47) | def forward(self, pred, target, weight=None, **kwargs):
  class MSELoss (line 58) | class MSELoss(nn.Module):
    method __init__ (line 67) | def __init__(self, loss_weight=1.0, reduction='mean'):
    method forward (line 75) | def forward(self, pred, target, weight=None, **kwargs):
  class CharbonnierLoss (line 86) | class CharbonnierLoss(nn.Module):
    method __init__ (line 100) | def __init__(self, loss_weight=1.0, reduction='mean', eps=1e-12):
    method forward (line 109) | def forward(self, pred, target, weight=None, **kwargs):
  class WeightedTVLoss (line 120) | class WeightedTVLoss(L1Loss):
    method __init__ (line 127) | def __init__(self, loss_weight=1.0, reduction='mean'):
    method forward (line 132) | def forward(self, pred, weight=None):
  class PerceptualLoss (line 149) | class PerceptualLoss(nn.Module):
    method __init__ (line 172) | def __init__(self,
    method forward (line 200) | def forward(self, x, gt):
    method _gram_mat (line 242) | def _gram_mat(self, x):
  class GANLoss (line 259) | class GANLoss(nn.Module):
    method __init__ (line 271) | def __init__(self, gan_type, real_label_val=1.0, fake_label_val=0.0, l...
    method _wgan_loss (line 291) | def _wgan_loss(self, input, target):
    method _wgan_softplus_loss (line 303) | def _wgan_softplus_loss(self, input, target):
    method get_target_label (line 320) | def get_target_label(self, input, target_is_real):
    method forward (line 337) | def forward(self, input, target_is_real, is_disc=False):
  class MultiScaleGANLoss (line 364) | class MultiScaleGANLoss(GANLoss):
    method __init__ (line 369) | def __init__(self, gan_type, real_label_val=1.0, fake_label_val=0.0, l...
    method forward (line 372) | def forward(self, input, target_is_real, is_disc=False):
  function r1_penalty (line 391) | def r1_penalty(real_pred, real_img):
  function g_path_regularize (line 408) | def g_path_regularize(fake_img, latents, mean_path_length, decay=0.01):
  function gradient_penalty_loss (line 420) | def gradient_penalty_loss(discriminator, real_data, fake_data, weight=No...
  class GANFeatLoss (line 460) | class GANFeatLoss(nn.Module):
    method __init__ (line 470) | def __init__(self, criterion='l1', loss_weight=1.0, reduction='mean'):
    method forward (line 483) | def forward(self, pred_fake, pred_real):

FILE: basicsr/metrics/__init__.py
  function calculate_metric (line 10) | def calculate_metric(data, opt):

FILE: basicsr/metrics/fid.py
  function load_patched_inception_v3 (line 10) | def load_patched_inception_v3(device='cuda', resize_input=True, normaliz...
  function extract_inception_features (line 19) | def extract_inception_features(data_generator, inception, len_generator=...
  function calculate_fid (line 50) | def calculate_fid(mu1, sigma1, mu2, sigma2, eps=1e-6):

FILE: basicsr/metrics/metric_util.py
  function reorder_image (line 6) | def reorder_image(img, input_order='HWC'):
  function to_y_channel (line 32) | def to_y_channel(img):

FILE: basicsr/metrics/niqe.py
  function estimate_aggd_param (line 13) | def estimate_aggd_param(block):
  function compute_feature (line 41) | def compute_feature(block):
  function niqe (line 68) | def niqe(img, mu_pris_param, cov_pris_param, gaussian_window, block_size...
  function calculate_niqe (line 144) | def calculate_niqe(img, crop_border, input_order='HWC', convert_to='y', ...

FILE: basicsr/metrics/psnr_ssim.py
  function calculate_psnr (line 9) | def calculate_psnr(img, img2, crop_border, input_order='HWC', test_y_cha...
  function _ssim (line 49) | def _ssim(img, img2):
  function calculate_ssim (line 84) | def calculate_ssim(img, img2, crop_border, input_order='HWC', test_y_cha...

FILE: basicsr/models/__init__.py
  function build_model (line 19) | def build_model(opt):

FILE: basicsr/models/base_model.py
  class BaseModel (line 13) | class BaseModel():
    method __init__ (line 16) | def __init__(self, opt):
    method feed_data (line 23) | def feed_data(self, data):
    method optimize_parameters (line 26) | def optimize_parameters(self):
    method get_current_visuals (line 29) | def get_current_visuals(self):
    method save (line 32) | def save(self, epoch, current_iter):
    method validation (line 36) | def validation(self, dataloader, current_iter, tb_logger, save_img=Fal...
    method _initialize_best_metric_results (line 50) | def _initialize_best_metric_results(self, dataset_name):
    method _update_best_metric_result (line 65) | def _update_best_metric_result(self, dataset_name, metric, val, curren...
    method model_ema (line 75) | def model_ema(self, decay=0.999):
    method get_current_log (line 84) | def get_current_log(self):
    method model_to_device (line 87) | def model_to_device(self, net):
    method get_optimizer (line 103) | def get_optimizer(self, optim_type, params, lr, **kwargs):
    method setup_schedulers (line 112) | def setup_schedulers(self):
    method get_bare_model (line 125) | def get_bare_model(self, net):
    method print_network (line 134) | def print_network(self, net):
    method _set_lr (line 153) | def _set_lr(self, lr_groups_l):
    method _get_init_lr (line 163) | def _get_init_lr(self):
    method update_learning_rate (line 171) | def update_learning_rate(self, current_iter, warmup_iter=-1):
    method get_current_learning_rate (line 194) | def get_current_learning_rate(self):
    method save_network (line 198) | def save_network(self, net, net_label, current_iter, param_key='params'):
    method _print_different_keys_loading (line 244) | def _print_different_keys_loading(self, crt_net, load_net, strict=True):
    method load_network (line 279) | def load_network(self, net, load_path, strict=True, param_key='params'):
    method save_training_state (line 308) | def save_training_state(self, epoch, current_iter):
    method resume_training (line 342) | def resume_training(self, resume_state):
    method reduce_loss_dict (line 357) | def reduce_loss_dict(self, loss_dict):

FILE: basicsr/models/edvr_model.py
  class EDVRModel (line 7) | class EDVRModel(VideoBaseModel):
    method __init__ (line 13) | def __init__(self, opt):
    method setup_optimizers (line 18) | def setup_optimizers(self):
    method optimize_parameters (line 48) | def optimize_parameters(self, current_iter):

FILE: basicsr/models/esrgan_model.py
  class ESRGANModel (line 9) | class ESRGANModel(SRGANModel):
    method optimize_parameters (line 12) | def optimize_parameters(self, current_iter):

FILE: basicsr/models/hifacegan_model.py
  class HiFaceGANModel (line 15) | class HiFaceGANModel(SRModel):
    method init_training_settings (line 21) | def init_training_settings(self):
    method setup_optimizers (line 63) | def setup_optimizers(self):
    method discriminate (line 74) | def discriminate(self, input_lq, output, ground_truth):
    method _divide_pred (line 98) | def _divide_pred(pred):
    method optimize_parameters (line 116) | def optimize_parameters(self, current_iter):
    method validation (line 194) | def validation(self, dataloader, current_iter, tb_logger, save_img=Fal...
    method nondist_validation (line 216) | def nondist_validation(self, dataloader, current_iter, tb_logger, save...
    method save (line 282) | def save(self, epoch, current_iter):

FILE: basicsr/models/lr_scheduler.py
  class MultiStepRestartLR (line 6) | class MultiStepRestartLR(_LRScheduler):
    method __init__ (line 19) | def __init__(self, optimizer, milestones, gamma=0.1, restarts=(0, ), r...
    method get_lr (line 27) | def get_lr(self):
  function get_position_from_periods (line 36) | def get_position_from_periods(iteration, cumulative_period):
  class CosineAnnealingRestartLR (line 57) | class CosineAnnealingRestartLR(_LRScheduler):
    method __init__ (line 77) | def __init__(self, optimizer, periods, restart_weights=(1, ), eta_min=...
    method get_lr (line 86) | def get_lr(self):

FILE: basicsr/models/sr_model.py
  class SRModel (line 15) | class SRModel(BaseModel):
    method __init__ (line 18) | def __init__(self, opt):
    method init_training_settings (line 35) | def init_training_settings(self):
    method setup_optimizers (line 73) | def setup_optimizers(self):
    method feed_data (line 87) | def feed_data(self, data):
    method optimize_parameters (line 92) | def optimize_parameters(self, current_iter):
    method test (line 121) | def test(self):
    method dist_validation (line 132) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img):
    method nondist_validation (line 136) | def nondist_validation(self, dataloader, current_iter, tb_logger, save...
    method _log_validation_metric_values (line 203) | def _log_validation_metric_values(self, current_iter, dataset_name, tb...
    method get_current_visuals (line 218) | def get_current_visuals(self):
    method save (line 226) | def save(self, epoch, current_iter):

FILE: basicsr/models/srgan_model.py
  class SRGANModel (line 12) | class SRGANModel(SRModel):
    method init_training_settings (line 15) | def init_training_settings(self):
    method setup_optimizers (line 69) | def setup_optimizers(self):
    method optimize_parameters (line 80) | def optimize_parameters(self, current_iter):
    method save (line 138) | def save(self, epoch, current_iter):

FILE: basicsr/models/stylegan2_model.py
  class StyleGAN2Model (line 18) | class StyleGAN2Model(BaseModel):
    method __init__ (line 21) | def __init__(self, opt):
    method init_training_settings (line 42) | def init_training_settings(self):
    method setup_optimizers (line 88) | def setup_optimizers(self):
    method feed_data (line 169) | def feed_data(self, data):
    method make_noise (line 172) | def make_noise(self, batch, num_noise):
    method mixing_noise (line 179) | def mixing_noise(self, batch, prob):
    method optimize_parameters (line 185) | def optimize_parameters(self, current_iter):
    method test (line 256) | def test(self):
    method dist_validation (line 261) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img):
    method nondist_validation (line 265) | def nondist_validation(self, dataloader, current_iter, tb_logger, save...
    method save (line 280) | def save(self, epoch, current_iter):

FILE: basicsr/models/swinir_model.py
  class SwinIRModel (line 9) | class SwinIRModel(SRModel):
    method test (line 11) | def test(self):

FILE: basicsr/models/video_base_model.py
  class VideoBaseModel (line 15) | class VideoBaseModel(SRModel):
    method dist_validation (line 18) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img):
    method nondist_validation (line 113) | def nondist_validation(self, dataloader, current_iter, tb_logger, save...
    method _log_validation_metric_values (line 118) | def _log_validation_metric_values(self, current_iter, dataset_name, tb...

FILE: basicsr/models/video_gan_model.py
  class VideoGANModel (line 7) | class VideoGANModel(SRGANModel, VideoBaseModel):

FILE: basicsr/models/video_recurrent_gan_model.py
  class VideoRecurrentGANModel (line 12) | class VideoRecurrentGANModel(VideoRecurrentModel):
    method init_training_settings (line 14) | def init_training_settings(self):
    method setup_optimizers (line 68) | def setup_optimizers(self):
    method optimize_parameters (line 101) | def optimize_parameters(self, current_iter):
    method save (line 174) | def save(self, epoch, current_iter):

FILE: basicsr/models/video_recurrent_model.py
  class VideoRecurrentModel (line 15) | class VideoRecurrentModel(VideoBaseModel):
    method __init__ (line 17) | def __init__(self, opt):
    method setup_optimizers (line 22) | def setup_optimizers(self):
    method optimize_parameters (line 52) | def optimize_parameters(self, current_iter):
    method dist_validation (line 66) | def dist_validation(self, dataloader, current_iter, tb_logger, save_img):
    method test (line 176) | def test(self):

FILE: basicsr/ops/dcn/deform_conv.py
  class DeformConvFunction (line 33) | class DeformConvFunction(Function):
    method forward (line 36) | def forward(ctx,
    method backward (line 75) | def backward(ctx, grad_output):
    method _output_size (line 107) | def _output_size(input, weight, padding, dilation, stride):
  class ModulatedDeformConvFunction (line 121) | class ModulatedDeformConvFunction(Function):
    method forward (line 124) | def forward(ctx,
    method backward (line 157) | def backward(ctx, grad_output):
    method _infer_shape (line 177) | def _infer_shape(ctx, input, weight):
  class DeformConv (line 191) | class DeformConv(nn.Module):
    method __init__ (line 193) | def __init__(self,
    method reset_parameters (line 225) | def reset_parameters(self):
    method forward (line 232) | def forward(self, x, offset):
  class DeformConvPack (line 248) | class DeformConvPack(DeformConv):
    method __init__ (line 266) | def __init__(self, *args, **kwargs):
    method init_offset (line 279) | def init_offset(self):
    method forward (line 283) | def forward(self, x):
  class ModulatedDeformConv (line 289) | class ModulatedDeformConv(nn.Module):
    method __init__ (line 291) | def __init__(self,
    method init_weights (line 322) | def init_weights(self):
    method forward (line 331) | def forward(self, x, offset, mask):
  class ModulatedDeformConvPack (line 336) | class ModulatedDeformConvPack(ModulatedDeformConv):
    method __init__ (line 354) | def __init__(self, *args, **kwargs):
    method init_weights (line 367) | def init_weights(self):
    method forward (line 373) | def forward(self, x):

FILE: basicsr/ops/dcn/src/deform_conv_cuda.cpp
  function shape_check (line 62) | void shape_check(at::Tensor input, at::Tensor offset, at::Tensor *gradOu...
  function deform_conv_forward_cuda (line 152) | int deform_conv_forward_cuda(at::Tensor input, at::Tensor weight,
  function deform_conv_backward_input_cuda (line 262) | int deform_conv_backward_input_cuda(at::Tensor input, at::Tensor offset,
  function deform_conv_backward_parameters_cuda (line 376) | int deform_conv_backward_parameters_cuda(
  function modulated_deform_conv_cuda_forward (line 490) | void modulated_deform_conv_cuda_forward(
  function modulated_deform_conv_cuda_backward (line 571) | void modulated_deform_conv_cuda_backward(

FILE: basicsr/ops/dcn/src/deform_conv_ext.cpp
  function deform_conv_forward (line 52) | int deform_conv_forward(at::Tensor input, at::Tensor weight,
  function deform_conv_backward_input (line 70) | int deform_conv_backward_input(at::Tensor input, at::Tensor offset,
  function deform_conv_backward_parameters (line 89) | int deform_conv_backward_parameters(
  function modulated_deform_conv_forward (line 107) | void modulated_deform_conv_forward(
  function modulated_deform_conv_backward (line 127) | void modulated_deform_conv_backward(
  function PYBIND11_MODULE (line 150) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {

FILE: basicsr/ops/fused_act/fused_act.py
  class FusedLeakyReLUFunctionBackward (line 30) | class FusedLeakyReLUFunctionBackward(Function):
    method forward (line 33) | def forward(ctx, grad_output, out, negative_slope, scale):
    method backward (line 52) | def backward(ctx, gradgrad_input, gradgrad_bias):
  class FusedLeakyReLUFunction (line 60) | class FusedLeakyReLUFunction(Function):
    method forward (line 63) | def forward(ctx, input, bias, negative_slope, scale):
    method backward (line 73) | def backward(ctx, grad_output):
  class FusedLeakyReLU (line 81) | class FusedLeakyReLU(nn.Module):
    method __init__ (line 83) | def __init__(self, channel, negative_slope=0.2, scale=2**0.5):
    method forward (line 90) | def forward(self, input):
  function fused_leaky_relu (line 94) | def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2**0.5):

FILE: basicsr/ops/fused_act/src/fused_bias_act.cpp
  function fused_bias_act (line 14) | torch::Tensor fused_bias_act(const torch::Tensor& input,
  function PYBIND11_MODULE (line 24) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {

FILE: basicsr/ops/upfirdn2d/src/upfirdn2d.cpp
  function upfirdn2d (line 13) | torch::Tensor upfirdn2d(const torch::Tensor& input, const torch::Tensor&...
  function PYBIND11_MODULE (line 22) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {

FILE: basicsr/ops/upfirdn2d/upfirdn2d.py
  class UpFirDn2dBackward (line 30) | class UpFirDn2dBackward(Function):
    method forward (line 33) | def forward(ctx, grad_output, kernel, grad_kernel, up, down, pad, g_pa...
    method backward (line 73) | def backward(ctx, gradgrad_input):
  class UpFirDn2d (line 97) | class UpFirDn2d(Function):
    method forward (line 100) | def forward(ctx, input, kernel, up, down, pad):
    method backward (line 135) | def backward(ctx, grad_output):
  function upfirdn2d (line 153) | def upfirdn2d(input, kernel, up=1, down=1, pad=(0, 0)):
  function upfirdn2d_native (line 162) | def upfirdn2d_native(input, kernel, up_x, up_y, down_x, down_y, pad_x0, ...

FILE: basicsr/test.py
  function test_pipeline (line 11) | def test_pipeline(root_path):

FILE: basicsr/train.py
  function init_tb_loggers (line 17) | def init_tb_loggers(opt):
  function create_train_val_dataloader (line 29) | def create_train_val_dataloader(opt, logger):
  function load_resume_state (line 68) | def load_resume_state(opt):
  function train_pipeline (line 91) | def train_pipeline(root_path):

FILE: basicsr/utils/diffjpeg.py
  function diff_round (line 26) | def diff_round(x):
  function quality_to_factor (line 32) | def quality_to_factor(quality):
  class RGB2YCbCrJpeg (line 49) | class RGB2YCbCrJpeg(nn.Module):
    method __init__ (line 53) | def __init__(self):
    method forward (line 60) | def forward(self, image):
  class ChromaSubsampling (line 73) | class ChromaSubsampling(nn.Module):
    method __init__ (line 77) | def __init__(self):
    method forward (line 80) | def forward(self, image):
  class BlockSplitting (line 98) | class BlockSplitting(nn.Module):
    method __init__ (line 102) | def __init__(self):
    method forward (line 106) | def forward(self, image):
  class DCT8x8 (line 121) | class DCT8x8(nn.Module):
    method __init__ (line 125) | def __init__(self):
    method forward (line 134) | def forward(self, image):
  class YQuantize (line 148) | class YQuantize(nn.Module):
    method __init__ (line 155) | def __init__(self, rounding):
    method forward (line 160) | def forward(self, image, factor=1):
  class CQuantize (line 178) | class CQuantize(nn.Module):
    method __init__ (line 185) | def __init__(self, rounding):
    method forward (line 190) | def forward(self, image, factor=1):
  class CompressJpeg (line 208) | class CompressJpeg(nn.Module):
    method __init__ (line 215) | def __init__(self, rounding=torch.round):
    method forward (line 222) | def forward(self, image, factor=1):
  class YDequantize (line 247) | class YDequantize(nn.Module):
    method __init__ (line 251) | def __init__(self):
    method forward (line 255) | def forward(self, image, factor=1):
  class CDequantize (line 272) | class CDequantize(nn.Module):
    method __init__ (line 276) | def __init__(self):
    method forward (line 280) | def forward(self, image, factor=1):
  class iDCT8x8 (line 297) | class iDCT8x8(nn.Module):
    method __init__ (line 301) | def __init__(self):
    method forward (line 310) | def forward(self, image):
  class BlockMerging (line 324) | class BlockMerging(nn.Module):
    method __init__ (line 328) | def __init__(self):
    method forward (line 331) | def forward(self, patches, height, width):
  class ChromaUpsampling (line 348) | class ChromaUpsampling(nn.Module):
    method __init__ (line 352) | def __init__(self):
    method forward (line 355) | def forward(self, y, cb, cr):
  class YCbCr2RGBJpeg (line 378) | class YCbCr2RGBJpeg(nn.Module):
    method __init__ (line 382) | def __init__(self):
    method forward (line 389) | def forward(self, image):
  class DeCompressJpeg (line 401) | class DeCompressJpeg(nn.Module):
    method __init__ (line 408) | def __init__(self, rounding=torch.round):
    method forward (line 417) | def forward(self, y, cb, cr, imgh, imgw, factor=1):
  class DiffJPEG (line 449) | class DiffJPEG(nn.Module):
    method __init__ (line 457) | def __init__(self, differentiable=True):
    method forward (line 467) | def forward(self, x, quality):

FILE: basicsr/utils/dist_util.py
  function init_dist (line 10) | def init_dist(launcher, backend='nccl', **kwargs):
  function _init_dist_pytorch (line 21) | def _init_dist_pytorch(backend, **kwargs):
  function _init_dist_slurm (line 28) | def _init_dist_slurm(backend, port=None):
  function get_dist_info (line 60) | def get_dist_info():
  function master_only (line 74) | def master_only(func):

FILE: basicsr/utils/download_util.py
  function download_file_from_google_drive (line 11) | def download_file_from_google_drive(file_id, save_path):
  function get_confirm_token (line 42) | def get_confirm_token(response):
  function save_response_content (line 49) | def save_response_content(response, destination, file_size=None, chunk_s...
  function load_file_from_url (line 70) | def load_file_from_url(url, model_dir=None, progress=True, file_name=None):

FILE: basicsr/utils/face_util.py
  class FaceRestorationHelper (line 15) | class FaceRestorationHelper(object):
    method __init__ (line 18) | def __init__(self, upscale_factor, face_size=512):
    method init_dlib (line 38) | def init_dlib(self, detection_path, landmark5_path, landmark68_path):
    method free_dlib_gpu_memory (line 44) | def free_dlib_gpu_memory(self):
    method read_input_image (line 49) | def read_input_image(self, img_path):
    method detect_faces (line 53) | def detect_faces(self, img_path, upsample_num_times=1, only_keep_large...
    method get_face_landmarks_5 (line 81) | def get_face_landmarks_5(self):
    method get_face_landmarks_68 (line 88) | def get_face_landmarks_68(self):
    method warp_crop_faces (line 121) | def warp_crop_faces(self, save_cropped_path=None, save_inverse_affine_...
    method add_restored_face (line 154) | def add_restored_face(self, face):
    method paste_faces_to_input_image (line 157) | def paste_faces_to_input_image(self, save_path):
    method clean_all (line 186) | def clean_all(self):

FILE: basicsr/utils/file_client.py
  class BaseStorageBackend (line 5) | class BaseStorageBackend(metaclass=ABCMeta):
    method get (line 14) | def get(self, filepath):
    method get_text (line 18) | def get_text(self, filepath):
  class MemcachedBackend (line 22) | class MemcachedBackend(BaseStorageBackend):
    method __init__ (line 32) | def __init__(self, server_list_cfg, client_cfg, sys_path=None):
    method get (line 47) | def get(self, filepath):
    method get_text (line 54) | def get_text(self, filepath):
  class HardDiskBackend (line 58) | class HardDiskBackend(BaseStorageBackend):
    method get (line 61) | def get(self, filepath):
    method get_text (line 67) | def get_text(self, filepath):
  class LmdbBackend (line 74) | class LmdbBackend(BaseStorageBackend):
    method __init__ (line 94) | def __init__(self, db_paths, client_keys='default', readonly=True, loc...
    method get (line 114) | def get(self, filepath, client_key):
    method get_text (line 128) | def get_text(self, filepath):
  class FileClient (line 132) | class FileClient(object):
    method __init__ (line 151) | def __init__(self, backend='disk', **kwargs):
    method get (line 158) | def get(self, filepath, client_key='default'):
    method get_text (line 166) | def get_text(self, filepath):

FILE: basicsr/utils/flow_util.py
  function flowread (line 7) | def flowread(flow_path, quantize=False, concat_axis=0, *args, **kwargs):
  function flowwrite (line 45) | def flowwrite(flow, filename, quantize=False, concat_axis=0, *args, **kw...
  function quantize_flow (line 76) | def quantize_flow(flow, max_val=0.02, norm=True):
  function dequantize_flow (line 102) | def dequantize_flow(dx, dy, max_val=0.02, denorm=True):
  function quantize (line 126) | def quantize(arr, min_val, max_val, levels, dtype=np.int64):
  function dequantize (line 150) | def dequantize(arr, min_val, max_val, levels, dtype=np.float64):

FILE: basicsr/utils/img_process_util.py
  function filter2D (line 7) | def filter2D(img, kernel):
  function usm_sharp (line 34) | def usm_sharp(img, weight=0.5, radius=50, threshold=10):
  class USMSharp (line 63) | class USMSharp(torch.nn.Module):
    method __init__ (line 65) | def __init__(self, radius=50, sigma=0):
    method forward (line 74) | def forward(self, img, weight=0.5, threshold=10):

FILE: basicsr/utils/img_util.py
  function img2tensor (line 9) | def img2tensor(imgs, bgr2rgb=True, float32=True):
  function tensor2img (line 38) | def tensor2img(tensor, rgb2bgr=True, out_type=np.uint8, min_max=(0, 1)):
  function tensor2img_fast (line 97) | def tensor2img_fast(tensor, rgb2bgr=True, min_max=(0, 1)):
  function imfrombytes (line 114) | def imfrombytes(content, flag='color', float32=False):
  function imwrite (line 135) | def imwrite(img, file_path, params=None, auto_mkdir=True):
  function crop_border (line 156) | def crop_border(imgs, crop_border):

FILE: basicsr/utils/lmdb_util.py
  function make_lmdb_from_imgs (line 9) | def make_lmdb_from_imgs(data_path,
  function read_img_worker (line 132) | def read_img_worker(path, key, compress_level):
  class LmdbMaker (line 156) | class LmdbMaker():
    method __init__ (line 167) | def __init__(self, lmdb_path, map_size=1024**4, batch=5000, compress_l...
    method put (line 182) | def put(self, img_byte, key, img_shape):
    method close (line 193) | def close(self):

FILE: basicsr/utils/logger.py
  class AvgTimer (line 10) | class AvgTimer():
    method __init__ (line 12) | def __init__(self, window=200):
    method start (line 20) | def start(self):
    method record (line 23) | def record(self):
    method get_current_time (line 38) | def get_current_time(self):
    method get_avg_time (line 41) | def get_avg_time(self):
  class MessageLogger (line 45) | class MessageLogger():
    method __init__ (line 58) | def __init__(self, opt, start_iter=1, tb_logger=None):
    method reset_start_time (line 68) | def reset_start_time(self):
    method __call__ (line 72) | def __call__(self, log_vars):
  function init_tb_logger (line 119) | def init_tb_logger(log_dir):
  function init_wandb_logger (line 126) | def init_wandb_logger(opt):
  function get_root_logger (line 149) | def get_root_logger(logger_name='basicsr', log_level=logging.INFO, log_f...
  function get_env_info (line 191) | def get_env_info():

FILE: basicsr/utils/matlab_functions.py
  function cubic (line 6) | def cubic(x):
  function calculate_weights_indices (line 16) | def calculate_weights_indices(in_length, out_length, scale, kernel, kern...
  function imresize (line 86) | def imresize(img, scale, antialiasing=True):
  function rgb2ycbcr (line 181) | def rgb2ycbcr(img, y_only=False):
  function bgr2ycbcr (line 214) | def bgr2ycbcr(img, y_only=False):
  function ycbcr2rgb (line 247) | def ycbcr2rgb(img):
  function ycbcr2bgr (line 276) | def ycbcr2bgr(img):
  function _convert_input_type_range (line 305) | def _convert_input_type_range(img):
  function _convert_output_type_range (line 332) | def _convert_output_type_range(img, dst_type):

FILE: basicsr/utils/misc.py
  function set_random_seed (line 11) | def set_random_seed(seed):
  function get_time_str (line 20) | def get_time_str():
  function mkdir_and_rename (line 24) | def mkdir_and_rename(path):
  function make_exp_dirs (line 38) | def make_exp_dirs(opt):
  function scandir (line 52) | def scandir(dir_path, suffix=None, recursive=False, full_path=False):
  function check_resume (line 94) | def check_resume(opt, resume_iter):
  function sizeof_fmt (line 127) | def sizeof_fmt(size, suffix='B'):

FILE: basicsr/utils/options.py
  function ordered_yaml (line 12) | def ordered_yaml():
  function dict2str (line 37) | def dict2str(opt, indent_level=1):
  function _postprocess_yml_value (line 58) | def _postprocess_yml_value(value):
  function parse_options (line 82) | def parse_options(root_path, is_train=True):
  function copy_opt_file (line 181) | def copy_opt_file(opt_file, experiments_root):

FILE: basicsr/utils/registry.py
  class Registry (line 4) | class Registry():
    method __init__ (line 30) | def __init__(self, name):
    method _do_register (line 38) | def _do_register(self, name, obj):
    method register (line 43) | def register(self, obj=None):
    method get (line 62) | def get(self, name):
    method __contains__ (line 68) | def __contains__(self, name):
    method __iter__ (line 71) | def __iter__(self):
    method keys (line 74) | def keys(self):

FILE: scripts/data_preparation/create_lmdb.py
  function create_lmdb_for_div2k (line 8) | def create_lmdb_for_div2k():
  function prepare_keys_div2k (line 45) | def prepare_keys_div2k(folder_path):
  function create_lmdb_for_reds (line 62) | def create_lmdb_for_reds():
  function prepare_keys_reds (line 85) | def prepare_keys_reds(folder_path):
  function create_lmdb_for_vimeo90k (line 102) | def create_lmdb_for_vimeo90k():
  function prepare_keys_vimeo90k (line 123) | def prepare_keys_vimeo90k(folder_path, train_list_path, mode):

FILE: scripts/data_preparation/download_datasets.py
  function download_dataset (line 9) | def download_dataset(dataset, file_ids):

FILE: scripts/data_preparation/extract_images_from_tfrecords.py
  function convert_celeba_tfrecords (line 10) | def convert_celeba_tfrecords(tf_file, log_resolution, save_root, save_ty...
  function convert_ffhq_tfrecords (line 69) | def convert_ffhq_tfrecords(tf_file, log_resolution, save_root, save_type...
  function make_ffhq_lmdb_from_imgs (line 119) | def make_ffhq_lmdb_from_imgs(folder_path, log_resolution, save_root, sav...

FILE: scripts/data_preparation/extract_subimages.py
  function main (line 12) | def main():
  function extract_subimages (line 79) | def extract_subimages(opt):
  function worker (line 109) | def worker(path, opt):

FILE: scripts/data_preparation/generate_meta_info.py
  function generate_meta_info_div2k (line 7) | def generate_meta_info_div2k():

FILE: scripts/data_preparation/prepare_hifacegan_dataset.py
  class Mosaic16x (line 6) | class Mosaic16x:
    method augment_image (line 13) | def augment_image(self, x):
  class DegradationSimulator (line 25) | class DegradationSimulator:
    method __init__ (line 35) | def __init__(self, ):
    method create_training_dataset (line 80) | def create_training_dataset(self, deg, gt_folder, lq_folder=None):

FILE: scripts/data_preparation/regroup_reds_dataset.py
  function regroup_reds_dataset (line 5) | def regroup_reds_dataset(train_path, val_path):

FILE: scripts/download_pretrained_models.py
  function download_pretrained_models (line 8) | def download_pretrained_models(method, file_ids):

FILE: scripts/metrics/calculate_fid_folder.py
  function calculate_fid_folder (line 11) | def calculate_fid_folder():

FILE: scripts/metrics/calculate_fid_stats_from_datasets.py
  function calculate_stats_from_dataset (line 11) | def calculate_stats_from_dataset():

FILE: scripts/metrics/calculate_lpips.py
  function main (line 15) | def main():

FILE: scripts/metrics/calculate_niqe.py
  function main (line 10) | def main(args):

FILE: scripts/metrics/calculate_psnr_ssim.py
  function main (line 11) | def main(args):

FILE: scripts/metrics/calculate_stylegan2_fid.py
  function calculate_stylegan2_fid (line 11) | def calculate_stylegan2_fid():

FILE: scripts/model_conversion/convert_dfdnet.py
  function convert_net (line 7) | def convert_net(ori_net, crt_net):

FILE: scripts/model_conversion/convert_models.py
  function convert_edvr (line 4) | def convert_edvr():
  function convert_edsr (line 102) | def convert_edsr(ori_net_path, crt_net_path, save_path, num_block=32):
  function convert_rcan_model (line 138) | def convert_rcan_model():
  function convert_esrgan_model (line 174) | def convert_esrgan_model():
  function convert_duf_model (line 202) | def convert_duf_model():

FILE: scripts/model_conversion/convert_stylegan.py
  function convert_net_g (line 6) | def convert_net_g(ori_net, crt_net):
  function convert_net_d (line 49) | def convert_net_d(ori_net, crt_net):

FILE: scripts/publish_models.py
  function update_sha (line 8) | def update_sha(paths):
  function convert_to_backward_compatible_models (line 39) | def convert_to_backward_compatible_models(paths):

FILE: setup.py
  function readme (line 14) | def readme():
  function get_git_hash (line 20) | def get_git_hash():
  function get_hash (line 45) | def get_hash():
  function write_version_py (line 61) | def write_version_py():
  function get_version (line 78) | def get_version():
  function make_cuda_ext (line 84) | def make_cuda_ext(name, module, sources, sources_cuda=None):
  function get_requirements (line 110) | def get_requirements(filename='requirements.txt'):

FILE: tests/test_archs/test_basicvsr_arch.py
  function test_basicvsr (line 6) | def test_basicvsr():
  function test_convresidualblocks (line 16) | def test_convresidualblocks():
  function test_iconvsr (line 26) | def test_iconvsr():

FILE: tests/test_archs/test_discriminator_arch.py
  function test_vggstylediscriminator (line 7) | def test_vggstylediscriminator():

FILE: tests/test_archs/test_duf_arch.py
  function test_duf (line 7) | def test_duf():
  function test_dynamicupsamplingfilter (line 31) | def test_dynamicupsamplingfilter():

FILE: tests/test_archs/test_ecbsr_arch.py
  function test_ecbsr (line 7) | def test_ecbsr():
  function test_seqconv3x3 (line 23) | def test_seqconv3x3():
  function test_ecb (line 57) | def test_ecb():

FILE: tests/test_archs/test_srresnet_arch.py
  function test_msrresnet (line 6) | def test_msrresnet():

FILE: tests/test_data/test_paired_image_dataset.py
  function test_pairedimagedataset (line 6) | def test_pairedimagedataset():

FILE: tests/test_data/test_single_image_dataset.py
  function test_singleimagedataset (line 6) | def test_singleimagedataset():

FILE: tests/test_losses/test_losses.py
  function test_pixellosses (line 8) | def test_pixellosses(loss_class):
  function test_weightedtvloss (line 41) | def test_weightedtvloss():

FILE: tests/test_metrics/test_psnr_ssim.py
  function test_calculate_psnr (line 7) | def test_calculate_psnr():
  function test_calculate_ssim (line 26) | def test_calculate_ssim():

FILE: tests/test_models/test_sr_model.py
  function test_srmodel (line 11) | def test_srmodel():
Condensed preview — 182 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,784K chars).
[
  {
    "path": ".gitignore",
    "chars": 1383,
    "preview": "# ignored folders\nresults/*\ntb_logger/*\nwandb/*\ntmp/*\n\n*.DS_Store\n.idea\n\n# ignored files\nversion.py\n\n# ignored files wit"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 1483,
    "preview": "repos:\n  # flake8\n  - repo: https://github.com/PyCQA/flake8\n    rev: 3.8.3\n    hooks:\n      - id: flake8\n        args: ["
  },
  {
    "path": "INSTALL.md",
    "chars": 5597,
    "preview": "# Installation\n\n## Contents\n\n- [Requirements](#requirements)\n- [BASICSR_EXT and BASICSR_JIT environment variables](#basi"
  },
  {
    "path": "LICENSE",
    "chars": 1065,
    "preview": "MIT License\n\nCopyright (c) 2022 Hoven Li\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
  },
  {
    "path": "MANIFEST.in",
    "chars": 287,
    "preview": "include basicsr/ops/dcn/src/*.cu basicsr/ops/dcn/src/*.cpp\ninclude basicsr/ops/fused_act/src/*.cu basicsr/ops/fused_act/"
  },
  {
    "path": "README.md",
    "chars": 2571,
    "preview": "# BSRN\n[Blueprint Separable Residual Network for Efficient Image Super-Resolution](https://arxiv.org/abs/2205.05996)   \n"
  },
  {
    "path": "VERSION",
    "chars": 8,
    "preview": "1.3.4.9\n"
  },
  {
    "path": "basicsr/__init__.py",
    "chars": 286,
    "preview": "# https://github.com/xinntao/BasicSR\n# flake8: noqa\nfrom .archs import *\nfrom .data import *\nfrom .losses import *\nfrom "
  },
  {
    "path": "basicsr/archs/BSRN_arch.py",
    "chars": 11955,
    "preview": "'''\nThis repository is used to implement all upsamplers(only x4) and tools for Efficient SR\n@author\n    LI Zehyuan from "
  },
  {
    "path": "basicsr/archs/Blocks.py",
    "chars": 14952,
    "preview": "'''\nThis repository is used to implement all blocks and tools for Efficient SR\n@author\n    LI Zehyuan from SIAT\n    LIU "
  },
  {
    "path": "basicsr/archs/RFDN_arch.py",
    "chars": 7553,
    "preview": "from collections import OrderedDict\nfrom basicsr.utils.registry import ARCH_REGISTRY\nimport torch.nn as nn\nimport torch\n"
  },
  {
    "path": "basicsr/archs/Upsamplers.py",
    "chars": 6410,
    "preview": "'''\nThis repository is used to implement all upsamplers(only x4) and tools for Efficient SR\n@author\n    LI Zehyuan from "
  },
  {
    "path": "basicsr/archs/__init__.py",
    "chars": 886,
    "preview": "import importlib\nfrom copy import deepcopy\nfrom os import path as osp\n\nfrom basicsr.utils import get_root_logger, scandi"
  },
  {
    "path": "basicsr/archs/arch_util.py",
    "chars": 11435,
    "preview": "import collections.abc\nimport math\nimport torch\nimport torchvision\nimport warnings\nfrom distutils.version import LooseVe"
  },
  {
    "path": "basicsr/archs/rfdnfinalB5_arch.py",
    "chars": 6928,
    "preview": "'''\nThis repository is used to implement all upsamplers(only x4) and tools for Efficient SR\n@author\n    LI Zehyuan from "
  },
  {
    "path": "basicsr/archs/vgg_arch.py",
    "chars": 6142,
    "preview": "import os\nimport torch\nfrom collections import OrderedDict\nfrom torch import nn as nn\nfrom torchvision.models import vgg"
  },
  {
    "path": "basicsr/data/__init__.py",
    "chars": 4338,
    "preview": "import importlib\nimport numpy as np\nimport random\nimport torch\nimport torch.utils.data\nfrom copy import deepcopy\nfrom fu"
  },
  {
    "path": "basicsr/data/data_sampler.py",
    "chars": 1639,
    "preview": "import math\nimport torch\nfrom torch.utils.data.sampler import Sampler\n\n\nclass EnlargedSampler(Sampler):\n    \"\"\"Sampler t"
  },
  {
    "path": "basicsr/data/data_util.py",
    "chars": 11782,
    "preview": "import cv2\nimport numpy as np\nimport torch\nfrom os import path as osp\nfrom torch.nn import functional as F\n\nfrom basicsr"
  },
  {
    "path": "basicsr/data/degradations.py",
    "chars": 28346,
    "preview": "import cv2\nimport math\nimport numpy as np\nimport random\nimport torch\nfrom scipy import special\nfrom scipy.stats import m"
  },
  {
    "path": "basicsr/data/ffhq_dataset.py",
    "chars": 3027,
    "preview": "import random\nimport time\nfrom os import path as osp\nfrom torch.utils import data as data\nfrom torchvision.transforms.fu"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_DIV2K800sub_GT.txt",
    "chars": 847392,
    "preview": "0001_s001.png (480,480,3)\n0001_s002.png (480,480,3)\n0001_s003.png (480,480,3)\n0001_s004.png (480,480,3)\n0001_s005.png (4"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_REDS4_test_GT.txt",
    "chars": 84,
    "preview": "000 100 (720,1280,3)\n011 100 (720,1280,3)\n015 100 (720,1280,3)\n020 100 (720,1280,3)\n"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_REDS_GT.txt",
    "chars": 5670,
    "preview": "000 100 (720,1280,3)\n001 100 (720,1280,3)\n002 100 (720,1280,3)\n003 100 (720,1280,3)\n004 100 (720,1280,3)\n005 100 (720,12"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_REDSofficial4_test_GT.txt",
    "chars": 84,
    "preview": "240 100 (720,1280,3)\n241 100 (720,1280,3)\n246 100 (720,1280,3)\n257 100 (720,1280,3)\n"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_REDSval_official_test_GT.txt",
    "chars": 630,
    "preview": "240 100 (720,1280,3)\n241 100 (720,1280,3)\n242 100 (720,1280,3)\n243 100 (720,1280,3)\n244 100 (720,1280,3)\n245 100 (720,12"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_Vimeo90K_test_GT.txt",
    "chars": 195600,
    "preview": "00001/0266 7 (256,448,3)\n00001/0268 7 (256,448,3)\n00001/0275 7 (256,448,3)\n00001/0278 7 (256,448,3)\n00001/0285 7 (256,44"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_Vimeo90K_test_fast_GT.txt",
    "chars": 30625,
    "preview": "00001/0625 7 (256,448,3)\n00001/0632 7 (256,448,3)\n00001/0807 7 (256,448,3)\n00001/0832 7 (256,448,3)\n00001/0834 7 (256,44"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_Vimeo90K_test_medium_GT.txt",
    "chars": 124425,
    "preview": "00001/0285 7 (256,448,3)\n00001/0619 7 (256,448,3)\n00001/0622 7 (256,448,3)\n00001/0628 7 (256,448,3)\n00001/0629 7 (256,44"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_Vimeo90K_test_slow_GT.txt",
    "chars": 40325,
    "preview": "00001/0266 7 (256,448,3)\n00001/0268 7 (256,448,3)\n00001/0275 7 (256,448,3)\n00001/0278 7 (256,448,3)\n00001/0287 7 (256,44"
  },
  {
    "path": "basicsr/data/meta_info/meta_info_Vimeo90K_train_GT.txt",
    "chars": 1615300,
    "preview": "00001/0001 7 (256,448,3)\n00001/0002 7 (256,448,3)\n00001/0003 7 (256,448,3)\n00001/0004 7 (256,448,3)\n00001/0005 7 (256,44"
  },
  {
    "path": "basicsr/data/paired_image_dataset.py",
    "chars": 5066,
    "preview": "from torch.utils import data as data\nfrom torchvision.transforms.functional import normalize\n\nfrom basicsr.data.data_uti"
  },
  {
    "path": "basicsr/data/prefetch_dataloader.py",
    "chars": 3131,
    "preview": "import queue as Queue\nimport threading\nimport torch\nfrom torch.utils.data import DataLoader\n\n\nclass PrefetchGenerator(th"
  },
  {
    "path": "basicsr/data/reds_dataset.py",
    "chars": 15329,
    "preview": "import numpy as np\nimport random\nimport torch\nfrom pathlib import Path\nfrom torch.utils import data as data\n\nfrom basics"
  },
  {
    "path": "basicsr/data/single_image_dataset.py",
    "chars": 2732,
    "preview": "from os import path as osp\nfrom torch.utils import data as data\nfrom torchvision.transforms.functional import normalize\n"
  },
  {
    "path": "basicsr/data/transforms.py",
    "chars": 6225,
    "preview": "import cv2\nimport random\nimport torch\n\n\ndef mod_crop(img, scale):\n    \"\"\"Mod crop images, used during testing.\n\n    Args"
  },
  {
    "path": "basicsr/data/video_test_dataset.py",
    "chars": 12056,
    "preview": "import glob\nimport torch\nfrom os import path as osp\nfrom torch.utils import data as data\n\nfrom basicsr.data.data_util im"
  },
  {
    "path": "basicsr/data/vimeo90k_dataset.py",
    "chars": 6934,
    "preview": "import random\nimport torch\nfrom pathlib import Path\nfrom torch.utils import data as data\n\nfrom basicsr.data.transforms i"
  },
  {
    "path": "basicsr/losses/__init__.py",
    "chars": 835,
    "preview": "from copy import deepcopy\n\nfrom basicsr.utils import get_root_logger\nfrom basicsr.utils.registry import LOSS_REGISTRY\nfr"
  },
  {
    "path": "basicsr/losses/loss_util.py",
    "chars": 2903,
    "preview": "import functools\nfrom torch.nn import functional as F\n\n\ndef reduce_loss(loss, reduction):\n    \"\"\"Reduce loss as specifie"
  },
  {
    "path": "basicsr/losses/losses.py",
    "chars": 18091,
    "preview": "import math\nimport torch\nfrom torch import autograd as autograd\nfrom torch import nn as nn\nfrom torch.nn import function"
  },
  {
    "path": "basicsr/metrics/__init__.py",
    "chars": 557,
    "preview": "from copy import deepcopy\n\nfrom basicsr.utils.registry import METRIC_REGISTRY\nfrom .niqe import calculate_niqe\nfrom .psn"
  },
  {
    "path": "basicsr/metrics/fid.py",
    "chars": 3258,
    "preview": "import numpy as np\nimport torch\nimport torch.nn as nn\nfrom scipy import linalg\nfrom tqdm import tqdm\n\nfrom basicsr.archs"
  },
  {
    "path": "basicsr/metrics/metric_util.py",
    "chars": 1288,
    "preview": "import numpy as np\n\nfrom basicsr.utils.matlab_functions import bgr2ycbcr\n\n\ndef reorder_image(img, input_order='HWC'):\n  "
  },
  {
    "path": "basicsr/metrics/niqe.py",
    "chars": 8352,
    "preview": "import cv2\nimport math\nimport numpy as np\nimport os\nfrom scipy.ndimage.filters import convolve\nfrom scipy.special import"
  },
  {
    "path": "basicsr/metrics/psnr_ssim.py",
    "chars": 4549,
    "preview": "import cv2\nimport numpy as np\n\nfrom basicsr.metrics.metric_util import reorder_image, to_y_channel\nfrom basicsr.utils.re"
  },
  {
    "path": "basicsr/models/__init__.py",
    "chars": 1013,
    "preview": "import importlib\nfrom copy import deepcopy\nfrom os import path as osp\n\nfrom basicsr.utils import get_root_logger, scandi"
  },
  {
    "path": "basicsr/models/base_model.py",
    "chars": 15311,
    "preview": "import os\nimport time\nimport torch\nfrom collections import OrderedDict\nfrom copy import deepcopy\nfrom torch.nn.parallel "
  },
  {
    "path": "basicsr/models/edvr_model.py",
    "chars": 2429,
    "preview": "from basicsr.utils import get_root_logger\nfrom basicsr.utils.registry import MODEL_REGISTRY\nfrom .video_base_model impor"
  },
  {
    "path": "basicsr/models/esrgan_model.py",
    "chars": 3174,
    "preview": "import torch\nfrom collections import OrderedDict\n\nfrom basicsr.utils.registry import MODEL_REGISTRY\nfrom .srgan_model im"
  },
  {
    "path": "basicsr/models/hifacegan_model.py",
    "chars": 11766,
    "preview": "import torch\nfrom collections import OrderedDict\nfrom os import path as osp\nfrom tqdm import tqdm\n\nfrom basicsr.archs im"
  },
  {
    "path": "basicsr/models/lr_scheduler.py",
    "chars": 3956,
    "preview": "import math\nfrom collections import Counter\nfrom torch.optim.lr_scheduler import _LRScheduler\n\n\nclass MultiStepRestartLR"
  },
  {
    "path": "basicsr/models/sr_model.py",
    "chars": 9310,
    "preview": "import torch\nfrom collections import OrderedDict\nfrom os import path as osp\nfrom tqdm import tqdm\n\nfrom basicsr.archs im"
  },
  {
    "path": "basicsr/models/srgan_model.py",
    "chars": 5675,
    "preview": "import torch\nfrom collections import OrderedDict\n\nfrom basicsr.archs import build_network\nfrom basicsr.losses import bui"
  },
  {
    "path": "basicsr/models/stylegan2_model.py",
    "chars": 11640,
    "preview": "import cv2\nimport math\nimport numpy as np\nimport random\nimport torch\nfrom collections import OrderedDict\nfrom os import "
  },
  {
    "path": "basicsr/models/swinir_model.py",
    "chars": 1115,
    "preview": "import torch\nfrom torch.nn import functional as F\n\nfrom basicsr.utils.registry import MODEL_REGISTRY\nfrom .sr_model impo"
  },
  {
    "path": "basicsr/models/video_base_model.py",
    "chars": 7433,
    "preview": "import torch\nfrom collections import Counter\nfrom os import path as osp\nfrom torch import distributed as dist\nfrom tqdm "
  },
  {
    "path": "basicsr/models/video_gan_model.py",
    "chars": 463,
    "preview": "from basicsr.utils.registry import MODEL_REGISTRY\nfrom .srgan_model import SRGANModel\nfrom .video_base_model import Vide"
  },
  {
    "path": "basicsr/models/video_recurrent_gan_model.py",
    "chars": 7142,
    "preview": "import torch\nfrom collections import OrderedDict\n\nfrom basicsr.archs import build_network\nfrom basicsr.losses import bui"
  },
  {
    "path": "basicsr/models/video_recurrent_model.py",
    "chars": 8168,
    "preview": "import torch\nfrom collections import Counter\nfrom os import path as osp\nfrom torch import distributed as dist\nfrom tqdm "
  },
  {
    "path": "basicsr/ops/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "basicsr/ops/dcn/__init__.py",
    "chars": 306,
    "preview": "from .deform_conv import (DeformConv, DeformConvPack, ModulatedDeformConv, ModulatedDeformConvPack, deform_conv,\n       "
  },
  {
    "path": "basicsr/ops/dcn/deform_conv.py",
    "chars": 15727,
    "preview": "import math\nimport os\nimport torch\nfrom torch import nn as nn\nfrom torch.autograd import Function\nfrom torch.autograd.fu"
  },
  {
    "path": "basicsr/ops/dcn/src/deform_conv_cuda.cpp",
    "chars": 28842,
    "preview": "// modify from\n// https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/blob/mmdetection/mmdet/ops/dcn/src/def"
  },
  {
    "path": "basicsr/ops/dcn/src/deform_conv_cuda_kernel.cu",
    "chars": 42622,
    "preview": "/*!\n ******************* BEGIN Caffe Copyright Notice and Disclaimer ****************\n *\n * COPYRIGHT\n *\n * All contribu"
  },
  {
    "path": "basicsr/ops/dcn/src/deform_conv_ext.cpp",
    "chars": 7492,
    "preview": "// modify from\n// https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/blob/mmdetection/mmdet/ops/dcn/src/def"
  },
  {
    "path": "basicsr/ops/fused_act/__init__.py",
    "chars": 106,
    "preview": "from .fused_act import FusedLeakyReLU, fused_leaky_relu\n\n__all__ = ['FusedLeakyReLU', 'fused_leaky_relu']\n"
  },
  {
    "path": "basicsr/ops/fused_act/fused_act.py",
    "chars": 2941,
    "preview": "# modify from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/fused_act.py # noqa:E501\n\nimport os\nimport "
  },
  {
    "path": "basicsr/ops/fused_act/src/fused_bias_act.cpp",
    "chars": 1092,
    "preview": "// from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/fused_bias_act.cpp\n#include <torch/extension.h>\n\n"
  },
  {
    "path": "basicsr/ops/fused_act/src/fused_bias_act_kernel.cu",
    "chars": 2874,
    "preview": "// from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/fused_bias_act_kernel.cu\n// Copyright (c) 2019, N"
  },
  {
    "path": "basicsr/ops/upfirdn2d/__init__.py",
    "chars": 58,
    "preview": "from .upfirdn2d import upfirdn2d\n\n__all__ = ['upfirdn2d']\n"
  },
  {
    "path": "basicsr/ops/upfirdn2d/src/upfirdn2d.cpp",
    "chars": 1052,
    "preview": "// from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/upfirdn2d.cpp\n#include <torch/extension.h>\n\n\ntorc"
  },
  {
    "path": "basicsr/ops/upfirdn2d/src/upfirdn2d_kernel.cu",
    "chars": 11803,
    "preview": "// from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/upfirdn2d_kernel.cu\n// Copyright (c) 2019, NVIDIA"
  },
  {
    "path": "basicsr/ops/upfirdn2d/upfirdn2d.py",
    "chars": 6085,
    "preview": "# modify from https://github.com/rosinality/stylegan2-pytorch/blob/master/op/upfirdn2d.py  # noqa:E501\n\nimport os\nimport"
  },
  {
    "path": "basicsr/summary.py",
    "chars": 260,
    "preview": "from thop import profile\nimport torch\nfrom archs.BSRN_arch import BSRN as net\n\nmodel = net()\ninput = torch.randn(1, 3, 3"
  },
  {
    "path": "basicsr/test.py",
    "chars": 1730,
    "preview": "import logging\nimport torch\nfrom os import path as osp\n\nfrom basicsr.data import build_dataloader, build_dataset\nfrom ba"
  },
  {
    "path": "basicsr/train.py",
    "chars": 9678,
    "preview": "import datetime\nimport logging\nimport math\nimport time\nimport torch\nfrom os import path as osp\n\nfrom basicsr.data import"
  },
  {
    "path": "basicsr/utils/__init__.py",
    "chars": 968,
    "preview": "from .diffjpeg import DiffJPEG\nfrom .file_client import FileClient\nfrom .img_process_util import USMSharp, usm_sharp\nfro"
  },
  {
    "path": "basicsr/utils/diffjpeg.py",
    "chars": 15666,
    "preview": "\"\"\"\nModified from https://github.com/mlomnitz/DiffJPEG\n\nFor images not divisible by 8\nhttps://dsp.stackexchange.com/ques"
  },
  {
    "path": "basicsr/utils/dist_util.py",
    "chars": 2608,
    "preview": "# Modified from https://github.com/open-mmlab/mmcv/blob/master/mmcv/runner/dist_utils.py  # noqa: E501\nimport functools\n"
  },
  {
    "path": "basicsr/utils/download_util.py",
    "chars": 3345,
    "preview": "import math\nimport os\nimport requests\nfrom torch.hub import download_url_to_file, get_dir\nfrom tqdm import tqdm\nfrom url"
  },
  {
    "path": "basicsr/utils/face_util.py",
    "chars": 8846,
    "preview": "import cv2\nimport numpy as np\nimport os\nimport torch\nfrom skimage import transform as trans\n\nfrom basicsr.utils import i"
  },
  {
    "path": "basicsr/utils/file_client.py",
    "chars": 6017,
    "preview": "# Modified from https://github.com/open-mmlab/mmcv/blob/master/mmcv/fileio/file_client.py  # noqa: E501\nfrom abc import "
  },
  {
    "path": "basicsr/utils/flow_util.py",
    "chars": 6162,
    "preview": "# Modified from https://github.com/open-mmlab/mmcv/blob/master/mmcv/video/optflow.py  # noqa: E501\nimport cv2\nimport num"
  },
  {
    "path": "basicsr/utils/img_process_util.py",
    "chars": 2563,
    "preview": "import cv2\nimport numpy as np\nimport torch\nfrom torch.nn import functional as F\n\n\ndef filter2D(img, kernel):\n    \"\"\"PyTo"
  },
  {
    "path": "basicsr/utils/img_util.py",
    "chars": 6195,
    "preview": "import cv2\nimport math\nimport numpy as np\nimport os\nimport torch\nfrom torchvision.utils import make_grid\n\n\ndef img2tenso"
  },
  {
    "path": "basicsr/utils/lmdb_util.py",
    "chars": 7105,
    "preview": "import cv2\nimport lmdb\nimport sys\nfrom multiprocessing import Pool\nfrom os import path as osp\nfrom tqdm import tqdm\n\n\nde"
  },
  {
    "path": "basicsr/utils/logger.py",
    "chars": 7375,
    "preview": "import datetime\nimport logging\nimport time\n\nfrom .dist_util import get_dist_info, master_only\n\ninitialized_logger = {}\n\n"
  },
  {
    "path": "basicsr/utils/matlab_functions.py",
    "chars": 13837,
    "preview": "import math\nimport numpy as np\nimport torch\n\n\ndef cubic(x):\n    \"\"\"cubic function used for calculate_weights_indices.\"\"\""
  },
  {
    "path": "basicsr/utils/misc.py",
    "chars": 4654,
    "preview": "import numpy as np\nimport os\nimport random\nimport time\nimport torch\nfrom os import path as osp\n\nfrom .dist_util import m"
  },
  {
    "path": "basicsr/utils/options.py",
    "chars": 6406,
    "preview": "import argparse\nimport random\nimport torch\nimport yaml\nfrom collections import OrderedDict\nfrom os import path as osp\n\nf"
  },
  {
    "path": "basicsr/utils/registry.py",
    "chars": 2185,
    "preview": "# Modified from: https://github.com/facebookresearch/fvcore/blob/master/fvcore/common/registry.py  # noqa: E501\n\n\nclass "
  },
  {
    "path": "colab/README.md",
    "chars": 715,
    "preview": "# Colab\n\n<a href=\"https://drive.google.com/drive/folders/1G_qcpvkT5ixmw5XoN6MupkOzcK1km625?usp=sharing\"><img src=\"https:"
  },
  {
    "path": "datasets/README.md",
    "chars": 386,
    "preview": "# Symlink/Put all the datasets here\n\nIt is recommended to symlink your dataset root to this folder - `datasets` with the"
  },
  {
    "path": "docs/Config.md",
    "chars": 11761,
    "preview": "# Configuration\n\n[English](Config.md) **|** [简体中文](Config_CN.md)\n\n#### Contents\n\n1. [Experiment Name Convention](#Experi"
  },
  {
    "path": "docs/Config_CN.md",
    "chars": 8010,
    "preview": "# 配置文件\n\n[English](Config.md) **|** [简体中文](Config_CN.md)\n\n#### 目录\n\n1. [实验命名](#实验命名)\n1. [配置文件说明](#配置文件说明)\n    1. [训练配置文件]("
  },
  {
    "path": "docs/DatasetPreparation.md",
    "chars": 15125,
    "preview": "# Dataset Preparation\n\n[English](DatasetPreparation.md) **|** [简体中文](DatasetPreparation_CN.md)\n\n#### Contents\n\n1. [Data "
  },
  {
    "path": "docs/DatasetPreparation_CN.md",
    "chars": 10441,
    "preview": "# 数据准备\n\n[English](DatasetPreparation.md) **|** [简体中文](DatasetPreparation_CN.md)\n\n#### 目录\n\n1. [数据存储形式](#数据存储形式)\n    1. [如"
  },
  {
    "path": "docs/Datasets.md",
    "chars": 1456,
    "preview": "# Datasets\n\n[English](Datasets.md) **|** [简体中文](Datasets_CN.md)\n\n## Supported Datasets\n\n| Class         | Task   |Train/"
  },
  {
    "path": "docs/Datasets_CN.md",
    "chars": 1060,
    "preview": "# 数据处理\n\n[English](Datasets.md) **|** [简体中文](Datasets_CN.md)\n\n## 支持的数据处理\n\n| 类         | 任务    |训练/测试 | 描述       |\n| :----"
  },
  {
    "path": "docs/DesignConvention.md",
    "chars": 4344,
    "preview": "# Codebase Designs and Conventions\n\n[English](DesignConvention.md) **|** [简体中文](DesignConvention_CN.md)\n\n#### Contents\n\n"
  },
  {
    "path": "docs/DesignConvention_CN.md",
    "chars": 3107,
    "preview": "# 代码库的设计和约定\n\n[English](DesignConvention.md) **|** [简体中文](DesignConvention_CN.md)\n\n#### 目录\n\n1. [整体框架](#整体框架)\n1. [特性](#特性)"
  },
  {
    "path": "docs/HOWTOs.md",
    "chars": 5149,
    "preview": "# HOWTOs\n\n[English](HOWTOs.md) **|** [简体中文](HOWTOs_CN.md)\n\n## How to train StyleGAN2\n\n1. Prepare training dataset: [FFHQ"
  },
  {
    "path": "docs/HOWTOs_CN.md",
    "chars": 4545,
    "preview": "# HOWTOs\n\n[English](HOWTOs.md) **|** [简体中文](HOWTOs_CN.md)\n\n## 如何训练 StyleGAN2\n\n1. 准备训练数据集: [FFHQ](https://github.com/NVla"
  },
  {
    "path": "docs/Logging.md",
    "chars": 1629,
    "preview": "# Logging\n\n[English](Logging.md) **|** [简体中文](Logging_CN.md)\n\n#### Contents\n\n1. [Text Logger](#Text-Logger)\n1. [Tensorbo"
  },
  {
    "path": "docs/Logging_CN.md",
    "chars": 1195,
    "preview": "# Logging日志\n\n[English](Logging.md) **|** [简体中文](Logging_CN.md)\n\n#### 目录\n\n1. [文本屏幕日志](#文本屏幕日志)\n1. [Tensorboard日志](#Tensor"
  },
  {
    "path": "docs/Makefile",
    "chars": 587,
    "preview": "# You can set these variables from the command line, and also\n# from the environment for the first two.\nSPHINXOPTS    ?="
  },
  {
    "path": "docs/Metrics.md",
    "chars": 1782,
    "preview": "# Metrics\n\n[English](Metrics.md) **|** [简体中文](Metrics_CN.md)\n\n## PSNR and SSIM\n\n## NIQE\n\n## FID\n\n> FID measures the simi"
  },
  {
    "path": "docs/Metrics_CN.md",
    "chars": 1753,
    "preview": "# 评价指标\n\n[English](Metrics.md) **|** [简体中文](Metrics_CN.md)\n\n## PSNR and SSIM\n\n## NIQE\n\n## FID\n\n> FID measures the similar"
  },
  {
    "path": "docs/ModelZoo.md",
    "chars": 8612,
    "preview": "# Model Zoo and Baselines\n\n[English](ModelZoo.md) **|** [简体中文](ModelZoo_CN.md)\n\n:arrow_double_down: Google Drive: [Pretr"
  },
  {
    "path": "docs/ModelZoo_CN.md",
    "chars": 8083,
    "preview": "# 模型库和基准\n\n[English](ModelZoo.md) **|** [简体中文](ModelZoo_CN.md)\n\n:arrow_double_down: 百度网盘: [预训练模型](https://pan.baidu.com/s"
  },
  {
    "path": "docs/Models.md",
    "chars": 1248,
    "preview": "# Models\n\n[English](Models.md) **|** [简体中文](Models_CN.md)\n\n#### Contents\n\n1. [Supported Models](#Supported-Models)\n1. [I"
  },
  {
    "path": "docs/Models_CN.md",
    "chars": 915,
    "preview": "# 模型\n\n[English](Models.md) **|** [简体中文](Models_CN.md)\n\n#### 目录\n\n1. [支持的模型](#支持的模型)\n1. [继承关系](#继承关系)\n\n## 支持的模型\n\n| 类      "
  },
  {
    "path": "docs/TrainTest.md",
    "chars": 5183,
    "preview": "# Training and Testing\n\n[English](TrainTest.md) **|** [简体中文](TrainTest_CN.md)\n\nPlease run the commands in the root path "
  },
  {
    "path": "docs/TrainTest_CN.md",
    "chars": 4534,
    "preview": "# 训练和测试\n\n[English](TrainTest.md) **|** [简体中文](TrainTest_CN.md)\n\n所有的命令都在 `BasicSR` 的根目录下运行. <br>\n一般来说, 训练和测试都有以下的步骤:\n\n1. "
  },
  {
    "path": "docs/api.rst",
    "chars": 668,
    "preview": "API\n=================\n\nbasicsr.data\n--------------\n.. automodule:: basicsr.data\n    :members:\n\nbasicsr.models\n----------"
  },
  {
    "path": "docs/conf.py",
    "chars": 2130,
    "preview": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common op"
  },
  {
    "path": "docs/history_updates.md",
    "chars": 2156,
    "preview": "# History of New Features/Updates\n\n:triangular_flag_on_post: **New Features/Updates**\n\n- :white_check_mark: Oct 5, 2021."
  },
  {
    "path": "docs/index.rst",
    "chars": 223,
    "preview": "Welcome to BasicSR's documentation!\n===================================\n\n.. toctree::\n   :maxdepth: 3\n   :caption: API\n\n"
  },
  {
    "path": "docs/make.bat",
    "chars": 759,
    "preview": "@ECHO OFF\n\npushd %~dp0\n\nREM Command file for Sphinx documentation\n\nif \"%SPHINXBUILD%\" == \"\" (\n\tset SPHINXBUILD=sphinx-bu"
  },
  {
    "path": "options/test/benchmark_BSRN-S_x4.yml",
    "chars": 1767,
    "preview": "name: BSRN-S_C48B5_L1_1500k\nsuffix: ~  # add suffix to saved images\nmodel_type: SRModel\nscale: 4\ncrop_border: ~  # crop "
  },
  {
    "path": "options/test/benchmark_BSRN_x2.yml",
    "chars": 1775,
    "preview": "name: test_BSRN_x2_C64B8_L1_1000k\nsuffix: ~  # add suffix to saved images\nmodel_type: SRModel\nscale: 2\ncrop_border: ~  #"
  },
  {
    "path": "options/test/benchmark_BSRN_x3.yml",
    "chars": 1775,
    "preview": "name: test_BSRN_x3_C64B8_L1_1000k\nsuffix: ~  # add suffix to saved images\nmodel_type: SRModel\nscale: 3\ncrop_border: ~  #"
  },
  {
    "path": "options/test/benchmark_BSRN_x4.yml",
    "chars": 1767,
    "preview": "name: test_BSRN_x4_C64B8_L1_1000k\nsuffix: ~  # add suffix to saved images\nmodel_type: SRModel\nscale: 4\ncrop_border: ~  #"
  },
  {
    "path": "options/train/train_BSRN-S_x4.yml",
    "chars": 2077,
    "preview": "# general settings\nname: BSRN-S_x4_C48B5_G4L1_1500k\nmodel_type: SRModel\nscale: 4\nnum_gpu: 4  # set num_gpu: 0 for cpu mo"
  },
  {
    "path": "options/train/train_BSRN_x2.yml",
    "chars": 2033,
    "preview": "# general settings\nname: test_BSRN_x2_C64B8_L1_1000k\nmodel_type: SRModel\nscale: 2\nnum_gpu: 2  # set num_gpu: 0 for cpu m"
  },
  {
    "path": "options/train/train_BSRN_x3.yml",
    "chars": 2035,
    "preview": "# general settings\nname: test_BSRN_x3_C64B8_L1_1000k\nmodel_type: SRModel\nscale: 3\nnum_gpu: 2  # set num_gpu: 0 for cpu m"
  },
  {
    "path": "options/train/train_BSRN_x4.yml",
    "chars": 2015,
    "preview": "# general settings\nname: BSRN_x4_C64B8_L1_1000k\nmodel_type: SRModel\nscale: 4\nnum_gpu: 2  # set num_gpu: 0 for cpu mode\nm"
  },
  {
    "path": "requirements.txt",
    "chars": 125,
    "preview": "addict\nfuture\nlmdb\nnumpy\nopencv-python\nPillow\npyyaml\nrequests\nscikit-image\nscipy\ntb-nightly\ntorch>=1.7\ntorchvision\ntqdm\n"
  },
  {
    "path": "scripts/data_preparation/create_lmdb.py",
    "chars": 6143,
    "preview": "import argparse\nfrom os import path as osp\n\nfrom basicsr.utils import scandir\nfrom basicsr.utils.lmdb_util import make_l"
  },
  {
    "path": "scripts/data_preparation/download_datasets.py",
    "chars": 2444,
    "preview": "import argparse\nimport glob\nimport os\nfrom os import path as osp\n\nfrom basicsr.utils.download_util import download_file_"
  },
  {
    "path": "scripts/data_preparation/extract_images_from_tfrecords.py",
    "chars": 7533,
    "preview": "import argparse\nimport cv2\nimport glob\nimport numpy as np\nimport os\n\nfrom basicsr.utils.lmdb_util import LmdbMaker\n\n\ndef"
  },
  {
    "path": "scripts/data_preparation/extract_subimages.py",
    "chars": 5258,
    "preview": "import cv2\nimport numpy as np\nimport os\nimport sys\nfrom multiprocessing import Pool\nfrom os import path as osp\nfrom tqdm"
  },
  {
    "path": "scripts/data_preparation/generate_meta_info.py",
    "chars": 968,
    "preview": "from os import path as osp\nfrom PIL import Image\n\nfrom basicsr.utils import scandir\n\n\ndef generate_meta_info_div2k():\n  "
  },
  {
    "path": "scripts/data_preparation/prepare_hifacegan_dataset.py",
    "chars": 4008,
    "preview": "import cv2\nimport os\nfrom tqdm import tqdm\n\n\nclass Mosaic16x:\n    \"\"\"\n    Mosaic16x: A customized image augmentor for 16"
  },
  {
    "path": "scripts/data_preparation/regroup_reds_dataset.py",
    "chars": 1154,
    "preview": "import glob\nimport os\n\n\ndef regroup_reds_dataset(train_path, val_path):\n    \"\"\"Regroup original REDS datasets.\n\n    We m"
  },
  {
    "path": "scripts/dist_test.sh",
    "chars": 370,
    "preview": "#!/usr/bin/env bash\n\nGPUS=$1\nCONFIG=$2\nPORT=${PORT:-4321}\n\n# usage\nif [ $# -ne 2 ] ;then\n    echo \"usage:\"\n    echo \"./s"
  },
  {
    "path": "scripts/dist_train.sh",
    "chars": 379,
    "preview": "#!/usr/bin/env bash\n\nGPUS=$1\nCONFIG=$2\nPORT=${PORT:-4321}\n\n# usage\nif [ $# -lt 2 ] ;then\n    echo \"usage:\"\n    echo \"./s"
  },
  {
    "path": "scripts/download_gdrive.py",
    "chars": 372,
    "preview": "import argparse\n\nfrom basicsr.utils.download_util import download_file_from_google_drive\n\nif __name__ == '__main__':\n   "
  },
  {
    "path": "scripts/download_pretrained_models.py",
    "chars": 6247,
    "preview": "import argparse\nimport os\nfrom os import path as osp\n\nfrom basicsr.utils.download_util import download_file_from_google_"
  },
  {
    "path": "scripts/matlab_scripts/back_projection/backprojection.m",
    "chars": 588,
    "preview": "function [im_h] = backprojection(im_h, im_l, maxIter)\n\n[row_l, col_l,~] = size(im_l);\n[row_h, col_h,~] = size(im_h);\n\np "
  },
  {
    "path": "scripts/matlab_scripts/back_projection/main_bp.m",
    "chars": 616,
    "preview": "clear; close all; clc;\n\nLR_folder = './LR'; % LR\npreout_folder = './results'; % pre output\nsave_folder = './results_20bp"
  },
  {
    "path": "scripts/matlab_scripts/back_projection/main_reverse_filter.m",
    "chars": 716,
    "preview": "clear; close all; clc;\n\nLR_folder = './LR'; % LR\npreout_folder = './results'; % pre output\nsave_folder = './results_20if"
  },
  {
    "path": "scripts/matlab_scripts/generate_LR_Vimeo90K.m",
    "chars": 1403,
    "preview": "function generate_LR_Vimeo90K()\n%% matlab code to genetate bicubic-downsampled for Vimeo90K dataset\n\nup_scale = 4;\nmod_s"
  },
  {
    "path": "scripts/matlab_scripts/generate_bicubic_img.m",
    "chars": 2306,
    "preview": "function generate_bicubic_img()\n%% matlab code to genetate mod images, bicubic-downsampled images and\n%% bicubic_upsampl"
  },
  {
    "path": "scripts/metrics/calculate_fid_folder.py",
    "chars": 2533,
    "preview": "import argparse\nimport math\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom basicsr.data i"
  },
  {
    "path": "scripts/metrics/calculate_fid_stats_from_datasets.py",
    "chars": 2170,
    "preview": "import argparse\nimport math\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom basicsr.data i"
  },
  {
    "path": "scripts/metrics/calculate_lpips.py",
    "chars": 1720,
    "preview": "import cv2\nimport glob\nimport numpy as np\nimport os.path as osp\nfrom torchvision.transforms.functional import normalize\n"
  },
  {
    "path": "scripts/metrics/calculate_niqe.py",
    "chars": 1122,
    "preview": "import argparse\nimport cv2\nimport os\nimport warnings\n\nfrom basicsr.metrics import calculate_niqe\nfrom basicsr.utils impo"
  },
  {
    "path": "scripts/metrics/calculate_psnr_ssim.py",
    "chars": 3484,
    "preview": "import argparse\nimport cv2\nimport numpy as np\nfrom os import path as osp\n\nfrom basicsr.metrics import calculate_psnr, ca"
  },
  {
    "path": "scripts/metrics/calculate_stylegan2_fid.py",
    "chars": 2697,
    "preview": "import argparse\nimport math\nimport numpy as np\nimport torch\nfrom torch import nn\n\nfrom basicsr.archs.stylegan2_arch impo"
  },
  {
    "path": "scripts/model_conversion/convert_dfdnet.py",
    "chars": 2907,
    "preview": "import torch\n\nfrom basicsr.archs.dfdnet_arch import DFDNet\nfrom basicsr.archs.vgg_arch import NAMES\n\n\ndef convert_net(or"
  },
  {
    "path": "scripts/model_conversion/convert_models.py",
    "chars": 16246,
    "preview": "import torch\n\n\ndef convert_edvr():\n    ori_net = torch.load('experiments/pretrained_models/EDVR_REDS_SR_M.pth')\n    crt_"
  },
  {
    "path": "scripts/model_conversion/convert_ridnet.py",
    "chars": 738,
    "preview": "import torch\nfrom collections import OrderedDict\n\nfrom basicsr.archs.ridnet_arch import RIDNet\n\nif __name__ == '__main__"
  },
  {
    "path": "scripts/model_conversion/convert_stylegan.py",
    "chars": 3457,
    "preview": "import torch\n\nfrom basicsr.archs.stylegan2_arch import StyleGAN2Discriminator, StyleGAN2Generator\n\n\ndef convert_net_g(or"
  },
  {
    "path": "scripts/publish_models.py",
    "chars": 2626,
    "preview": "import glob\nimport subprocess\nimport torch\nfrom os import path as osp\nfrom torch.serialization import _is_zipfile, _open"
  },
  {
    "path": "setup.cfg",
    "chars": 732,
    "preview": "[flake8]\nignore =\n    # line break before binary operator (W503)\n    W503,\n    # line break after binary operator (W504)"
  },
  {
    "path": "setup.py",
    "chars": 5241,
    "preview": "#!/usr/bin/env python\n\nfrom setuptools import find_packages, setup\n\nimport os\nimport subprocess\nimport time\nimport torch"
  },
  {
    "path": "tests/README.md",
    "chars": 47,
    "preview": "# UnitTest\n\n- It requires GPU CUDA environment\n"
  },
  {
    "path": "tests/data/gt.lmdb/meta_info.txt",
    "chars": 49,
    "preview": "baboon.png (480,492,3) 1\ncomic.png (360,240,3) 1\n"
  },
  {
    "path": "tests/data/lq.lmdb/meta_info.txt",
    "chars": 47,
    "preview": "baboon.png (120,123,3) 1\ncomic.png (80,60,3) 1\n"
  },
  {
    "path": "tests/data/meta_info_gt.txt",
    "chars": 21,
    "preview": "baboon.png\ncomic.png\n"
  },
  {
    "path": "tests/data/meta_info_pair.txt",
    "chars": 56,
    "preview": "gt/baboon.png, lq/baboon.png\ngt/comic.png, lq/comic.png\n"
  },
  {
    "path": "tests/test_archs/test_basicvsr_arch.py",
    "chars": 1395,
    "preview": "import torch\n\nfrom basicsr.archs.basicvsr_arch import BasicVSR, ConvResidualBlocks, IconVSR\n\n\ndef test_basicvsr():\n    \""
  },
  {
    "path": "tests/test_archs/test_discriminator_arch.py",
    "chars": 1124,
    "preview": "import pytest\nimport torch\n\nfrom basicsr.archs.discriminator_arch import VGGStyleDiscriminator\n\n\ndef test_vggstylediscri"
  },
  {
    "path": "tests/test_archs/test_duf_arch.py",
    "chars": 1659,
    "preview": "import pytest\nimport torch\n\nfrom basicsr.archs.duf_arch import DUF, DynamicUpsamplingFilter\n\n\ndef test_duf():\n    \"\"\"Tes"
  },
  {
    "path": "tests/test_archs/test_ecbsr_arch.py",
    "chars": 3636,
    "preview": "import pytest\nimport torch\n\nfrom basicsr.archs.ecbsr_arch import ECB, ECBSR, SeqConv3x3\n\n\ndef test_ecbsr():\n    \"\"\"Test "
  },
  {
    "path": "tests/test_archs/test_srresnet_arch.py",
    "chars": 651,
    "preview": "import torch\n\nfrom basicsr.archs.srresnet_arch import MSRResNet\n\n\ndef test_msrresnet():\n    \"\"\"Test arch: MSRResNet.\"\"\"\n"
  },
  {
    "path": "tests/test_data/test_paired_image_dataset.py",
    "chars": 3171,
    "preview": "import yaml\n\nfrom basicsr.data.paired_image_dataset import PairedImageDataset\n\n\ndef test_pairedimagedataset():\n    \"\"\"Te"
  },
  {
    "path": "tests/test_data/test_single_image_dataset.py",
    "chars": 1982,
    "preview": "import yaml\n\nfrom basicsr.data.single_image_dataset import SingleImageDataset\n\n\ndef test_singleimagedataset():\n    \"\"\"Te"
  },
  {
    "path": "tests/test_losses/test_losses.py",
    "chars": 2652,
    "preview": "import pytest\nimport torch\n\nfrom basicsr.losses.losses import CharbonnierLoss, L1Loss, MSELoss, WeightedTVLoss\n\n\n@pytest"
  },
  {
    "path": "tests/test_metrics/test_psnr_ssim.py",
    "chars": 1272,
    "preview": "import numpy as np\nimport pytest\n\nfrom basicsr.metrics.psnr_ssim import calculate_psnr, calculate_ssim\n\n\ndef test_calcul"
  },
  {
    "path": "tests/test_models/test_sr_model.py",
    "chars": 4788,
    "preview": "import tempfile\nimport torch\nimport yaml\n\nfrom basicsr.archs.srresnet_arch import MSRResNet\nfrom basicsr.data.paired_ima"
  }
]

// ... and 9 more files (download for full content)

About this extraction

This page contains the full source code of the xiaom233/BSRN GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 182 files (3.5 MB), approximately 915.0k tokens, and a symbol index with 673 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!