Measures and metrics for image2image tasks. PyTorch.
Project description
PhotoSynthesis.Metrics
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.
Prerequisites
- PyTorch 1.3+ :white_check_mark:
Installation
$ pip install photosynthesis-metrics
If you want to use the latest features straight from the master, clone the repo:
$ git clone https://github.com/photosynthesis-team/photosynthesis.metrics.git
Wheel and pip installations will be added later.
Usage
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.)
output.backward()
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - 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.
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Sergey Kastryulin - @snk4tr - snk4tr@gmail.com
Project Link: https://github.com/photosynthesis-team/photosynthesis.metrics
PhotoSynthesis Team: https://github.com/photosynthesis-team
Other projects by PhotoSynthesis Team:
PhotoSynthesis.Models: https://github.com/photosynthesis-team/photosynthesis.models
Acknowledgements
- 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.
Source Distribution
Built Distribution
Hashes for photosynthesis_metrics-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4195e0eb5bef3c30248c60db1d3d1f8ea023c72aa106e71a802e80fc7c9b87ce |
|
MD5 | 66d4aea0112c9c2ebd1a5d25836dcaf3 |
|
BLAKE2b-256 | 95ccce315cb8a1dce6eeeea245101c031975504385f24efd0b5147664aa50dd8 |
Hashes for photosynthesis_metrics-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d57cba0a1a7f7709580d0d0787b9572934a169024cf2162a886a8732baf25a1 |
|
MD5 | 30c005b57bebf5b738ef7881aeca8e5a |
|
BLAKE2b-256 | 2ac08a003dfbe88561589554f725e5240fc45ed51a1b87f3c87fd22a0e197155 |