Skip to main content

Open Source Image and Video Super-Resolution Toolbox

Project description

:rocket: BasicSR

English | 简体中文GitHub | Gitee码云

google colab logo Google Colab: GitHub Link | Google Drive Link
:m: Model Zoo :arrow_double_down: Google Drive: Pretrained Models | Reproduced Experiments :arrow_double_down: 百度网盘: 预训练模型 | 复现实验
:file_folder: Datasets :arrow_double_down: Google Drive :arrow_double_down: 百度网盘 (提取码:basr)
:chart_with_upwards_trend: Training curves in wandb
:computer: Commands for training and testing
:zap: HOWTOs


BasicSR (Basic Super Restoration) is an open source image and video restoration toolbox based on PyTorch, such as super-resolution, denoise, deblurring, JPEG artifacts removal, etc.
(ESRGAN, EDVR, DNI, SFTGAN) (HandyView, HandyFigure, HandyCrawler, HandyWriting)

:sparkles: New Features

  • Nov 29, 2020. Add ESRGAN and DFDNet colab demo.
  • Sep 8, 2020. Add blind face restoration inference codes: DFDNet.
  • Aug 27, 2020. Add StyleGAN2 training and testing codes: StyleGAN2.
More
  • Sep 8, 2020. Add blind face restoration inference codes: DFDNet.
    ECCV20: Blind Face Restoration via Deep Multi-scale Component Dictionaries
    Xiaoming Li, Chaofeng Chen, Shangchen Zhou, Xianhui Lin, Wangmeng Zuo and Lei Zhang
  • Aug 27, 2020. Add StyleGAN2 training and testing codes.
    CVPR20: Analyzing and Improving the Image Quality of StyleGAN
    Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen and Timo Aila
  • Aug 19, 2020. A brand-new BasicSR v1.0.0 online.

:zap: HOWTOs

We provides simple pipelines to train/test/inference models for quick start. These pipelines/commands cannot cover all the cases and more details are in the following sections.

GAN
StyleGAN2 Train Inference
Face Restoration
DFDNet - Inference
Super Resolution
ESRGAN TODO TODO SRGAN TODO TODO
EDSR TODO TODO SRResNet TODO TODO
RCAN TODO TODO
EDVR TODO TODO DUF - TODO
BasicVSR TODO TODO TOF - TODO
Deblurring
DeblurGANv2 - TODO
Denoise
RIDNet - TODO CBDNet - TODO

:wrench: Dependencies and Installation

Pip install

pip install basicsr
  • pip installation does not compile cuda extensions.
  • If you want to use cuda extensions, set environment variable BASICSR_JIT=True. Note that every time you run the model, it will compile the extensions just time.
    • Example: StyleGAN2 inference colab.

Git clone and compile

  1. Clone repo

    git clone https://github.com/xinntao/BasicSR.git
    
  2. Install dependent packages

    cd BasicSR
    pip install -r requirements.txt
    
  3. Install BasicSR

    Please run the following commands in the BasicSR root path to install BasicSR:
    (Make sure that your GCC version: gcc >= 5)
    If you do need the cuda extensions:
    dcn for EDVR
    upfirdn2d and fused_act for StyleGAN2
    please add --cuda_ext when installing.
    If you use the EDVR and StyleGAN2 model, the above cuda extensions are necessary.

    python setup.py develop --cuda_ext
    

    Otherwise, install without compiling cuda extensions

    python setup.py develop
    

    You may also want to specify the CUDA paths:

    CUDA_HOME=/usr/local/cuda \
    CUDNN_INCLUDE_DIR=/usr/local/cuda \
    CUDNN_LIB_DIR=/usr/local/cuda \
    python setup.py develop
    

Note that BasicSR is only tested in Ubuntu, and may be not suitable for Windows. You may try Windows WSL with CUDA supports :-) (It is now only available for insider build with Fast ring).

:hourglass_flowing_sand: TODO List

Please see project boards.

:turtle: Dataset Preparation

  • Please refer to DatasetPreparation.md for more details.
  • The descriptions of currently supported datasets (torch.utils.data.Dataset classes) are in Datasets.md.

:computer: Train and Test

  • Training and testing commands: Please see TrainTest.md for the basic usage.
  • Options/Configs: Please refer to Config.md.
  • Logging: Please refer to Logging.md.

:european_castle: Model Zoo and Baselines

  • The descriptions of currently supported models are in Models.md.
  • Pre-trained models and log examples are available in ModelZoo.md.
  • We also provide training curves in wandb:

:memo: Codebase Designs and Conventions

Please see DesignConvention.md for the designs and conventions of the BasicSR codebase.
The figure below shows the overall framework. More descriptions for each component:
Datasets.md | Models.md | Config.md | Logging.md

overall_structure

:scroll: License and Acknowledgement

This project is released under the Apache 2.0 license.
More details about license and acknowledgement are in LICENSE.

:earth_asia: Citations

If BasicSR helps your research or work, please consider citing BasicSR.
The following is a BibTeX reference. The BibTeX entry requires the url LaTeX package.

@misc{wang2020basicsr,
  author =       {Xintao Wang and Ke Yu and Kelvin C.K. Chan and
                  Chao Dong and Chen Change Loy},
  title =        {BasicSR},
  howpublished = {\url{https://github.com/xinntao/BasicSR}},
  year =         {2020}
}

Xintao Wang, Ke Yu, Kelvin C.K. Chan, Chao Dong and Chen Change Loy. BasicSR. https://github.com/xinntao/BasicSR, 2020.

:e-mail: Contact

If you have any question, please email xintao.wang@outlook.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

basicsr-1.3.1.tar.gz (117.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basicsr-1.3.1-py3-none-any.whl (144.8 kB view details)

Uploaded Python 3

File details

Details for the file basicsr-1.3.1.tar.gz.

File metadata

  • Download URL: basicsr-1.3.1.tar.gz
  • Upload date:
  • Size: 117.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.5

File hashes

Hashes for basicsr-1.3.1.tar.gz
Algorithm Hash digest
SHA256 587e7a1b93455a91c63422bf3daa4af553a1b04f635abdfa4b21bf1c07e58442
MD5 330ec128a3faca43d46ca9b6f8386f69
BLAKE2b-256 05ab8151c3f624ea74eaea0f87cfd12a95311f506fbd68a2f93f55ee79723d04

See more details on using hashes here.

File details

Details for the file basicsr-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: basicsr-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 144.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.5

File hashes

Hashes for basicsr-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c1eb35ebc547cc956392425fd748ac52a23d1494adc066a98187e75ecda070c
MD5 f8947690f5afa152f689ea4485944333
BLAKE2b-256 ef995c02a2bb9289ca117982e9d683490ee5c264c914e30a99b8f25f5c890dd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page