Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/S-aiueo32/lpips-pytorch
A simple and useful implementation of LPIPS.
https://github.com/S-aiueo32/lpips-pytorch
deep-learning deep-neural-networks lpips perceptual-metric perceptual-similarity
Last synced: about 1 month ago
JSON representation
A simple and useful implementation of LPIPS.
- Host: GitHub
- URL: https://github.com/S-aiueo32/lpips-pytorch
- Owner: S-aiueo32
- License: bsd-2-clause
- Created: 2020-01-31T08:16:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-29T16:38:00.000Z (about 1 year ago)
- Last Synced: 2024-08-02T13:20:49.315Z (5 months ago)
- Topics: deep-learning, deep-neural-networks, lpips, perceptual-metric, perceptual-similarity
- Language: Python
- Homepage:
- Size: 663 KB
- Stars: 151
- Watchers: 5
- Forks: 25
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lpips-pytorch
[![CircleCI](https://circleci.com/gh/S-aiueo32/lpips-pytorch.svg?style=svg)](https://circleci.com/gh/S-aiueo32/lpips-pytorch) ![](https://img.shields.io/badge/LPIPS%20ver.-0.1-brightgreen)## Description
Developing perceptual distance metrics is a major topic in recent image processing problems.
LPIPS[1] is a state-of-the-art perceptual metric based on human similarity judgments.
The official implementation is not only publicly available as a metric, but also enables users to train the new metric by themselves.
In other words, The official implementation has less simplicity by the high-level wrapping for training.
This repository provides an alternative simple and useful implementation of LPIPS.
This output is definitely the same result because the weights are converted from the original one.## Requirement
- `torch` >= 1.3
- `torchvision` >= 0.4## Usage
```python
from lpips_pytorch import LPIPS, lpips# define as a criterion module (recommended)
criterion = LPIPS(
net_type='alex', # choose a network type from ['alex', 'squeeze', 'vgg']
version='0.1' # Currently, v0.1 is supported
)
loss = criterion(x, y)# functional call
loss = lpips(x, y, net_type='alex', version='0.1')
```## Install
1. Clone this repository and move into your project
```shell
~ $ git clone https://github.com/S-aiueo32/lpips-pytorch.git
~ $ mv lpips-pytorch/lpips-pytorch
```
2. Install by `pip`
```shell
$ pip install git+https://github.com/S-aiueo32/lpips-pytorch.git
```## License
[BSD 2-Clause "Simplified" License](LICENSE).## Reference
1. Zhang, Richard, et al. "The unreasonable effectiveness of deep features as a perceptual metric." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018.## Acknowledgements
This project directly uses the original weights, many thanks to the authors.