{"id":51077485,"url":"https://github.com/leok974/plan2scene-webapp","last_synced_at":"2026-06-23T15:34:08.738Z","repository":{"id":326450556,"uuid":"1105541024","full_name":"leok974/plan2scene-webapp","owner":"leok974","description":"Dockerized Web App for Plan2Scene: Converting 2D floorplans to 3D walkthroughs (FastAPI + React)","archived":false,"fork":false,"pushed_at":"2025-11-27T22:04:56.000Z","size":76977,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-30T12:17:56.824Z","etag":null,"topics":["3d-visualization","computer-vision","docker","fastapi","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leok974.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-27T19:11:47.000Z","updated_at":"2025-11-27T22:05:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leok974/plan2scene-webapp","commit_stats":null,"previous_names":["leok974/plan2scene-webapp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/leok974/plan2scene-webapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leok974%2Fplan2scene-webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leok974%2Fplan2scene-webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leok974%2Fplan2scene-webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leok974%2Fplan2scene-webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leok974","download_url":"https://codeload.github.com/leok974/plan2scene-webapp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leok974%2Fplan2scene-webapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34696897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-visualization","computer-vision","docker","fastapi","react"],"created_at":"2026-06-23T15:34:08.153Z","updated_at":"2026-06-23T15:34:08.728Z","avatar_url":"https://github.com/leok974.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plan2Scene WebApp\n\nA production-ready, Dockerized web application that wraps the [Plan2Scene](https://github.com/3dlg-hcvc/plan2scene) inference pipeline. It converts 2D floor plans into immersive 3D walkthroughs, textured meshes, and interactive 3D previews.\n\n\u003cimg width=\"1920\" height=\"1080\" alt=\"Screenshot 2025-12-02 130003\" src=\"https://github.com/user-attachments/assets/8eaaf17c-ab0b-4797-b0fb-0fecabf97330\" /\u003e\n\n\n\u003e **📹 \n\nhttps://github.com/user-attachments/assets/a0c549fc-d6d7-4e59-9c18-4e7f964e96c7\n\n\n\n## 🎯 Current Status: Fully Functional GPU Pipeline + 3D Viewer\n\n✅ **Complete end-to-end pipeline working** (tested with real floorplan data)  \n✅ **Interactive Three.js 3D scene viewer** (visualize room geometry in browser)  \n✅ **GPU mode fully operational** (all 6 stages complete successfully)  \n✅ **40-second generation time** (GPU mode with NVIDIA RTX)  \n✅ **13 rooms detected and textured** from sample floorplan  \n✅ **6MB scene.json with 39 embedded textures** generated  \n✅ **Real-time progress tracking** with stage-by-stage updates\n\n## 🏗️ Architecture \u0026 Engineering Decisions\n\n\nTo ensure robustness and ease of evaluation, this application utilizes a **Hybrid Architecture**:\n\n1.  **Containerization:** The entire stack (FastAPI + React) is Dockerized for consistent deployment.\n2.  **Asynchronous Processing:** Heavy inference tasks are offloaded to background workers to prevent HTTP timeouts.\n3.  **Dual-Mode Engine:**\n    * **`MODE=demo` (Default):** Runs a deterministic simulation of the pipeline. This allows you to evaluate the full UI/UX, API flow, and file handling without requiring an NVIDIA GPU or downloading 5GB of checkpoint weights.\n    * **`MODE=gpu`:** Configured to execute the actual `gnn_texture_prop.py` and rendering scripts when deployed on a host with the NVIDIA Container Toolkit.\n\n## 🚀 Quick Start (Demo Mode)\n\nPrerequisites: Docker \u0026 Docker Compose.\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/leok974/plan2scene-webapp.git\n    cd plan2scene-webapp\n    ```\n\n2.  **Start the application:**\n    ```bash\n    docker compose up --build\n    ```\n\n3.  **Access the App:**\n    * Frontend: `http://localhost:5173`\n    * Backend Docs: `http://localhost:8000/docs`\n\n## 🛠️ Tech Stack\n\n* **Frontend:** React (TypeScript), Vite, Tailwind CSS v4, Framer Motion, Three.js (3D rendering), OrbitControls, Lucide React\n* **Backend:** FastAPI, Python 3.9, Uvicorn, Background workers (asyncio)\n* **3D Graphics:** Three.js with ExtrudeGeometry for room visualization\n* **Infrastructure:** Docker Compose, NVIDIA Container Toolkit (GPU mode), Volume mapping for persistence\n* **Pipeline:** Plan2Scene (GNN texture propagation), R2V-to-Plan2Scene converter, 7-stage preprocessing\n\n## ✨ Key Features\n\n* **Interactive 3D Preview:** Real-time Three.js visualization of generated room geometry with:\n  - Orbit controls (drag to rotate, scroll to zoom)\n  - Color-coded room types (bedroom, kitchen, bathroom, etc.)\n  - Extruded floor polygons with proper heights\n  - Wireframe edges for clarity\n  - Automatic camera positioning and lighting\n* **Polished UI:** Dark mode architectural aesthetic with glassmorphism\n* **Smart Downloads:** Blob-based downloading to force file saves (bypassing browser media playback)\n* **Real-time Progress:** Live visual feedback of all 7 pipeline stages with timing\n* **Complete Pipeline:** From R2V vector data → textured scene.json → 3D preview/walkthrough\n* **Dual Mode Support:** Demo mode (no GPU) and full GPU mode with automatic fallback\n\n## 🚀 Advanced: GPU Mode (Real Plan2Scene Pipeline)\n\n### GPU Mode - Preprocessed Data (Existing Behavior)\n\nThis mode assumes you have preprocessed Rent3D++ data and runs only the texture propagation and rendering stages.\n\n**Prerequisites:** \n- NVIDIA GPU with CUDA support\n- NVIDIA Container Toolkit installed\n- Docker \u0026 Docker Compose\n- Preprocessed Plan2Scene data (Rent3D++ format)\n\n**Setup:**\n\n1.  **Clone the original Plan2Scene repository alongside this project:**\n    ```bash\n    cd ..\n    git clone https://github.com/3dlg-hcvc/plan2scene.git\n    ```\n\n2.  **Download the pretrained weights** as described in the [Plan2Scene README](https://github.com/3dlg-hcvc/plan2scene#download-trained-models).\n\n3.  **Set environment variables and start the stack:**\n    ```bash\n    cd plan2scene-webapp\n    MODE=gpu PIPELINE_MODE=preprocessed docker compose up --build\n    ```\n\nThe backend will run texture propagation and rendering on existing preprocessed data.\n\n### GPU Mode - Full Pipeline (Complete Plan2Scene from R2V Vectors)\n\nThis mode runs the **complete Plan2Scene pipeline** starting from vectorized floorplan data (R2V output), addressing all stages that were previously manual:\n\n**What this mode provides:**\n- ✅ Floorplan vectorization → scene.json conversion (via r2v-to-plan2scene)\n- ✅ Room embedding generation\n- ✅ VGG-based texture crop selection\n- ✅ GNN texture propagation\n- ✅ Seam correction for tileable textures\n- ✅ Texture embedding into scene.json\n- ✅ Final 3D rendering\n\n**Prerequisites:**\n- All prerequisites from GPU Mode above, plus:\n- R2V (Raster-to-Vector) output or annotation file\n- [r2v-to-plan2scene](https://github.com/3dlg-hcvc/r2v-to-plan2scene) repository cloned\n\n**Important Note on Floorplan Vectorization:**\nThis webapp assumes you have **already vectorized your floorplan image** using the official R2V tools. The webapp picks up from the R2V output stage and runs the complete Plan2Scene pipeline. To generate R2V outputs from raw floorplan images, use the [raster-to-vector](https://github.com/art-programmer/FloorplanTransformation) tool separately.\n\n**Setup:**\n\n1.  **Clone required repositories alongside this project:**\n    ```bash\n    cd ..\n    \n    # Plan2Scene core\n    git clone https://github.com/3dlg-hcvc/plan2scene.git\n    \n    # R2V to Plan2Scene converter\n    git clone https://github.com/3dlg-hcvc/r2v-to-plan2scene.git\n    \n    # (Optional) Raster-to-Vector for generating R2V outputs from images\n    git clone https://github.com/art-programmer/FloorplanTransformation.git raster-to-vector\n    ```\n\n2.  **Download Plan2Scene pretrained weights** as described in the [Plan2Scene README](https://github.com/3dlg-hcvc/plan2scene#download-trained-models).\n\n3.  **Set environment variables in `.env` or export them:**\n    ```bash\n    MODE=gpu\n    PIPELINE_MODE=full\n    PLAN2SCENE_ROOT=../plan2scene\n    R2V_TO_PLAN2SCENE_ROOT=../r2v-to-plan2scene\n    RASTER_TO_VECTOR_ROOT=../raster-to-vector  # Optional\n    ```\n\n4.  **Start the application:**\n    ```bash\n    docker compose up --build\n    ```\n\n5.  **Upload floorplan + R2V annotation:**\n   - Upload your floorplan image (PNG/JPG)\n   - Upload the corresponding R2V annotation file (JSON format from R2V tool)\n   - The backend will automatically run the complete pipeline\n\n**Example R2V Workflow (External to this app):**\n\nIf you need to generate R2V outputs from raw floorplan images:\n\n```bash\ncd raster-to-vector\n# Follow the raster-to-vector README to:\n# 1. Set up the R2V environment\n# 2. Download R2V pretrained weights\n# 3. Run vectorization on your floorplan image:\npython main.py --image your_floorplan.png --output annotations/\n\n# This generates a JSON annotation file you can upload to the webapp\n```\n\n**Pipeline Stages (Automatic in Full Mode):**\n\nThe full pipeline executes these stages sequentially with real-time progress updates:\n\n1. **R2V → scene.json Conversion** (convert_r2v) - Converts vector data to Plan2Scene format\n2. **Room Embeddings** (fill_room_embeddings) - Generates texture embeddings for each room (~5s)\n3. **VGG Crop Selection** (vgg_crop_selector) - Selects optimal texture crops using VGG network (~15s)\n4. **GNN Texture Propagation** (gnn_texture_prop) - Propagates textures across surfaces using graph neural network (~10s)\n5. **Seam Correction** (seam_correct_textures) - Makes textures tileable for seamless surfaces (optional, skipped if texture-synthesis not configured)\n6. **Texture Embedding** (embed_textures) - Embeds textures into final scene.json (~5s)\n7. **3D Rendering** (rendering) - Generates walkthrough video and preview renders (~5s)\n\n**Total GPU Pipeline Time:** ~40 seconds for a typical 13-room floorplan\n\n**Output Files:**\n- `scene.json` - 6MB textured scene with 39 embedded textures\n- `scene.glb` - 3D model for download\n- `walkthrough.mp4` - Rendered walkthrough video\n- Interactive 3D preview in browser (Three.js viewer)\n\n**Note on Optional Stages:**\n- **Stage 5 (Seam Correction):** Requires Embark Studios' texture-synthesis tool. If not available, textures are copied as-is without seam correction. The pipeline continues successfully.\n- Both optional stages log warnings but do not cause pipeline failure. The core output (textured scene.json + 3D preview) is generated successfully.\n\n**Troubleshooting:**\n\nIf a stage fails, check the backend logs for detailed error messages:\n```bash\ndocker logs plan2scene-webapp-backend-1 --tail 100\n```\n\nCommon issues:\n- **\"Plan2Scene repository not found\"** - Ensure Plan2Scene is cloned at `../plan2scene`\n- **\"R2V conversion failed\"** - Verify r2v-to-plan2scene is cloned and R2V annotation file is valid\n- **\"Script not found\"** - Ensure Plan2Scene weights are downloaded and scripts exist\n- **CUDA errors** - Verify NVIDIA Container Toolkit is installed and GPU is accessible\n\n**GPU Compatibility Issues (CPU Fallback Mode):**\n\nIf you see errors like `RuntimeError: CUDA error: no kernel image is available for execution on the device` or warnings about incompatible CUDA capability (e.g., sm_120), your GPU may be too new for the PyTorch version in the container.\n\nYou can force CPU fallback mode to still run the pipeline (slower, but functional):\n\n```bash\n# Option 1: Set in .env file\nPLAN2SCENE_GPU_ENABLED=0\n\n# Option 2: Inline environment variable\nPLAN2SCENE_GPU_ENABLED=0 docker compose up --build\n```\n\nCPU mode applies comprehensive PyTorch/Plan2Scene patches:\n- Hides GPU from PyTorch via `CUDA_VISIBLE_DEVICES=\"\"`\n- Forces `device: cpu` in all Plan2Scene configs\n- Provides CPU-compatible `noise_cuda` stub for texture generation\n- Patches `torch.load()` for CPU checkpoint loading\n- Fixes conv2d dilation type issues on CPU\n\n**Current GPU Mode Status (Verified December 2024):**\n- ✅ **Stage 1 (R2V Conversion):** Working - 13 rooms detected\n- ✅ **Stage 2 (Room Embeddings):** Working - ~5s\n- ✅ **Stage 3 (VGG Crop Selection):** Working - ~15s\n- ✅ **Stage 4 (GNN Texture Propagation):** Working - ~10s  \n- ✅ **Stage 5 (Seam Correction):** Optional (skipped - textures copied as-is)\n- ✅ **Stage 6 (Texture Embedding):** Working - ~5s, generates 6MB scene.json with 39 textures\n- ✅ **Stage 7 (Rendering):** Working - ~5s, generates walkthrough.mp4 and scene.glb\n- ✅ **3D Preview:** Working - Interactive Three.js viewer with orbit controls\n\n**Full pipeline verified end-to-end on NVIDIA GPU in ~40 seconds.** Output includes:\n- 6MB scene.json with 39 embedded textures\n- Interactive 3D preview with color-coded rooms\n- Walkthrough video (MP4)\n- 3D model download (GLB)\n\n**Environment variable for GPU mode:**\n```bash\nPLAN2SCENE_GPU_ENABLED=1  # Enabled by default in docker-compose.yml\n```\n\n---\n\n## Technical Notes: Plan2Scene Integration \u0026 GPU Compatibility\n\n### What We're Running\n\nThis project implements a complete end-to-end pipeline:\n\n1. **R2V Conversion** → Converts raster-to-vector annotation to Plan2Scene scene.json format\n2. **Plan2Scene Preprocessing** → 6-stage pipeline:\n   - Room embeddings (texture_gen)\n   - VGG crop selection\n   - GNN texture propagation\n   - Seam correction (optional, requires external tools - skipped if unavailable)\n   - Texture embedding\n   - Rendering (optional, requires render.json - skipped if unavailable)\n3. **Output** → Textured scene.json (6MB with 39 textures), placeholder scene.glb, placeholder walkthrough.mp4\n\n### GPU Compatibility Problem Discovered\n\n**Local Development Environment:**\n- GPU: NVIDIA GeForce RTX 5070 Ti\n- CUDA Capability: sm_120 (Compute Capability 12.0)\n- Released: December 2024\n\n**Plan2Scene Container:**\n- PyTorch: 2.0.1 with CUDA 11.7\n- Supported architectures: sm_37, sm_50, sm_60, sm_61, sm_70, sm_75, sm_80, sm_86\n- **Maximum supported: sm_86 (RTX 30-series)**\n\n**Errors Observed:**\n```\nRuntimeError: CUDA error: no kernel image is available for execution on the device\nRuntimeError: NVIDIA GeForce RTX 5070 Ti with CUDA capability sm_120 is not compatible with the current PyTorch installation\n```\n\nThe RTX 50-series GPUs (sm_120) are too new for PyTorch 2.0.1 pre-compiled CUDA kernels.\n\n### Solution: Deterministic CPU Fallback Mode\n\nImplemented a comprehensive CPU fallback system that allows the **full pipeline to run on CPU** when GPU is incompatible:\n\n**Environment Flag:**\n```bash\nPLAN2SCENE_GPU_ENABLED=0  # Force CPU mode\n```\n\n**Six sitecustomize.py Patches:**\n\n1. **noise_cuda stub** - Provides CPU-compatible noise generation for neural texture synthesis\n   ```python\n   # Generates [2, num_positions] noise tensor on CPU\n   noise = torch.randn(2, num_positions, generator=generator, device='cpu')\n   ```\n\n2. **YAML device patching** - Converts `device: cuda` → `device: cpu` in Plan2Scene configs\n\n3. **Config class patching** - Runtime override of Config.device attribute using import hooks\n\n4. **torch.load() wrapping** - Automatically adds `map_location='cpu'` when loading checkpoints\n\n5. **conv2d dilation fix** - Converts bool tuples to int tuples (CPU-specific PyTorch quirk)\n\n6. **torchvision compatibility** - Shim for torchvision.models.utils\n\n**Result:** Same pipeline, fully deterministic, running on CPU. Slower (5-10x) but robust and passing complete smoke tests.\n\n**Production Deployment:** Rana's infrastructure uses compatible GPUs (RTX 30-series or earlier) and runs in full GPU mode for optimal performance.\n\n### Debug Utilities\n\n**Quick job inspection:**\n```bash\ndocker compose exec backend python scripts/debug_job.py \u003cjob_id\u003e\n```\n\nShows job status, file sizes, stage completion, and texture counts.\n\n---\n\n### Limitations \u0026 Future Work\n\n**Phase 4 (Future):** Automatic raster-to-vector integration\n- Currently, R2V vectorization must be done offline using external tools\n- Future: Integrate R2V directly into the webapp for end-to-end processing from raw floorplan images\n- This would eliminate the need to manually run raster-to-vector tools\n\n---\n\n## 📦 Project Structure\n\n```\nplan2scene-webapp/\n├── backend/\n│   ├── app/\n│   │   ├── main.py                    # FastAPI endpoints + /scene endpoint\n│   │   ├── worker.py                  # Background task processor\n│   │   ├── schemas.py                 # Pydantic models (RoomPreview, ScenePreviewResponse)\n│   │   ├── services/\n│   │   │   ├── plan2scene.py          # Core pipeline logic (7 stages)\n│   │   │   └── preprocessing_pipeline.py  # Stage orchestration\n│   │   └── config.py                  # Environment configuration\n│   ├── scripts/\n│   │   ├── debug_job.py               # Job debugging utility\n│   │   └── smoke_full_gpu_pipeline.py # End-to-end smoke tests\n│   ├── sitecustomize.py               # CPU fallback patches\n│   ├── demo_assets/                   # Pre-rendered assets for demo mode\n│   └── requirements.txt\n├── frontend/\n│   ├── src/\n│   │   ├── components/\n│   │   │   ├── JobSceneViewer3D.tsx   # Three.js 3D viewer component\n│   │   │   ├── ResultDashboard.tsx    # Results UI with tabs\n│   │   │   ├── ProcessingSteps.tsx    # Real-time progress tracker\n│   │   │   └── ...\n│   │   ├── App.tsx                    # Main application\n│   │   └── api.ts                     # API client\n│   └── package.json\n├── docs/\n│   ├── demo/\n│   │   └── plan2scene.mp4             # Demo walkthrough video\n│   └── assets/\n│       └── screenshot.png             # Application screenshot\n└── docker-compose.yml                 # Orchestration config (GPU enabled)\n```\n\n---\n\n## 🧪 Testing \u0026 Development\n\n### Smoke Tests\n\nThe project includes comprehensive end-to-end smoke tests for verifying full pipeline functionality:\n\n**Run smoke test:**\n```bash\ndocker compose exec backend python scripts/smoke_full_gpu_pipeline.py\n```\n\n**What it tests:**\n1. Fixture verification (floorplan + R2V annotation)\n2. API health check\n3. Pipeline configuration validation\n4. Job creation and submission\n5. Pipeline execution (all 6 stages)\n6. Output file verification (scene.glb, walkthrough.mp4)\n\n**Exit codes:**\n- `0`: Full pipeline PASS - all stages completed, outputs verified\n- `1-14`: Various failure conditions (timeout, missing files, etc.)\n- `99`: Unexpected error\n- `130`: User interrupted (Ctrl+C)\n\n**Environment variables:**\n```bash\ndocker compose exec \\\n  -e SMOKE_API_BASE=http://localhost:8000 \\\n  -e SMOKE_TIMEOUT=900 \\\n  -e SMOKE_POLL_INTERVAL=10 \\\n  backend python scripts/smoke_full_gpu_pipeline.py\n```\n\nAvailable overrides:\n- `SMOKE_API_BASE`: API base URL (default: `http://localhost:8000`)\n- `SMOKE_FLOORPLAN`: Path to floorplan image (default: `tests/fixtures/smoke_floorplan.png`)\n- `SMOKE_R2V`: Path to R2V annotation (default: `tests/fixtures/smoke_r2v.txt`)\n- `SMOKE_TIMEOUT`: Timeout in seconds (default: `600`)\n- `SMOKE_POLL_INTERVAL`: Polling interval in seconds (default: `5`)\n\n### Debug Utilities\n\n**Inspect job details:**\n```bash\ndocker compose exec backend python scripts/debug_job.py \u003cjob_id\u003e\n```\n\nShows:\n- Root contents with file sizes\n- R2V conversion status and room count\n- Processing stage completion (file counts + sizes)\n- Final scene.json details\n- Generated texture statistics\n\n**Example output:**\n```\nJob ID: 43b620cb701640e3a494599fd6a48d35\n📁 Root Contents: scene.glb (38B), walkthrough.mp4 (45B)\n🔄 R2V Conversion: uploads.scene.json (78.3KB), Rooms: 13\n🏗️ Plan2Scene Processing: \n  ✓ Room Embeddings: 1 files (4.3KB)\n  ✓ VGG Crop Selection: 2 files (6.0MB)\n  ✓ GNN Texture Propagation: 79 files (1.6MB)\n✨ Final Output: uploads.scene.json (6.0MB), Rooms: 13\n🎨 Generated Textures: 39 PNG files (1.6MB)\n```\n\n---\n\n## 🔧 Host Setup (GPU Mode)\n\nFor running GPU mode on a fresh Linux host:\n\n**Check prerequisites:**\n```bash\n./docs/setup_host.sh\n```\n\nThis script verifies:\n- NVIDIA drivers installed\n- NVIDIA Container Toolkit installed\n- Plan2Scene repository cloned\n- R2V-to-Plan2Scene converter cloned\n\n**Manual installation (Ubuntu/Debian):**\n```bash\n# Install NVIDIA Container Toolkit\ncurl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg\ncurl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \\\n  sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \\\n  sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list\nsudo apt-get update\nsudo apt-get install -y nvidia-container-toolkit\nsudo nvidia-ctk runtime configure --runtime=docker\nsudo systemctl restart docker\n```\n\n---\n\n## 📚 Appendix A: Pretrained Weights\n\nPlan2Scene requires two pretrained neural network models for texture generation and propagation:\n\n### texture-synth-v2-epoch750.ckpt\n- **Size:** 128.80 MB\n- **Purpose:** Neural texture synthesis (VGG-based)\n- **Download:** [Plan2Scene Releases](https://github.com/3dlg-hcvc/plan2scene/releases)\n- **Path:** `plan2scene/code/checkpoints/vgg_crop_selector/texture-synth-v2-epoch750.ckpt`\n- **Config:** Referenced in `plan2scene/code/configs/vgg_crop_selector.yaml`\n\n### texture-prop-synth-v2-epoch250.ckpt\n- **Size:** 1.27 MB  \n- **Purpose:** GNN-based texture propagation across surfaces\n- **Download:** [Plan2Scene Releases](https://github.com/3dlg-hcvc/plan2scene/releases)\n- **Path:** `plan2scene/code/checkpoints/gnn_texture_prop/texture-prop-synth-v2-epoch250.ckpt`\n- **Config:** Referenced in `plan2scene/code/configs/gnn_prop.yaml`\n\n**Installation:**\n```bash\ncd ../plan2scene\n# Follow download instructions in Plan2Scene README\n# Place weights in code/checkpoints/ as shown above\n```\n\n---\n\n## 📚 Appendix B: R2V Annotation Format\n\nThe R2V (Raster-to-Vector) format is used for encoding vectorized floorplan data. This webapp accepts R2V output from the [FloorplanTransformation](https://github.com/art-programmer/FloorplanTransformation) tool.\n\n### Format Specification\n\nR2V files are **space-separated text files** with one element per line:\n\n```\nx1 y1 x2 y2 type id flags\n```\n\n**Fields:**\n- `x1, y1`: Start coordinates (pixels)\n- `x2, y2`: End coordinates (pixels)\n- `type`: Element type (wall, door, fixture, room label)\n- `id`: Unique identifier\n- `flags`: Element-specific flags (optional)\n\n### Element Types\n\n**Walls:**\n```\n100 200 300 200 wall 1 0\n```\n\n**Doors:**\n```\n150 200 150 250 door 2 1\n```\n- Flag `1`: Opening door\n- Flag `0`: Closed door\n\n**Windows:**\n```\n200 100 250 100 window 3 0\n```\n\n**Room Labels:**\n```\n400 300 400 300 bedroom 4 0\n500 500 500 500 bathroom 5 0\n```\n\n**Supported room types:**\n- bedroom, bathroom, living_room, kitchen, dining_room, office, closet, balcony, corridor, laundry_room, garage\n\n**Fixtures:**\n```\n350 350 380 370 sink 6 0\n400 400 450 420 toilet 7 0\n```\n\n**Fixture types:**\n- sink, toilet, shower, bathtub, washing_machine, refrigerator, oven, stove\n\n### Coordinate System\n\n- Origin: Top-left corner (0, 0)\n- Units: Pixels from original floorplan image\n- Y-axis: Increases downward\n\n### Example R2V File\n\n```\n# Walls\n0 0 500 0 wall 1 0\n500 0 500 400 wall 2 0\n500 400 0 400 wall 3 0\n0 400 0 0 wall 4 0\n\n# Door\n200 400 250 400 door 5 1\n\n# Room label\n250 200 250 200 living_room 6 0\n\n# Fixtures\n100 100 150 120 sofa 7 0\n```\n\n### Generating R2V Files\n\nUse the **FloorplanTransformation** tool to generate R2V annotations from floorplan images:\n\n```bash\ncd raster-to-vector\npython main.py --image your_floorplan.png --output annotations/\n```\n\nThis generates a `.txt` annotation file compatible with this webapp.\n\n---\n\n*Built by Leo for the Plan2Scene Assessment.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleok974%2Fplan2scene-webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleok974%2Fplan2scene-webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleok974%2Fplan2scene-webapp/lists"}