File size: 5,647 Bytes
596b739
 
463afdd
 
 
7360d11
 
596b739
463afdd
596b739
463afdd
 
 
 
 
 
596b739
 
463afdd
 
 
 
 
 
 
3e127b0
 
 
 
463afdd
2db5ce7
 
463afdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e127b0
 
 
463afdd
 
3e127b0
 
463afdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
---
title: DimensioDepth
emoji: 🎨
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.28.0
app_file: app.py
pinned: true
license: mit
tags:
  - depth-estimation
  - computer-vision
  - depth-anything-v2
  - 3d-visualization
  - image-processing
---

# 🎨 DimensioDepth - Add Dimension to Everything

Transform 2D images into stunning 3D depth visualizations with state-of-the-art AI depth estimation.

## ✨ Features

### 🎯 Advanced Depth Estimation
- **πŸš€ REAL AI Models** - Depth-Anything V2 BASE (372MB) from Hugging Face Transformers! πŸ”₯
- **SUPERB Quality** - Best available depth estimation quality, production-ready results
- **Auto-Download** - Models download automatically on first run (~60-90 seconds one-time)
- **Fast Inference** - Professional depth estimation (~800ms on CPU, <200ms on GPU)
- **Multiple Colormaps** - Inferno, Viridis, Plasma, Turbo, Magma, Hot, Ocean, Rainbow
- **Smart Fallback** - Gracefully falls back to Demo Mode if models fail to load
- **No Manual Setup** - Just clone and run, models auto-download from HuggingFace Hub!

### 🎬 Visualization Options
- **Colored Depth Maps** - Beautiful visualization with customizable color schemes
- **Grayscale Depth** - Classic depth representation
- **Side-by-Side Comparison** - Original vs. Depth view
- **3D Parallax Effect** - Create depth displacement visualizations

### πŸ“¦ Batch Processing
- Process multiple images at once
- Consistent depth estimation across your dataset
- Perfect for batch workflows

## πŸš€ How to Use

### Basic Usage
1. **Upload an Image** - Drag & drop or click to upload
2. **Choose Quality Mode** - Fast for preview, High Quality for final output
3. **Select Colormap** - Pick your favorite depth visualization style
4. **Generate** - Click the button and watch the magic happen! ✨

### Advanced Features
- **Side-by-Side**: Compare original and depth maps
- **3D Parallax**: Create depth displacement effects
- **Batch Processing**: Process multiple images efficiently

## πŸ› οΈ Technical Details

### Architecture
- **Model**: Depth-Anything V2 (ViT-S and ViT-L variants)
- **Inference**: ONNX Runtime with GPU acceleration
- **Backend**: FastAPI + Python
- **Frontend**: Gradio
- **3D Rendering**: Custom GLSL shaders (original web app)

### Performance
| Mode | Model | Speed (CPU) | Quality |
|------|-------|-------------|---------|
| Real AI | BASE (372MB) | ~800ms | SUPERB ⭐ |
| Demo Mode | Synthetic | <50ms | Decent |

**Note**: This Space uses the BASE model for best quality. GPU inference is ~200ms.

### Demo Mode
Don't have models downloaded? No problem! DimensioDepth includes a **Demo Mode** that uses:
- Edge detection
- Intensity analysis
- Gaussian smoothing
- Depth synthesis algorithms

This creates surprisingly good depth maps without any AI models!

## πŸ“Š Use Cases

### 🎨 Creative & Artistic
- Create depth-enhanced photos
- Generate 3D parallax effects
- Artistic depth visualization

### 🎬 VFX & Film Production
- Depth map generation for compositing
- 3D reconstruction preparation
- Scene depth analysis

### πŸ”¬ Research & Development
- Computer vision research
- Depth perception studies
- Dataset augmentation

### πŸ“± Social Media & Content Creation
- Create engaging 3D effects
- Enhance photos with depth
- Generate unique visual content

## πŸŽ“ About Depth-Anything V2

Depth-Anything V2 is a state-of-the-art monocular depth estimation model that:
- Works on any image (indoor/outdoor, any domain)
- Produces high-quality depth maps
- Runs efficiently on consumer hardware
- Supports both fast and accurate modes

[Read the Paper](https://arxiv.org/abs/2406.09414)

## 🌟 Examples

Try these types of images:
- **Portraits** - See facial depth structure
- **Landscapes** - Visualize scene depth layers
- **Architecture** - Analyze building geometry
- **Street Scenes** - Understand urban depth
- **Nature** - Explore organic depth patterns

## πŸ’‘ Tips for Best Results

1. **Image Quality**: Higher resolution = better depth detail
2. **Lighting**: Well-lit images produce clearer depth maps
3. **Contrast**: Images with good contrast show better depth separation
4. **Colormap**: Inferno is great for general use, Viridis for scientific visualization
5. **Mode Selection**: Use Fast for experimentation, High Quality for final output

## πŸ”§ Running Locally

Want to run DimensioDepth on your own machine?

```bash
# Clone the repository
git clone https://github.com/chromahubz/dimensiodepth.git
cd dimensiodepth

# Install dependencies
pip install -r requirements.txt

# Run the Gradio app
python app.py
```

For the full web experience with Three.js 3D viewer:
```bash
# Backend
cd backend
pip install -r requirements.txt
python -m uvicorn api.main:app --reload

# Frontend (separate terminal)
cd frontend
npm install
npm run dev
```

## 🎯 Roadmap

- [ ] Video depth estimation
- [ ] Point cloud export
- [ ] 3D mesh reconstruction
- [ ] Real-time webcam depth
- [ ] Depth-guided editing tools
- [ ] Multi-frame temporal consistency

## πŸ“„ License

MIT License - Feel free to use in your projects!

## πŸ™ Acknowledgments

- **Depth-Anything V2** - For the amazing depth estimation model
- **Hugging Face** - For the incredible Spaces platform
- **Gradio** - For making ML demos beautiful and easy

## πŸ“ž Contact & Links

- **GitHub**: [DimensioDepth Repository](https://github.com/chromahubz/dimensiodepth)
- **Original Web App**: Full-featured web application with 3D viewer and video export
- **Issues**: Report bugs on GitHub Issues

---

**Made with ❀️ for the AI community**

*Transform your 2D world into 3D magic! 🎨✨*