File size: 2,070 Bytes
457f311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d589e2b
457f311
 
 
 
764ca30
457f311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27dfb05
457f311
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
license: cc-by-nc-4.0
base_model:
- stabilityai/stable-diffusion-xl-base-1.0
tags:
- image-to-image
inference: false
---
# ✨ Latent Bridge Matching for Depth Estimation ✨

Latent Bridge Matching (LBM) is a new, versatile and scalable method proposed in [LBM: Latent Bridge Matching for Fast Image-to-Image Translation](https://arxiv.org/abs/2503.07535) that relies on Bridge Matching in a latent space to achieve fast image-to-image translation.
This model was trained to estimate the depth map from a given input image.
See also our [live demo](https://huggingface.co/spaces/jasperai/LBM_relighting) for image relighting and official [Github repo](https://github.com/gojasper/LBM).

## How to use?
To use this model you need first to install the associated `lbm` library by running the following
```bash
pip install git+https://github.com/gojasper/LBM.git
```

Then, you can infer with the model on your input images 
```python
import torch
from PIL import Image
from lbm.inference import evaluate, get_model

# Load model
model = get_model(
  "jasperai/LBM_depth",
  torch_dtype=torch.bfloat16,
  device="cuda",
)

# Load a source image
source_image = Image.open("your_image")

# Perform inference
output_image = evaluate(model, source_image, num_sampling_steps=1)
```

## Metrics
This model achieves the following metrics

| Metrics | AbsRel ↓  | δ1 ↑ | δ2 ↑ |
|---------|-----------|------|------|
| NYUv2   | 5.6       | 97.2 | 99.2 |
| Kitti   | 9.4       | 93.0 | 98.9 |
| ETH3D   | 6.3       | 96.5 | 99.3 |
| ScanNet | 5.7       | 97.0 | 99.2 |
| DIODE   | 30.3      | 77.5 | 89.3 |

## License
This code is released under the **Creative Commons BY-NC 4.0 license**.

## Citation
If you find this work useful or use it in your research, please consider citing us
```bibtex
@article{chadebec2025lbm,
      title={LBM: Latent Bridge Matching for Fast Image-to-Image Translation}, 
      author={Clément Chadebec and Onur Tasar and Sanjeev Sreetharan and Benjamin Aubin},
      year={2025},
      journal = {arXiv preprint arXiv:2503.07535},
}
```