GithubHelp home page GithubHelp logo

efonte / neosr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from muslll/neosr

0.0 0.0 0.0 5.01 MB

neosr is a framework for training real-world single-image super-resolution networks.

Home Page: https://github.com/muslll/neosr

License: Apache License 2.0

Python 100.00%

neosr's Introduction

neosr

neosr is a framework for training real-world single-image super-resolution networks. wiki.


Join our Discord
news 05.09.2024 - Release Real-PLKSR network. wiki
05.08.2024 - Release Nomos-v2 dataset. For more details, see datasets

๐Ÿค support me

Tip

Consider supporting me on KoFi โ˜• or Patreon

๐Ÿ’ป installation

Requires Python 3.11 and CUDA =>11.8. Install latest Pytorch (=>2.1) and TorchVision (required).

Clone the repository:

git clone https://github.com/muslll/neosr
cd neosr

Then install other dependencies via pip:

pip install -e .

Alternatively, use poetry (recommended on linux):

poetry install
poetry add torch@latest torchvision@latest

Note: You must use poetry shell to enter the env after installation.

(optional) If you want to convert your models (convert.py), you need the following dependencies:

pip install onnx onnxruntime-gpu onnxconverter-common onnxsim

You can also install using poetry (recommended on linux):

poetry add onnx onnxruntime-gpu onnxconverter-common onnxsim

Please read the wiki tutorial for converting your models.

quick start

Start training by running:

python train.py -opt options.yml

Where options.yml is a configuration file. Templates can be found in options.

Tip

Please read the wiki Configuration Walkthrough for an explanation of each option.

features

Supported archs:

arch option
Real-ESRGAN esrgan
SRVGGNetCompact compact
SwinIR swinir_small, swinir_medium
HAT hat_s, hat_m, hat_l
OmniSR omnisr
SRFormer srformer_light, srformer_medium
DAT dat_small, dat_medium, dat_2
DITN ditn
DCTLSA dctlsa
SPAN span
Real-CUGAN cugan
CRAFT craft
SAFMN safmn, safmn_l
RGT rgt, rgt_s
ATD atd, atd_light
PLKSR plksr, plksr_tiny
RealPLKSR realplksr, realplksr_s
DRCT drct, drct_l, drct_s
EFEN efen

Note

For all arch-specific parameters, read the wiki.

Under Testing

arch option

Supported Discriminators:

net option
U-Net w/ SN unet
A2-FPN w/ SN a2fpn
PatchGAN w/ SN patchgan

Supported Optimizers:

optimizer option
Adam Adam or adam
AdamW AdamW or adamw
NAdam NAdam or nadam
Lion Lion or lion
LAMB Lamb or lamb
Adan Adan or adan

Supported losses:

loss option
L1 Loss L1Loss, l1
L2 Loss MSELoss, l2
Huber Loss HuberLoss, huber
CHC (Clipped Huber with Cosine Similarity Loss) chc, chc_l2
Perceptual Loss perceptual_opt, PerceptualLoss
GAN gan_opt, GANLoss, MultiScaleGANLoss
YCbCr Color Loss (bt601) color_opt, colorloss
Luma Loss (CIE L*) luma_opt lumaloss
MS-SSIM mssim_opt mssim
LDL Loss ldl_opt
Focal Frequency ff_opt, focalfrequencyloss
DISTS dists_opt, dists
Wavelet Guided wavelet_guided
Gradient-Weighted gw_opt, gw_loss

Supported Augmentations:

augmentation option
Rotation use_rot
Flip use_hflip
MixUp mixup
CutMix cutmix
ResizeMix resizemix
CutBlur cutblur

Supported models:

model description option
Default Base model, supports both Generator and Discriminator default
OTF Builds on top of default, adding Real-ESRGAN on-the-fly degradations otf

Supported dataset loaders:

loader option
Paired datasets paired
Single datasets (for inference, no GT required) single
Real-ESRGAN on-the-fly degradation otf

๐Ÿ“ธ datasets

As part of neosr, I have released a dataset series called Nomos. The purpose of these datasets is to distill only the best images from the academic and community datasets. A total of 14 datasets were manually reviewed and processed, including: Adobe-MIT-5k, RAISE, LSDIR, LIU4k-v2, KONIQ-10k, Nikon LL RAW, DIV8k, FFHQ, Flickr2k, ModernAnimation1080_v2, Rawsamples, SignatureEdits, Hasselblad raw samples and Unsplash.

  • Nomos-v2 (recommended): contains 6000 images, multipurpose. Data distribution:
pie
  title Nomos-v2 distribution
  "Animal / fur" : 439
  "Interiors" : 280
  "Exteriors / misc" : 696
  "Architecture / geometric" : 1470
  "Drawing / painting / anime" : 1076
  "Humans" : 598
  "Mountain / Rocks" : 317
  "Text" : 102
  "Textures" : 439
  "Vegetation" : 574
Loading
  • nomos_uni (recommended for lightweight networks): contains 2989 images, multipurpose. Meant to be used on lightweight networks (<800k parameters).
  • hfa2k: contains 2568 anime images.
dataset download sha256
nomosv2 (3GB) sha256
nomosv2.lmdb (3GB) sha256
nomosv2_lq_4x (187MB) sha256
nomosv2_lq_4x.lmdb (187MB) sha256
nomos_uni (1.3GB) sha256
nomos_uni.lmdb (1.3GB) sha256
nomos_uni_lq_4x sha256
nomos_uni_lq_4x.lmdb sha256
hfa2k sha256

community datasets

Datasets made by the upscaling community. More info can be found in the Enhance Everything discord

  • FaceUp: Curated version of FFHQ
  • SSDIR: Curated version of LSDIR.
  • kim's 8k Dataset V2: Video Game Dataset
dataset download
@Kim2091 8k Dataset V2 GDrive (33.5GB)
@Phhofm FaceUp GDrive (4GB)
@Phhofm SSDIR Gdrive (4.5GB)

resources

๐Ÿ“„ license and acknowledgements

Released under the Apache license. All licenses listed on license/readme. This code was originally based on BasicSR.

Thanks to victorca25/traiNNer, styler00dollar/Colab-traiNNer and timm for providing helpful insights into some problems.

Thanks to contributors @Phhofm, @Sirosky, @Kim2091, @terrainer, @Corpsecreate and @umzi2 for helping with tests and bug reporting.

neosr's People

Contributors

xinntao avatar muslll avatar umzi2 avatar liangbinxie avatar terrainer avatar corpsecreate avatar cugtyt avatar wwhio avatar rundevelopment avatar joeyballentine avatar zenjieli avatar wenlongzhang0517 avatar orgoro avatar ira7bar avatar ibobbyts avatar csjliang avatar xpixeler avatar phhofm avatar my-zhu avatar ljzycmd avatar mikewando avatar lotayou avatar kim2091 avatar jeremyiv avatar henrymai avatar zestloveheart avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.