Skip to content

An implementation of the Fast Super-Resolution Convolutional Neural Network in TensorFlow with a focus on artifact mitigation

License

Notifications You must be signed in to change notification settings

nessotrin/FSRCNN-TensorFlow

 
 

Repository files navigation

FSRCNN-TensorFlow

TensorFlow implementation of the Fast Super-Resolution Convolutional Neural Network (FSRCNN). This implements two models: FSRCNN which is more accurate but slower and FSRCNN-s which is faster but less accurate. Based on this project.

This fork

Nothing that special about it. This is an optimized fork of HelpSeeker's FSRCNNX-distortion. See DISTORT.md for more info.

Improvements

  • TensorFlow 2 (much faster training)
  • AdamW optimizer (thanks to TF2)
  • Lower RAM requirements
  • Ported improvements from igv's fork
  • Dataset caching
  • More realistic selectable compression types
  • Optimized shader generation
  • Large cleanups

Runs 4x faster !

Much faster with comparable visual quality to HelpSeeker's x2 16-0-4-1. Optimized x2 12-0-4-1 models run at 4K60 on modern AMD iGPU laptops.

Prerequisites

  • Python 3
  • TensorFlow >= 2
  • CUDA & cuDNN >= 6.0
  • Pillow
  • pillow_avif
  • FFmpeg
  • NumPy
  • Natsort

Usage

You can specify epochs, learning rate, data directory, etc:
python main.py --distort --epoch 100 --batch_size 32 --learning_rate 1e-4 --checkpoint_dir my_checkpoint --train_dir Train --test_dir Test --test_image test_image.png

Dump weights:
python main.py --checkpoint_dir my_checkpoint --save-params my_cool_name

Make an MPV compatible shader:
python gen_v2.py params/weights_2_12_0_4_1.my_cool_name.txt

Check main.py for all the possible flags.

Result (Outdated)

Original butterfly image:

orig

Ewa_lanczos interpolated image:

ewa_lanczos

Super-resolved image:

fsrcnn

Additional datasets

TODO

  • Release weights and shaders

References

About

An implementation of the Fast Super-Resolution Convolutional Neural Network in TensorFlow with a focus on artifact mitigation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%