How adityagupta000/floorplan works
FloorPlan3D turns an uploaded architectural plan into a semantic mask, builds a colored OBJ model, then previews and exports it. The main runtime spans a step-based Next.js interface and a Flask API; segmentation uses a ResNet50–U-Net with rotation-based test-time augmentation. The README also documents a separate training workflow and dataset preparation, preserved here as supporting capabilities. Edges across UI stages and the API are documented in the README; backend calls and model construction are visible in excerpts. The frontend-to-API wiring is not shown in sampled source.
Main entry points: app.py Flask API · processing-workflow.tsx Workflow controller · page.tsx Landing page · upload-step.tsx Plan upload
Components 18
Web experience
- Landing page
frontend/app/page.tsx - Workflow controller
frontend/components/processing-workflow.tsx - Plan upload
frontend/components/workflow/upload-step.tsx - Segmentation step
frontend/components/workflow/segment-step.tsx - Model generation step
frontend/components/workflow/generate-step.tsx - 3D preview
frontend/components/model-3d-viewer.tsx - OBJ download
frontend/components/workflow/download-step.tsx
Conversion API
- Flask API
backend/app.py - Uploaded plans
backend/app.py - Segmentation masks
backend/app.py - OBJ geometry
backend/obj_generator.py - Generated OBJ files
backend/app.py
Segmentation model
- Inference and TTA
backend/inference.py - ResNet50 U-Net
backend/model.py
Training data
- Dataset masks
training/xml_to_mask.py - Model training
training/train_old.py - Segmentation evaluation
training/confusion.py
Other components
- Plan designer
Connections 22
- Plan designer → Landing page: opens
- Landing page → Workflow controller: presents
frontend/app/page.tsx - Workflow controller → Plan upload: starts with
- Plan upload → Flask API: uploads plan
- Flask API → Uploaded plans: saves plan
backend/app.py - Workflow controller → Segmentation step: continues to
- Segmentation step → Flask API: requests segmentation
- Flask API → Inference and TTA: calls inference
backend/app.py - Inference and TTA → ResNet50 U-Net: runs model
backend/inference.py - Flask API → Segmentation masks: saves mask
backend/app.py - Workflow controller → Model generation step: continues to
- Model generation step → Flask API: requests generation
- Flask API → OBJ geometry: calls generator
backend/app.py - Flask API → Segmentation masks: reads mask
backend/app.py - Flask API → Generated OBJ files: saves OBJ
backend/app.py - Workflow controller → 3D preview: previews model
- 3D preview → Generated OBJ files: loads OBJ
- Workflow controller → OBJ download: ends with
- OBJ download → Flask API: requests download
- Flask API → Generated OBJ files: sends file
backend/app.py - Dataset masks → Model training: provides masks
- Model training → Segmentation evaluation: evaluates predictions