stevee00 commited on
Commit
34300ed
Β·
verified Β·
1 Parent(s): d78cc54

Upload docs/PRODUCT_ARCHITECTURE.md

Browse files
Files changed (1) hide show
  1. docs/PRODUCT_ARCHITECTURE.md +355 -0
docs/PRODUCT_ARCHITECTURE.md ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # InteriorFusion: AI Interior Designer β€” Product Architecture
2
+
3
+ ## Product Vision
4
+
5
+ **"Any room photo β†’ editable 3D design space in 30 seconds"**
6
+
7
+ Transform interior design from a manual, weeks-long process into an AI-assisted, real-time creative tool. Users upload a room photo, and InteriorFusion creates a complete 3D scene they can redesign, refurnish, and redecorate β€” all before their coffee gets cold.
8
+
9
+ ---
10
+
11
+ ## Feature Matrix
12
+
13
+ ### Core Features
14
+
15
+ | Feature | Description | Priority | Status |
16
+ |---------|-------------|----------|--------|
17
+ | **Photo Upload** | Upload any room photo | P0 | βœ… Prototype |
18
+ | **3D Room Generation** | Generate complete 3D scene | P0 | βœ… Prototype |
19
+ | **Furniture Editing** | Move/remove/scale objects | P0 | βœ… Design |
20
+ | **Material Swap** | Change wall/floor/furniture materials | P0 | βœ… Design |
21
+ | **Relight Room** | Adjust lighting, add light sources | P1 | πŸ“ Planned |
22
+ | **Style Transfer** | Transform to different interior styles | P1 | πŸ“ Planned |
23
+ | **Export to Blender** | One-click Blender import | P0 | βœ… Prototype |
24
+ | **Export to UE5** | Direct Unreal Engine asset export | P1 | πŸ“ Planned |
25
+ | **Export to Unity** | Unity package export | P1 | πŸ“ Planned |
26
+ | **AR Preview** | View in real room via phone AR | P1 | πŸ“ Planned |
27
+ | **Furniture Recommendations** | AI-suggested furniture from catalog | P2 | πŸ“ Planned |
28
+ | **Room Style Quiz** | "What style is this room?" | P2 | πŸ“ Planned |
29
+ | **Before/After Comparison** | Side-by-side design iterations | P1 | πŸ“ Planned |
30
+ | **Design Share** | Share interactive 3D scenes via URL | P1 | πŸ“ Planned |
31
+ | **Professional Report** | Generate PDF design proposal | P2 | πŸ“ Planned |
32
+
33
+ ### Interior Style Support
34
+
35
+ | Style | Training Data | Quality Target |
36
+ |-------|--------------|---------------|
37
+ | **Modern** | 3D-FRONT + Pinterest | ⭐⭐⭐⭐⭐ |
38
+ | **Scandinavian** | 3D-FRONT + InteriorNet | ⭐⭐⭐⭐⭐ |
39
+ | **Luxury / High-end** | 3D-FRONT luxury subset | ⭐⭐⭐⭐ |
40
+ | **Indian / Traditional** | Custom dataset + Pinterest | ⭐⭐⭐⭐ |
41
+ | **Commercial / Office** | HM3D office scenes | ⭐⭐⭐⭐ |
42
+ | **Industrial** | 3D-FRIND + InteriorNet | ⭐⭐⭐⭐ |
43
+ | **Minimalist** | 3D-FRONT + curated | ⭐⭐⭐⭐ |
44
+ | **Bohemian** | Pinterest + custom | ⭐⭐⭐ |
45
+ | **Japanese** | Custom dataset | ⭐⭐⭐ |
46
+ | **Art Deco** | Curated subset | ⭐⭐⭐ |
47
+
48
+ ### Room Type Support
49
+
50
+ | Room Type | Supported | Notes |
51
+ |-----------|-----------|-------|
52
+ | **Living Room** | βœ… Full | Best supported |
53
+ | **Bedroom** | βœ… Full | Full support |
54
+ | **Kitchen** | βœ… Full | Appliances as objects |
55
+ | **Dining Room** | βœ… Full | Table + chairs pattern |
56
+ | **Home Office** | βœ… Full | Desk + chair + shelf |
57
+ | **Bathroom** | ⚠️ Partial | Mirrors, fixtures simplified |
58
+ | **Hallway** | ⚠️ Partial | Limited furniture |
59
+ | **Outdoor Patio** | ❌ Not supported | Future scope |
60
+ | **Commercial Retail** | πŸ“ Planned | v2.0 |
61
+ | **Restaurant / Cafe** | πŸ“ Planned | v2.0 |
62
+
63
+ ---
64
+
65
+ ## Backend Architecture
66
+
67
+ ### Service Topology
68
+
69
+ ```
70
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
71
+ β”‚ API Gateway β”‚
72
+ β”‚ (Rate limiting, Auth, SSL, CDN) β”‚
73
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
74
+ β”‚
75
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
76
+ β”‚ β”‚ β”‚
77
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
78
+ β”‚ REST API β”‚ β”‚ WebSocket API β”‚ β”‚ Webhook β”‚
79
+ β”‚ (FastAPI) β”‚ β”‚ (Real-time β”‚ β”‚ (Export β”‚
80
+ β”‚ β”‚ β”‚ progress) β”‚ β”‚ notify) β”‚
81
+ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
82
+ β”‚ β”‚ β”‚
83
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
84
+ β”‚ Task Queue (Redis/RabbitMQ) β”‚
85
+ β”‚ Priority: free < premium < enterprise β”‚
86
+ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
87
+ β”‚ β”‚
88
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
89
+ β”‚ GPU Workers β”‚ β”‚ CPU Workers β”‚
90
+ β”‚ (Ray/K8s) β”‚ β”‚ (Pre/Post proc) β”‚
91
+ β”‚ β”‚ β”‚ β”‚
92
+ β”‚ - Generation β”‚ β”‚ - Segmentation β”‚
93
+ β”‚ - Rendering β”‚ β”‚ - Mesh cleanup β”‚
94
+ β”‚ - Export β”‚ β”‚ - Format conv β”‚
95
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
96
+ ```
97
+
98
+ ### GPU Orchestration (Ray + Kubernetes)
99
+
100
+ ```yaml
101
+ # k8s/interiorfusion-gpu-worker.yaml
102
+ apiVersion: apps/v1
103
+ kind: Deployment
104
+ metadata:
105
+ name: interiorfusion-gpu-worker
106
+ spec:
107
+ replicas: 5
108
+ selector:
109
+ matchLabels:
110
+ app: interiorfusion-gpu
111
+ template:
112
+ spec:
113
+ containers:
114
+ - name: worker
115
+ image: stevee00/interiorfusion:latest
116
+ resources:
117
+ limits:
118
+ nvidia.com/gpu: 1
119
+ memory: "32Gi"
120
+ cpu: "8"
121
+ env:
122
+ - name: MODEL_SIZE
123
+ value: "L"
124
+ - name: BATCH_SIZE
125
+ value: "1"
126
+ ```
127
+
128
+ ### Queueing Strategy
129
+
130
+ | Tier | Max Queue Time | Priority | GPU Allocation |
131
+ |------|---------------|----------|---------------|
132
+ | **Free** | 5 minutes | Low | Shared A10G |
133
+ | **Pro** ($20/mo) | 30 seconds | Medium | Dedicated A10G |
134
+ | **Enterprise** | 5 seconds | High | Dedicated A100 |
135
+ | **Batch API** | 1 hour | Lowest | Spot instances |
136
+
137
+ ### Caching Strategy
138
+
139
+ | Cache Layer | TTL | Size | Purpose |
140
+ |-------------|-----|------|---------|
141
+ | **CDN Edge** | 24h | Infinite | Generated GLB/PLY files |
142
+ | **Redis Hot** | 1h | 10GB | Depth maps, segmentation |
143
+ | **Redis Warm** | 24h | 50GB | Scene graphs, metadata |
144
+ | **GPU VRAM** | 5m | Per-GPU | Model weights, active scenes |
145
+ | **Disk Cache** | 7d | 1TB | Model checkpoints, datasets |
146
+
147
+ ### Vector Database (ChromaDB / Pinecone)
148
+
149
+ Store:
150
+ - Furniture embeddings for similarity search
151
+ - Room style embeddings for style matching
152
+ - User preference history for personalization
153
+
154
+ Schema:
155
+ ```python
156
+ {
157
+ "id": "furniture_12345",
158
+ "embedding": [768-dim vector],
159
+ "metadata": {
160
+ "type": "sofa",
161
+ "style": "scandinavian",
162
+ "dimensions": [2.0, 0.9, 0.8],
163
+ "material": "fabric",
164
+ "color": "gray",
165
+ "source": "ikea_catalog",
166
+ }
167
+ }
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Inference Service Architecture
173
+
174
+ ### Model Registry (HF Hub)
175
+
176
+ ```python
177
+ # Model versions managed via HF Hub
178
+ MODEL_REGISTRY = {
179
+ "InteriorFusion-S": {
180
+ "repo": "stevee00/InteriorFusion-S",
181
+ "size": "1.5B",
182
+ "speed": "5s",
183
+ "quality": "preview",
184
+ },
185
+ "InteriorFusion-L": {
186
+ "repo": "stevee00/InteriorFusion-L",
187
+ "size": "4B",
188
+ "speed": "15s",
189
+ "quality": "production",
190
+ },
191
+ "InteriorFusion-XL": {
192
+ "repo": "stevee00/InteriorFusion-XL",
193
+ "size": "10B",
194
+ "speed": "30s",
195
+ "quality": "research",
196
+ },
197
+ }
198
+ ```
199
+
200
+ ### Auto-scaling Rules
201
+
202
+ | Metric | Threshold | Action |
203
+ |--------|-----------|--------|
204
+ | Queue depth | > 10 tasks | Scale up GPU workers +2 |
205
+ | Queue depth | < 2 tasks | Scale down GPU workers -1 |
206
+ | Avg inference time | > 20s (L model) | Switch to S model for free tier |
207
+ | GPU memory | > 90% | Clear LRU cache |
208
+ | Error rate | > 5% | Alert + fallback to S model |
209
+ | Cost/hour | > $100 | Enable spot instance preference |
210
+
211
+ ---
212
+
213
+ ## Rendering Pipeline
214
+
215
+ ### Real-time Preview (Gaussian Splatting)
216
+
217
+ For the interactive 3D viewer:
218
+ - Scene loaded as Gaussian splatting PLY
219
+ - Web-based viewer using Three.js + GaussianSplatting
220
+ - FPS target: 60fps on RTX 3060, 30fps on integrated GPU
221
+ - Level-of-Detail: Reduce Gaussian count for distant objects
222
+
223
+ ### Production Quality (Path Tracing)
224
+
225
+ For final export / marketing renders:
226
+ - Export to Blender / UE5 / Unity
227
+ - Use native path tracing (Cycles, Lumen, HDRP)
228
+ - Bake lighting into lightmaps for static scenes
229
+ - Real-time GI for dynamic objects
230
+
231
+ ### Web Viewer Architecture
232
+
233
+ ```html
234
+ <!-- Simplified web viewer -->
235
+ <interiorfusion-viewer
236
+ scene-url="https://cdn.interiorfusion.ai/scenes/abc123/scene.ply"
237
+ editable="true"
238
+ ar-support="true"
239
+ vr-support="false"
240
+ >
241
+ </interiorfusion-viewer>
242
+ ```
243
+
244
+ Features:
245
+ - Orbit controls (rotate, zoom, pan)
246
+ - Object selection (click to select furniture)
247
+ - Property panel (position, rotation, scale, material)
248
+ - Material picker (swatches from PBR library)
249
+ - Lighting control (time of day, intensity)
250
+ - AR mode (place in real room via WebXR)
251
+
252
+ ---
253
+
254
+ ## Asset Management
255
+
256
+ ### Furniture Catalog
257
+
258
+ | Source | Items | License | Integration |
259
+ |--------|-------|---------|------------|
260
+ | **IKEA API** | ~10,000 | Commercial | Direct purchase links |
261
+ | **Wayfair API** | ~100,000 | Commercial | Affiliate links |
262
+ | **3D-FUTURE** | ~10,000 | Research | Training + reference |
263
+ | **Objaverse** | ~10M | Mixed | Generic placeholders |
264
+ | **Custom Models** | User uploads | User-owned | Premium feature |
265
+
266
+ ### Material Library
267
+
268
+ | Category | Count | Source |
269
+ |----------|-------|--------|
270
+ | **Wood** | 500 | CC0 Textures, Poliigon |
271
+ | **Fabric / Upholstery** | 300 | Custom scans |
272
+ | **Tile / Stone** | 200 | CC0 Textures |
273
+ | **Paint** | 1000 | Sherwin-Williams, Benjamin Moore |
274
+ | **Wallpaper** | 500 | Spoonflower, Wallcoverings |
275
+ | **Metal** | 150 | CC0 Textures |
276
+ | **Glass** | 50 | Custom |
277
+
278
+ ---
279
+
280
+ ## Business Model
281
+
282
+ ### Pricing Tiers
283
+
284
+ | Tier | Price | Generations/mo | Quality | Export | API | Support |
285
+ |------|-------|---------------|---------|--------|-----|---------|
286
+ | **Free** | $0 | 5 | S model | GLB only | ❌ | Community |
287
+ | **Pro** | $20/mo | 100 | L model | All formats | βœ… 100/day | Email |
288
+ | **Studio** | $99/mo | 500 | XL model | All + batch | βœ… 1000/day | Priority |
289
+ | **Enterprise** | Custom | Unlimited | XL + custom | All + white-label | βœ… Unlimited | Dedicated |
290
+
291
+ ### Revenue Streams
292
+
293
+ 1. **Subscription**: Monthly plans (primary revenue)
294
+ 2. **API Usage**: Per-generation pricing for integrations
295
+ 3. **Furniture Affiliates**: Commission on furniture purchases
296
+ 4. **Professional Services**: Custom training, fine-tuning
297
+ 5. **White-label**: Licensed SDK for furniture retailers
298
+ 6. **Data**: Anonymized trend reports (industry insights)
299
+
300
+ ---
301
+
302
+ ## Moat & Competitive Advantage
303
+
304
+ ### Technical Moat
305
+
306
+ 1. **Interior-specific architecture**: No competitor has scene-aware 3D generation
307
+ 2. **Proprietary dataset**: Curated 85K interior rooms, multi-modal
308
+ 3. **Training cost barrier**: $65K to replicate, 4 weeks on 32Γ—A100
309
+ 4. **Integration depth**: Blender/UE/Unity/ComfyUI plugins (network effects)
310
+
311
+ ### Data Moat
312
+
313
+ 1. **User-generated scenes**: Every generation improves dataset
314
+ 2. **Feedback loop**: User edits provide preference signals
315
+ 3. **Style trends**: Real-time interior design trend detection
316
+ 4. **Furniture catalog**: Deep embedding of commercial products
317
+
318
+ ### Network Effects
319
+
320
+ 1. **Community models**: Users fine-tune and share LoRAs
321
+ 2. **Template library**: Popular room designs become templates
322
+ 3. **Plugin ecosystem**: Third-party tools extend capabilities
323
+
324
+ ---
325
+
326
+ ## Roadmap
327
+
328
+ ### Q3 2026 (Launch)
329
+ - βœ… Single photo β†’ 3D scene
330
+ - βœ… GLB/PLY export
331
+ - βœ… Gradio web app
332
+ - βœ… Blender plugin
333
+ - βœ… Basic editing (move, remove, replace)
334
+
335
+ ### Q4 2026 (Growth)
336
+ - πŸ“ FastAPI backend + API
337
+ - πŸ“ Mobile app (iOS/Android)
338
+ - πŸ“ AR preview (ARKit / ARCore)
339
+ - πŸ“ Furniture recommendations
340
+ - πŸ“ Style transfer
341
+ - πŸ“ Material swap UI
342
+
343
+ ### Q1 2027 (Scale)
344
+ - πŸ“ ComfyUI nodes
345
+ - πŸ“ Unreal Engine / Unity plugins
346
+ - πŸ“ Batch generation API
347
+ - πŸ“ Enterprise white-label
348
+ - πŸ“ Video-to-3D extension
349
+
350
+ ### Q2 2027 (Maturity)
351
+ - πŸ“ Multi-room generation
352
+ - πŸ“ Floor plan import
353
+ - πŸ“ Lighting design
354
+ - πŸ“ HVAC/ electrical visualization
355
+ - πŸ“ Construction document generation