Skip to main content

Measures and metrics for image2image tasks. PyTorch.

Project description


CI flake-8 style check CI testing
MIT License LinkedIn PyPI version

Table of Contents

About The Project

The project is intended to become a easy to use yet extensive library with metrics for various image-to-image tasks like denoising, super-resolution, image generation etc.



$ pip install photosynthesis-metrics

If you want to use the latest features straight from the master, clone the repo:

$ git clone

Wheel and pip installations will be added later.


To compute measure or metric, for instance SSIM index, use lower case function from the library:

import torch

from photosynthesis_metrics import ssim

prediction = torch.rand(3, 3, 256, 256)
target = torch.rand(3, 3, 256, 256)
ssim_index = ssim(prediction, target, data_range=1.)

In order to use SSIM as a loss function, use corresponding PyTorch module:

import torch

from photosynthesis_metrics import SSIMLoss

loss = SSIMLoss()
prediction = torch.rand(3, 3, 256, 256, requires_grad=True)
target = torch.rand(3, 3, 256, 256)
output = loss(prediction, target, data_range=1.)


See the open issues for a list of proposed features (and known issues).


Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please follow Google Python style guide as a guidance on your code style decisions. The code will be checked with flake-8 linter during the CI pipeline. Use commitizen commit style where possible for simplification of understanding of performed changes.


Distributed under the MIT License. See LICENSE for more information.


Sergey Kastryulin - @snk4tr -

Project Link:
PhotoSynthesis Team:

Other projects by PhotoSynthesis Team:


  • Pavel Parunin - @PavelParunin - idea proposal and development
  • Djamil Zakirov - @zakajd - development

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for photosynthesis-metrics, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size photosynthesis_metrics-0.1.0-py3-none-any.whl (33.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size photosynthesis_metrics-0.1.0.tar.gz (24.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page