PyTorch Image Quality (PIQ) v0.5.0 Release Notes
- New feature: Perceptual losses (StyleLoss, ContentLoss , LPIPS, DISTS)
- New feature: Visual Saliency-induced Index (VSI)
- New feature: Feature Similarity (FSIM/FSIMc)
- New feature: `piq.functional`
- Code quality assessment
- BugFix
New Features
Perceptual losses (StyleLoss, ContentLoss , LPIPS and DISTS) (96, 131)
[Content loss](https://arxiv.org/abs/1508.06576), [Style loss](https://arxiv.org/abs/1508.06576), [Learned Perceptual Image Patch Similarity (LPIPS)](http://arxiv.org/abs/1801.03924) and [Deep Image Structure and Texture Similarity (DISTS)](https://arxiv.org/abs/2004.07728) metrics were added to the library. One could choose the extractor VGG16 or VGG19. Any number of layers is supported. Any weights are supported. One can use per-level (Style transfer case) or per-feature (as in LPIPS) weights. Check out [Examples](https://github.com/photosynthesis-team/piq/tree/v0.5.0#examples) at README.md for more details.
Visual Saliency-induced Index (VSI) (119)
The [Visual Saliency-induced Index (VSI)](https://ieeexplore.ieee.org/document/6873260) was introduced into the library in this release. The VSI is compatible with greyscale and RGB images. In case of greyscale, the only channel is copied to imitate RGB colour space. The VSI was compared with the original [MATLAB implementation](http://sse.tongji.edu.cn/linzhang/IQA/VSI/VSI.htm). Tests show that our implementation produces the same result. Check out [Examples](https://github.com/photosynthesis-team/piq/tree/v0.5.0#examples) at README.md for more details.
Feature Similarity (FSIM/FSIMc) (104)
The [Feature Similarity (FSIM/FSIMc)](https://www4.comp.polyu.edu.hk/~cslzhang/IQA/TIP_IQA_FSIM.pdf) was also included in this release. The FSIM measure is compatible with greyscale and RGB images, but only the luminance component is used. The FSIMc extension takes chrominance components into account. The FSIM and FSIMc were compared with the original [MATLAB implementation](https://www4.comp.polyu.edu.hk/~cslzhang/IQA/FSIM/Files/FeatureSIM.m). Tests show that our implementation produces the same result. Check out [Examples](https://github.com/photosynthesis-team/piq/tree/v0.5.0#examples) at README.md for more details.
`piq.functional` (104, 119, 135)
With this release, we introduce `piq.functional`, which contains the most common functions such as colour space conversions, filters, mesh grid, similarity and gradient maps. The decision was made in order to reduce copy-paste code and improve readability providing the user with the ability to reuse implemented functionality for their own needs.
Code quality assessment (99)
[CodeCov](https://codecov.io/gh/photosynthesis-team/piq) was introduced to the project to improve the quality of the contributed code to the library. The Codecov bot posts reports directly to pull requests highlighting the test coverage of the code.
BugFixes
GS (112)
The issue (111) with memory losses and the number of open files compatibility was resolved. The context manager was added to handle pool closure after its use.
BRISQUE Data Range (110)
The issue (108) with pixel values range to be used was resolved. The functionality is aligned with [MATLAB implementation](https://github.com/bukalapak/pybrisque).
VIF (94)
- Tests were added to cover bug behaviour;
- EPS constant was added before division to avoid NaN;
- Some checks were introduced from original MATLAB implementation that have been missed;
- Reduction parameter was added;
- Another small bug was fixed.
SonarCloud (117)
The code was refactored to meet the code style requirements and to remove sonarcloud code smells.
SSIM/MS-SSIM and BRISQUE Refactoring (134)
- The implementations of the SSIM/MS-SSIM and BRISQUE metrics were optimised for better readability and utility;
- The implementations were compared with available TensorFlow and MATLAB implementation on real images using new tests;
- Fixed huge memory consumption during SSIM/MS-SSIM testing (126);
- Other tests were refactored to improve readability and coverage. It allows flexible testing on all available devices (`cpu` and/or `gpu`) depending on the workstation for deployment.
**Contributors**: bonlime, denproc, zakajd, snk4tr.