Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
pytorch structural similarity (SSIM) loss
| Date | Stars |
|---|---|
| 2026-07-30 | 1949 |
| 2026-08-09 | 1948 |
| 2026-08-18 | 1949 |
| 2026-08-30 | 1949 |
| 2026-09-01 | 1949 |
| 2026-09-02 | 1949 |
| 2026-09-30 | 1950 |
| 2026-10-10 | 1949 |
| 2026-10-19 | 1949 |
| 2026-10-23 | 1949 |
| 2026-10-25 | 1949 |
| 2026-10-29 | 1949 |
| 2026-11-03 | 1949 |
| 2026-11-04 | 1948 |
Today
-1 stars today
This week
-1 stars this week
This month
-2 stars this month
Momentum
0.0
growth rate 0.00%/day
# pytorch-ssim (This repo is not maintained)
The code doesn't work because it is on super old pytorch.
### Differentiable structural similarity (SSIM) index.
 
## Installation
1. Clone this repo.
2. Copy "pytorch_ssim" folder in your project.
## Example
### basic usage
```python
import pytorch_ssim
import torch
from torch.autograd import Variable
img1 = Variable(torch.rand(1, 1, 256, 256))
img2 = Variable(torch.rand(1, 1, 256, 256))
if torch.cuda.is_available():
img1 = img1.cuda()
img2 = img2.cuda()
print(pytorch_ssim.ssim(img1, img2))
ssim_loss = pytorch_ssim.SSIM(window_size = 11)
print(ssim_loss(img1, img2))
```
### maximize ssim
```python
import pytorch_ssim
import torch
from torch.autograd import Variable
from torch import optim
import cv2
import numpy as np
npImg1 = cv2.imread("einstein.png")
img1 = torch.from_numpy(np.rollaxis(npImg1, 2)).float().unsqueeze(0)/255.0
img2 = torch.rand(img1.size())
if torch.cuda.is_available():
img1 = img1.cuda()
img2 = img2.cuda()
img1 = Variable( img1, requires_grad=False)
img2 = Variable( img2, requires_grad = True)
# Functional: pytorch_ssim.ssim(img1, img2, window_size = 11, size_average = True)
ssim_value = pytorch_ssim.ssim(img1, img2).data[0]
print("Initial ssim:", ssim_value)
# Module: pytorch_ssim.SSIM(window_size = 11, size_average = True)
ssim_loss = pytorch_ssim.SSIM()
optimizer = optim.Adam([img2], lr=0.01)
while ssim_value < 0.95:
optimizer.zero_grad()
ssim_out = -ssim_loss(img1, img2)
ssim_value = - ssim_out.data[0]
print(ssim_value)
ssim_out.backward()
optimizer.step()
```
## Reference
https://ece.uwaterloo.ca/~z70wang/research/ssim/
Excerpt of 1,859 characters
Read on GitHub16
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:92fe06a4e27396a5, topic:pytorch, readme:autograd