vulus98 commited on
Commit
93dc1d5
Β·
verified Β·
1 Parent(s): a77364e

Initial release: unified PaGeR (depth + normals + sky + indoor/outdoor scale heads)

Browse files
Files changed (3) hide show
  1. README.md +124 -0
  2. config.yaml +12 -0
  3. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - depth-estimation
5
+ - surface-normals
6
+ - panoramic-images
7
+ - equirectangular
8
+ - high-resolution
9
+ - computer-vision
10
+ - in-the-wild
11
+ - zero-shot
12
+ pipeline_tag: depth-estimation
13
+ ---
14
+
15
+ <h1 align="center"> πŸ“Ÿ PaGeR β€” Unified Panoramic Geometry Estimation Model Card</h1>
16
+
17
+ <p align="center">
18
+ <a title="Github" href="https://github.com/prs-eth/PaGeR" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
19
+ <img src="https://img.shields.io/github/stars/prs-eth/PaGeR?label=GitHub%20%E2%98%85&logo=github&color=C8C" alt="Github">
20
+ </a>
21
+ <a title="Website" href="https://prs-eth.github.io/PaGeR/" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
22
+ <img src="https://img.shields.io/badge/%E2%99%A5%20Project%20-Website-blue" alt="Website">
23
+ </a>
24
+ <a title="arXiv" href="https://arxiv.org/abs/TBD" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
25
+ <img src="https://img.shields.io/badge/%F0%9F%93%84%20Read%20-Paper-AF3436" alt="arXiv">
26
+ </a>
27
+ <a title="Hugging Face" href="https://huggingface.co/spaces/prs-eth/PaGeR" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
28
+ <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-FFD21E" alt="Hugging Face Spaces">
29
+ </a>
30
+ <a title="PanoInfinigen dataset" href="https://huggingface.co/datasets/prs-eth/PanoInfinigen" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
31
+ <img src="https://img.shields.io/badge/Dataset-PanoInfinigen-7e57c2" alt="PanoInfinigen dataset">
32
+ </a>
33
+ <a title="License" href="LICENSE" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
34
+ <img src="https://img.shields.io/badge/License-Apache%202.0-green" alt="License">
35
+ </a>
36
+ </p>
37
+
38
+ `PaGeR` is the **unified** geometry-estimation checkpoint released with our paper:
39
+
40
+ - **Paper:** *Unified Panoramic Geometry Estimation via Multi-View Foundation Models* β€” [arXiv (TBD)](https://arxiv.org/abs/TBD)
41
+
42
+ From a single equirectangular (ERP) panorama, one forward pass returns:
43
+
44
+ - **Scale-invariant depth** at full panoramic resolution,
45
+ - **Metric depth** in metres via a parallel coarse scale head,
46
+ - **Surface normals** as unit vectors in the panorama's world frame,
47
+ - **Sky segmentation** for masking unbounded depth regions.
48
+
49
+ Indoor and outdoor scenes are served by twin scale heads selected at inference time by a lightweight Places365 classifier, so a single checkpoint covers both regimes.
50
+
51
+ You can also browse the rest of our [PaGeR HF collection](https://huggingface.co/collections/prs-eth/pager) or try the [interactive demo](https://huggingface.co/spaces/prs-eth/PaGeR).
52
+
53
+ ## Model Details
54
+
55
+ - **Developed by:** [Vukasin Bozic](https://vulus98.github.io/), [Isidora Slavkovic](https://linkedin.com/in/isidora-slavkovic), [Dominik Narnhofer](https://scholar.google.com/citations?user=tFx8AhkAAAAJ&hl=en), [Nando Metzger](https://nandometzger.github.io/), [Denis Rozumny](https://rozumden.github.io/), [Konrad Schindler](https://scholar.google.com/citations?user=FZuNgqIAAAAJ), [Nikolai Kalischek](https://scholar.google.com/citations?user=XwzlnZoAAAAJ&hl=de).
56
+ - **Model type:** Feed-forward, multi-view foundation-model adaptation for single-image panoramic geometry estimation (depth + normals + sky + metric scale).
57
+ - **Backbone:** [Depth Anything 3](https://github.com/ByteDance-Seed/Depth-Anything-3) (`da3-giant`, ViT-Giant), repurposed for cubemap-based multi-view processing of the panorama.
58
+ - **Inputs:** A single ERP panorama, internally projected onto a 6-face cubemap at 504 px per face.
59
+ - **Outputs (in one forward pass):**
60
+ - **Scale-invariant depth map** at panoramic resolution.
61
+ - **Metric depth** (metres), produced by combining the depth map with the selected indoor / outdoor scale head.
62
+ - **Surface normals** as unit vectors in the panorama's world frame.
63
+ - **Sky mask** for filling/masking unbounded regions in the depth and normal outputs.
64
+ - **Indoor / outdoor routing:** A lightweight Places365 classifier auto-selects between the twin scale heads at inference time; the routing can be overridden by the user (`--scene_mode {auto,indoor,outdoor}`).
65
+ - **Resolution:** Designed for high-resolution ERP inputs, up to 3K.
66
+ - **License:** [Apache License 2.0](LICENSE). The DA3 backbone weights are released under their own license; please refer to the [Depth Anything 3 repository](https://github.com/ByteDance-Seed/Depth-Anything-3) for those terms.
67
+ - **Resources for more information:** [Project Website](https://prs-eth.github.io/PaGeR/), [Paper](https://arxiv.org/abs/TBD), [Code](https://github.com/prs-eth/PaGeR).
68
+
69
+ ### Other released checkpoints
70
+
71
+ | Checkpoint | Hugging Face id | Depth | Normals | Sky |
72
+ |---|---|---|---|---|
73
+ | **PaGeR** *(this card, recommended)* | [`prs-eth/PaGeR`](https://huggingface.co/prs-eth/PaGeR) | βœ… | βœ… | βœ… |
74
+ | PaGeR-Metric-Depth | [`prs-eth/PaGeR-metric-depth`](https://huggingface.co/prs-eth/PaGeR-metric-depth) | βœ… (metric) | | |
75
+ | PaGeR-Normals | [`prs-eth/PaGeR-normals`](https://huggingface.co/prs-eth/PaGeR-normals) | | βœ… | |
76
+
77
+ ## Usage
78
+
79
+ A minimal Python snippet that runs the unified model on a single panorama:
80
+
81
+ ```python
82
+ from pathlib import Path
83
+
84
+ import matplotlib.pyplot as plt
85
+ import numpy as np
86
+ import torch
87
+ from huggingface_hub import hf_hub_download
88
+ from omegaconf import OmegaConf
89
+ from PIL import Image
90
+
91
+ from src.pager import Pager
92
+ from src.utils.geometry_utils import erp_to_cubemap
93
+ from src.utils.utils import prepare_depth_for_logging, prepare_normals_for_logging
94
+
95
+ checkpoint = "prs-eth/PaGeR" # or a local directory
96
+ device = torch.device("cuda")
97
+
98
+ config_path = hf_hub_download(repo_id=checkpoint, filename="config.yaml")
99
+ cfg = OmegaConf.load(config_path)
100
+
101
+ pager = Pager(checkpoint, cfg=cfg, device=device)
102
+ pager.get_intrinsics_extrinsics(image_size=cfg.face_size, fov=getattr(cfg, "cube_fov", 90.0))
103
+ pager.model.to(device).eval()
104
+
105
+ panorama = np.array(Image.open("examples/example_1.jpg").convert("RGB")) / 255.0
106
+ panorama = torch.from_numpy(panorama).permute(2, 0, 1).float() * 2 - 1
107
+ rgb_cubemap = erp_to_cubemap(panorama, face_w=cfg.face_size,
108
+ fov=getattr(cfg, "cube_fov", 90.0)).unsqueeze(0).to(device)
109
+
110
+ with torch.inference_mode():
111
+ pred = pager(rgb_cubemap, dtype=torch.float16, skip_heads={"scale_indoor"})
112
+
113
+ cmap = plt.get_cmap("Spectral")
114
+ H, W = panorama.shape[-2:]
115
+ depth_metric, _ = prepare_depth_for_logging(
116
+ pager, pred["depth"][0], pred["sky"][0], (H, W), cmap,
117
+ log_scale=pred["scale"],
118
+ )
119
+ normals, _ = prepare_normals_for_logging(
120
+ pager, pred["normals"][0], pred["sky"][0], (H, W),
121
+ )
122
+ ```
123
+
124
+ `depth_metric` is a `(1, H, W)` float32 array of metric depth (metres); `normals` is a `(3, H, W)` unit-normal field. Both already have the predicted sky region filled in. See the [GitHub repository](https://github.com/prs-eth/PaGeR) for the full CLI (`inference.py`), evaluation scripts, the Gradio demo (`app.py`), and the point-cloud exporter.
config.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Released PaGeR (unified).
2
+ pretrained_model_name: da3-giant
3
+ modalities:
4
+ - depth
5
+ - normals
6
+ - sky
7
+ - scale_indoor
8
+ - scale_outdoor
9
+ face_size: 504
10
+ log_depth: true
11
+ valid_conv_padding: true
12
+ scale_head_downsample_factor: 4
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6808a83ddd04e45f67b4da2d457b3cacaf11de25a84841fdcefcbe32cea6c3b0
3
+ size 5656631668