Skip to main content

Pipeline Overview

Planova converts a floor plan image (JPG/PNG) into a walkable 3D interior model. The pipeline supports two modes: a Legacy pipeline that relies entirely on a Vision Language Model (VLM), and a Hybrid CV+VLM pipeline that uses computer vision for wall geometry and the VLM only for semantic information.

Pipeline Modes

ModeStepsGeometry SourceSemantic SourceWhen Used
Legacy7VLMVLMDefault, or when hybrid CV fails
Hybrid CV+VLM12CV (wall mask + skeleton + Hough)VLM (rooms, doors, windows, scale)When pipeline_mode is set to hybrid_cv_vlm

The mode is selected via settings::get_pipeline_mode(data_dir). If the hybrid pipeline's CV stages fail or produce fewer than 3 wall segments, it automatically falls back to the legacy pipeline.

Legacy Pipeline (7 Steps)

  1. Preprocess -- rotation correction, border cropping, size limiting
  2. VLM Parse -- multimodal vision model extracts rooms, walls, doors, windows, and scale in pixel coordinates
  3. Normalize -- pixel-to-meter conversion, wall generation, opening binding, material/camera/light generation
  4. Repair -- vertex snapping, orthogonalization, collinear merging, closure repair
  5. Validate -- geometry checks, quality scores, review gate
  6. Overlay -- debug visualization drawn onto the preprocessed image
  7. Furniture -- LLM-based furniture placement planning

Hybrid CV+VLM Pipeline (12 Steps)

  1. Preprocess -- same as legacy
  2. Wall Mask -- CV: intensity threshold, connected component filtering, floor plan region detection
  3. Wall Graph -- CV: skeletonization, Hough line detection, merging, endpoint snapping, junction detection
  4. VLM Semantic -- VLM: room labels/centroids, doors, windows, scale markers (no wall geometry)
  5. PlanGraph -- merges CV wall segments + VLM semantic data into a unified PlanGraphJSON
  6. Convert -- converts PlanGraphJSON (pixels) to HomeSceneJSON (meters)
  7. Repair -- same as legacy
  8. Alignment -- BFS distance transform comparing CV wall mask to PlanGraph geometry
  9. Validate -- same checks as legacy, plus image alignment score
  10. Overlay -- debug overlays for both VLM parsing and alignment
  11. Furniture -- LLM furniture planning (skipped if quality gate fails)
  12. Save -- persist all pipeline artifacts

Fallback Behavior

The hybrid pipeline falls back to legacy in three cases:

  1. Wall mask extraction fails (e.g., image has no clear dark wall lines)
  2. Wall graph build fails (skeletonization/Hough produces no lines)
  3. Fewer than 3 CV wall segments detected (insufficient geometry)

When fallback occurs, the pipeline logs a warning and runs the full legacy pipeline from step 2 onward.

Pipeline Artifacts

All intermediate artifacts are saved to data/pipeline/{project_id}/:

FileDescriptionPipeline Mode
preprocessed.jpgPreprocessed imageBoth
wall_mask.pngBinary wall mask from CVHybrid
wall_skeleton.pngSkeletonized wall maskHybrid
wall_graph.jsonCV wall segments + junctionsHybrid
wall_segments.jsonRaw CV wall segmentsHybrid
vlm_response.jsonRaw VLM response JSONBoth
plan_graph.jsonMerged PlanGraphJSONHybrid
scene_normalized.jsonNormalized HomeSceneJSONBoth
repair_log.jsonGeometry repair action logBoth
validation_report.jsonQuality validation reportBoth
overlay_debug.pngVLM parsing result overlayBoth
overlay_alignment.pngAlignment visualizationHybrid
rendered_structure_mask.pngPlanGraph geometry rendered as maskHybrid
meta.jsonPipeline metadataBoth

meta.json Example

{
"project_id": "proj_abc123",
"pipeline_mode": "hybrid_cv_vlm",
"vlm_stats": {
"rooms": 4,
"walls": 0,
"doors": 2,
"windows": 2
},
"scene_stats": {
"rooms": 4,
"walls": 7,
"objects": 12,
"materials": 6
},
"validation": {
"score": 0.85,
"image_alignment_score": 0.82,
"error_count": 0,
"warning_count": 1,
"repair_action_count": 3,
"needs_user_review": false
},
"alignment": {
"wall_iou": 0.71,
"wall_precision": 0.88,
"wall_recall": 0.76,
"overall": 0.82
}
}

Source Modules

ModuleFileResponsibility
pipeline::preprocesspreprocess.rsImage preprocessing
pipeline::wall_maskwall_mask.rsCV wall mask extraction
pipeline::wall_graphwall_graph.rsCV wall graph from skeleton
pipeline::plan_graphplan_graph.rsMerging CV + VLM into PlanGraphJSON
pipeline::convertconvert.rsPlanGraphJSON to HomeSceneJSON
pipeline::normalizernormalizer.rsVLM data normalization (legacy)
pipeline::repairrepair.rsGeometry repair
pipeline::alignmentalignment.rsImage alignment scoring
pipeline::validatevalidate.rsQuality validation
pipeline::overlayoverlay.rsDebug overlay generation
pipeline::overlay_alignmentoverlay_alignment.rsAlignment overlay + diagnosis
pipeline::furniturefurniture.rsLLM furniture planning
ai::clientclient.rsVLM/LLM API calls
ai::promptsprompts.rsSystem and user prompts