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

Fix reference to skimage dependency #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Resolve
this function has been removed in latest skimage.

`from skimage.measure import compare_ssim`

Change to `skimage.metrics.structural_similarity`

see williamfzc/stagesepx#150 for similar issue
  • Loading branch information
bshyong authored Apr 26, 2022
commit 86eb29d4a451a2c1dbbc29a1bc179b27b3f927ba
4 changes: 2 additions & 2 deletions lpips/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def psnr(p0, p1, peak=255.):
return 10*np.log10(peak**2/np.mean((1.*p0-1.*p1)**2))

def dssim(p0, p1, range=255.):
from skimage.measure import compare_ssim
return (1 - compare_ssim(p0, p1, data_range=range, multichannel=True)) / 2.
from skimage.metrics import structural_similarity
return (1 - structural_similarity(p0, p1, data_range=range, multichannel=True)) / 2.

def tensor2np(tensor_obj):
# change dimension of a tensor object into a numpy array
Expand Down