Coder Social home page Coder Social logo

calc_psnr's Introduction

Calculation of Peak Signal-to-Noise Ratio and Structural Similarity between two pictures

The scrip is extracted from SWINIR And it should be applied on the saving format of EDSR

Opencv-Python, torch (cpu is enough) are needed.

python psnr_only.py --task classical_sr --scale 4 --folder_gt  {benchmark_path}/benchmark/{benchmark_name}/HR --folder_sr {result_save_path}/results-{benchmark_name}

And I found that when calculting the metrics, it applys on image one by one, which is extremely slow, so I add a multi-process edition on the origin script, so we have psnr_multi.py. By tring, I found when the largeur of process pool is 20, it is the fastest for 5 benchmark datasets of super-resolution.

python psnr_multi.py --task classical_sr --scale 4 --folder_gt  {benchmark_path}/benchmark/{benchmark_name}/HR --folder_sr {result_save_path}/results-{benchmark_name}

At last I think when running the script on different benchmark, I have to change the benchmark name everytime and I found it annoying, so I write another file that helps me execute this script, which is ssim_shell.py, it also writes logs in the file path of certain experiment.

Just

python ssim_shell.py --exp_name {the saved experiment name} --scale {scale, scale is important when cropping the border}

Normally it finishes calculating on 5 benchmarks within 30 secondes.

calc_psnr's People

Contributors

owxiaom avatar

Watchers

 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.