Skip to content

Peak signal-to-noise ratio and The structural similarity calculation tool

Notifications You must be signed in to change notification settings

jsh-me/psnr-ssim-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calculate PSNR and SSIM between original and inpainting result files

  • Peak signal-to-noise ratio(PSNR) is an engineering term for the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its representation.

  • The structural similarity (SSIM) index is a method for predicting the perceived quality of digital television and cinematic pictures, as well as other kinds of digital images and videos. The SSIM index is calculated on various windows of an image.

    • The measure between two windows x and y of common size N×N is:


This Repository was created to experiment with the thesis below.

Performance can be measured in all images, even if you don't use the thesis below!


Environment to run test paper

Test Paper : https://github.com/nbei/Deep-Flow-Guided-Video-Inpainting

  • python 3.6.5

  • torch 1.5.1

  • torchvision 0.6.0

  • Quadro RTX 6000


Networks

  • Resnet-50

  • LiteFlowNet

  • DeepFillv1


Requirements

  • numpy 1.15.4
  • tqdm
  • opencv-python 4.1.0.25

Usage

  • if you need to resize the result image, use interpolation option(optional). I didn't use it at the command below.

  1. PSNR

  • PSNR between original and the results of image Inpainting
python psnr.py --original [original image file] --contrast [contrast image file]
  • PSNR between original and the results of video Inpainting
python psnr.py --video --original [original video frame folder path] --contrast [contrast video frame folder path]

  1. SSIM

  • SSIM between original and the results of image Inpainting
python ssim.py --original [original image file] --contrast [contrast image file]
  • SSIM between original and the results of video Inpainting
python ssim.py --video --original [original video frame folder path] --contrast [contrast video frame folder path]

Example

  • image :
python ssim.py --original ./frame/00001.jpg --contrast ./result/00001.png

  • video:
python ssim.py --video --original ./frame/ --contract ./result/

About

Peak signal-to-noise ratio and The structural similarity calculation tool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages