JLD-demo / README.md
shreshthsaini's picture
Accept larger custom uploads with explicit paired demo resizing
5a57b41 verified
|
Raw History Blame Contribute Delete
2.85 kB
---
title: JLD Perceptual Distance
emoji: 馃攳
colorFrom: blue
colorTo: yellow
sdk: gradio
sdk_version: 6.29.1
python_version: "3.12"
app_file: app.py
pinned: false
license: mit
tags:
- image-quality-assessment
- perceptual-distance
- full-reference
- dinov2
- arxiv:2610.05967
---
An author-maintained interactive demo of **JLD: Perceptual Distance Through a Jacobian Lens**.
[Paper](https://arxiv.org/abs/2610.05967) 路 [Code](https://github.com/shreshthsaini/jld) 路 [Research website](https://shreshthsaini.github.io/jld/)
Upload an aligned reference/distorted pair, select JLD or JLD-fast, and obtain
a scalar distance plus a local lens response overlay. Lower means more similar.
The overlay excludes the global CLS term and is normalized separately for each pair.
Both images must be aligned and have the same size. Uploads may be up to
24 megapixels, 8192 pixels on the longest side, and 10 MB each. By default,
large pairs are reduced together with the same Lanczos filter to fit the
hosted scoring limit of 262,144 pixels and a longest side of 1024 pixels.
The result reports the original, resized, and scored dimensions. This score
is for the resized pair. Disable **Resize large pairs for this demo** to
require native resolution; large pairs then receive an explanatory error.
Small pairs keep their native pixels. RGB conversion and a center crop to
multiples of 14 pixels follow the official scorer. Use the local package for
native-resolution scoring of larger images. The pretrained encoder loads on hosted
startup, while the fitted lens is included in the package. The hosted Space uses
free shared ZeroGPU access; queueing and daily usage limits may apply.
## Local use with uv
```bash
uv add "jacobian-lens-distance @ https://github.com/shreshthsaini/jld/releases/download/v1.1.0/jacobian_lens_distance-1.1.0-py3-none-any.whl"
```
```python
from jld import JLD
metric = JLD.pretrained("full")
distance = metric("reference.png", "distorted.png")
```
To run this Space checkout locally:
```bash
uv run --python 3.12 --with-requirements requirements.txt app.py
```
The app runs on CPU and listens on localhost for local runs. Hugging Face manages
external access and dynamic GPU allocation when deployed as a ZeroGPU Space.
## Citation
```bibtex
@article{saini2026jld,
title={JLD: Perceptual Distance Through A Jacobian Lens},
author={Saini, Shreshth and Adsumilli, Balu and Bovik, Alan C.},
journal={arXiv preprint arXiv:2610.05967},
year={2026}
}
```
Code is MIT licensed. Bundled images have their own provenance and source reuse
statement in [examples/PROVENANCE.md](examples/PROVENANCE.md). Encoder weights
retain their upstream license. No uploaded images or scores are deliberately
archived by the app; Gradio and Hugging Face may keep temporary upload files
under their platform policies.