Skip to main content

Pytorch implementation of Shift-tolerant LPIPS

Project description

ShiftTolerant-LPIPS

Shift-tolerant Perceptual Similarity Metric

Abhijay Ghildyal, Feng Liu. In ECCV, 2022. [Arxiv]

from stlpips_pytorch import stlpips
from stlpips_pytorch import utils

path0 = "<dir>/ShiftTolerant-LPIPS/imgs/ex_p0.png"
path1 = "<dir>/ShiftTolerant-LPIPS/imgs/ex_ref.png"

img0 = utils.im2tensor(utils.load_image(path0))
img1 = utils.im2tensor(utils.load_image(path1))

stlpips_metric = stlpips.LPIPS(net="alex", variant="shift_tolerant")

stlpips_metric(img0,img1)
# 0.7777554988861084

Citation

If you find this repository useful for your research, please use the following.

@inproceedings{ghildyal2022stlpips,
  title={Shift-tolerant Perceptual Similarity Metric},
  author={Ghildyal, Abhijay and Liu, Feng},
  booktitle={European Conference on Computer Vision},
  year={2022}
}

Acknowledgements

This repository borrows from LPIPS, Anti-aliasedCNNs, and CNNsWithoutBorders. We thank the authors of these repositories for their incredible work and inspiration.

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

stlpips_pytorch-0.0.2.tar.gz (63.8 MB view hashes)

Uploaded Source

Built Distribution

stlpips_pytorch-0.0.2-py3-none-any.whl (63.8 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page