LPIPS perceptual loss for JAX
Project description
JAX LPIPS
LPIPS perceptual loss implementation for JAX.
Information on the metric is available in the original repo.
Pretrained network and LPIPS linear weights are available on Hugging Face.
Installation
Install jaxlpips with:
pip install jaxlpips
Why?
There are already some LPIPS versions for JAX.
This implementation provides:
- Alexnet and VGG support
- trimmed pretrained network parameters and calculations
- safetensors for all parameters
Example
Supports "alexnet" and "vgg16" for pretrained_network to perform feature extraction.
Minimal example using dummy data:
import numpy as np
from jaxlpips import LPIPS
rng = np.random.default_rng(2781)
ref = rng.normal(size=(4, 64, 64, 3)).astype(np.float32)
tgt = rng.normal(size=(4, 64, 64, 3)).astype(np.float32)
lpips_loss_fn = LPIPS(pretrained_network="alexnet")
loss = lpips_loss_fn(ref, tgt)
References
[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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaxlpips-1.1.0.tar.gz.
File metadata
- Download URL: jaxlpips-1.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc373a11f562cc30f7673835183d0f9cc1d9759f8b572215b37609e7f8b4d6ea
|
|
| MD5 |
57d5d93108c39cc23cf65f9fa9c27018
|
|
| BLAKE2b-256 |
4417247e9da301e4943b485628137119ed4e94e2aadfd432c21a92f6fbb055c0
|
Provenance
The following attestation bundles were made for jaxlpips-1.1.0.tar.gz:
Publisher:
python-publish.yml on tux-type/jaxlpips
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jaxlpips-1.1.0.tar.gz -
Subject digest:
cc373a11f562cc30f7673835183d0f9cc1d9759f8b572215b37609e7f8b4d6ea - Sigstore transparency entry: 213067420
- Sigstore integration time:
-
Permalink:
tux-type/jaxlpips@4d5b6ccb6c4a9fb73d65e1c1f478bdc9f2f261d2 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/tux-type
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4d5b6ccb6c4a9fb73d65e1c1f478bdc9f2f261d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jaxlpips-1.1.0-py3-none-any.whl.
File metadata
- Download URL: jaxlpips-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
460f1e5a83e22abbda902753c3e35fd0cdac48d73c69b076289b4e5fe1d551cc
|
|
| MD5 |
b33679e36bc4513d7fe34753e3deebd4
|
|
| BLAKE2b-256 |
c78757f1783666173618377f08cef4f9be093e7343b677787423e89d850c9a8a
|
Provenance
The following attestation bundles were made for jaxlpips-1.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on tux-type/jaxlpips
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jaxlpips-1.1.0-py3-none-any.whl -
Subject digest:
460f1e5a83e22abbda902753c3e35fd0cdac48d73c69b076289b4e5fe1d551cc - Sigstore transparency entry: 213067421
- Sigstore integration time:
-
Permalink:
tux-type/jaxlpips@4d5b6ccb6c4a9fb73d65e1c1f478bdc9f2f261d2 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/tux-type
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4d5b6ccb6c4a9fb73d65e1c1f478bdc9f2f261d2 -
Trigger Event:
push
-
Statement type: