Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FSIM and FSIMc #109

Merged
merged 13 commits into from
Jul 7, 2020
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,35 @@ output.backward()
</p>
</details>

<!-- FSIM EXAMPLES -->
<details>
<summary>Feature Similarity Index Measure (FSIM)</summary>
<p>

To compute [FSIM ](https://www4.comp.polyu.edu.hk/~cslzhang/IQA/TIP_IQA_FSIM.pdf) as a measure, use lower case function from the library:
zakajd marked this conversation as resolved.
Show resolved Hide resolved
```python
import torch
from piq import fsim

prediction = torch.rand(3, 3, 256, 256)
target = torch.rand(3, 3, 256, 256)
vsi_index: torch.Tensor = fsim(prediction, target, data_range=1.)
```

In order to use FSIM as a loss function, use corresponding PyTorch module:
```python
import torch
from piq import FSIMLoss

loss = FSIMLoss(data_range=1.)
prediction = torch.rand(3, 3, 256, 256, requires_grad=True)
target = torch.rand(3, 3, 256, 256)
output: torch.Tensor = loss(prediction, target)
output.backward()
```
</p>
</details>

<!-- BRISQUE EXAMPLES -->
<details>
<summary>Blind/Referenceless Image Spatial Quality Evaluator (BRISQUE)</summary>
Expand Down
1 change: 1 addition & 0 deletions piq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
from .brisque import BRISQUELoss, brisque
from .perceptual import StyleLoss, ContentLoss, LPIPS
from .psnr import psnr
from .fsim import fsim, FSIMLoss
Loading