Spaces:
Configuration error
Configuration error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,33 +1,57 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 4.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
-
- **fused point cloud** (`fused.ply`)
|
| 14 |
-
- **textured‑agnostic mesh** (`mesh.obj`) and **`mesh.glb`** for GIS/CAD viewers
|
| 15 |
|
| 16 |
-
|
| 17 |
-
- Walk an arc with ~60–70% overlap between frames.
|
| 18 |
-
- Mix wide + closer shots; include ground/verticals.
|
| 19 |
-
- Avoid heavy motion (cars/people) if possible.
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
-
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "2D → 3D Reconstruction (GLPN + Open3D)"
|
| 3 |
+
emoji: 🏠
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.29.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
tags:
|
| 12 |
+
- depth-estimation
|
| 13 |
+
- monocular
|
| 14 |
+
- 3d-reconstruction
|
| 15 |
+
- open3d
|
| 16 |
+
- point-cloud
|
| 17 |
+
- mesh
|
| 18 |
+
- gradio
|
| 19 |
+
- huggingface
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# 2D → 3D Reconstruction (GLPN + Open3D)
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
This Space estimates **monocular depth** from a single RGB image using **GLPN**, builds an **RGB-D point cloud**, and reconstructs a **3D mesh** with Poisson surface reconstruction via **Open3D**.
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## 🚀 How it works
|
| 29 |
+
1. Upload an image.
|
| 30 |
+
2. GLPN (NYU pretrained) → predict relative depth.
|
| 31 |
+
3. Open3D → convert RGB + depth → point cloud.
|
| 32 |
+
4. Poisson reconstruction → mesh (downloadable `.obj` and `.ply`).
|
| 33 |
+
5. Preview depth map, mesh snapshot, and explore the mesh interactively.
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
|
| 37 |
+
## 📦 Outputs
|
| 38 |
+
- **Depth map** (colorized preview)
|
| 39 |
+
- **Point cloud (.ply)**
|
| 40 |
+
- **Mesh (.obj)** (with Gradio 3D viewer)
|
| 41 |
+
- **Mesh preview PNG** (best-effort offscreen render, if available)
|
| 42 |
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## ⚠️ Notes
|
| 46 |
+
- Monocular depth has **no absolute scale** → geometry is up-to-scale only.
|
| 47 |
+
- For metric accuracy, swap in stereo, multi-view SfM, or metric depth models (ZoeDepth, Depth Anything v2).
|
| 48 |
+
- Works on **CPU or GPU** Spaces. GPU recommended for faster inference.
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
|
| 52 |
+
## 🛠️ Local Development
|
| 53 |
+
```bash
|
| 54 |
+
git clone <this-space>
|
| 55 |
+
cd <this-space>
|
| 56 |
+
pip install -r requirements.txt
|
| 57 |
+
python app.py
|