Giter VIP home page Giter VIP logo

psnr-ssim-tool's Introduction

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/

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.