# vast-ai-research/mira-scene architecture

> Architecture diagram of the GitHub repository vast-ai-research/mira-scene, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vast-ai-research/mira-scene
- Repository: https://github.com/vast-ai-research/mira-scene

## Overview

Mira-Scene turns a single image into an editable 3D scene through segmentation, depth estimation, canonical-coordinate and voxel prediction, mesh generation, scene assembly, and environment-map generation. Its inference pipeline manages resumable, case-level stage execution; segmentation also supports interactive review. The repository additionally provides Mira-CCM model/training components, UniDataset data utilities, evaluation, and visualization. The README documents the overall stage order; source excerpts expose selected orchestration and model internals, so undocumented implementation links are omitted.

Main entry points: [`infer_scripts/pipeline.py`](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/pipeline.py) (Stage runner), [`infer_scripts/segmentation/engine.py`](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/engine.py) (Segmentation engine), [`Mira-CCM/src/miraccm/pipelines/shape_synthesis/pipeline_ccm_voxel.py`](https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/pipelines/shape_synthesis/pipeline_ccm_voxel.py) (CCM voxel pipeline), [`infer_scripts/5_construct_scene.py`](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/5_construct_scene.py) (Scene assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference orchestration"]
  node_stage_runner["Stage runner<br/>[pipeline.py]"]
  node_case_state["Case state<br/>[manifest.py]"]
end

subgraph group_segmentation["Segmentation and review"]
  node_seg_engine["Segmentation engine<br/>[engine.py]"]
  node_auto_segment["Automatic segmentation<br/>[runner.py]"]
  node_interactive_review["Interactive review<br/>[review.py]"]
end

subgraph group_generation["3D generation"]
  node_depth["Depth estimation"]
  node_ccm_stage["CCM inference stage<br/>[2_inference_CCM.py]"]
  node_ccm_pipeline["CCM voxel pipeline"]
  node_mesh["Object mesh generation"]
  node_scene_assembly["Scene assembly"]
  node_environment_map["Environment map"]
end

subgraph group_learning["Model and data"]
  node_dit_model["CCM voxel transformer<br/>[dit_ccm_voxel.py]"]
  node_dataset["Scene datasets"]
  node_image_transforms["Image and mask transforms"]
  node_voxel_utils["Voxel utilities<br/>[voxel_utils.py]"]
  node_training_system["CCM training system"]
end

subgraph group_results["Evaluation and viewing"]
  node_evaluation["Scene evaluation<br/>[eval_scene.py]"]
  node_visualization["Result visualization"]
end

node_image_user(("Input image"))

node_image_user -->|"submits image"| node_stage_runner
node_stage_runner -->|"runs segmentation"| node_seg_engine
node_stage_runner -->|"runs depth"| node_depth
node_stage_runner -->|"dispatches CCM"| node_ccm_stage
node_stage_runner -->|"runs mesh generation"| node_mesh
node_stage_runner -->|"runs assembly"| node_scene_assembly
node_stage_runner -->|"runs map generation"| node_environment_map
node_stage_runner -->|"tracks stage state"| node_case_state
node_seg_engine -->|"uses automatic runner"| node_auto_segment
node_seg_engine -->|"publishes review inputs"| node_interactive_review
node_ccm_stage -->|"runs inference"| node_ccm_pipeline
node_ccm_pipeline -->|"uses transformer"| node_dit_model
node_dataset -->|"uses transforms"| node_image_transforms
node_dataset -->|"uses voxel utilities"| node_voxel_utils
node_training_system -.-> node_ccm_pipeline
node_evaluation -.->|"evaluates results"| node_scene_assembly
node_visualization -.->|"visualizes results"| node_scene_assembly

click node_stage_runner "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/pipeline.py"
click node_case_state "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/core/manifest.py"
click node_seg_engine "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/engine.py"
click node_auto_segment "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/automatic/runner.py"
click node_interactive_review "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/interactive/review.py"
click node_depth "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/utils/depth_estimation.py"
click node_ccm_stage "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/2_inference_CCM.py"
click node_ccm_pipeline "https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/pipelines/shape_synthesis/pipeline_ccm_voxel.py"
click node_dit_model "https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/models/transformers/dit_ccm_voxel.py"
click node_mesh "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/3_inference_mesh.py"
click node_scene_assembly "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/5_construct_scene.py"
click node_environment_map "https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/6_generate_environment_map.py"
click node_dataset "https://github.com/vast-ai-research/mira-scene/tree/main/UniDataset/src/UniDataset/Scene"
click node_image_transforms "https://github.com/vast-ai-research/mira-scene/blob/main/UniDataset/src/UniDataset/utils/img_and_mask_transforms.py"
click node_voxel_utils "https://github.com/vast-ai-research/mira-scene/blob/main/UniDataset/src/UniDataset/utils/voxel_utils.py"
click node_training_system "https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/systems/shape_synthesis/system_ccm_voxel.py"
click node_evaluation "https://github.com/vast-ai-research/mira-scene/blob/main/eval_scripts/eval_scene.py"
click node_visualization "https://github.com/vast-ai-research/mira-scene/blob/main/visualization/visualize_results.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_stage_runner,node_case_state toneBlue
class node_seg_engine,node_auto_segment,node_interactive_review toneAmber
class node_depth,node_ccm_stage,node_ccm_pipeline,node_mesh,node_scene_assembly,node_environment_map toneMint
class node_dit_model,node_dataset,node_image_transforms,node_voxel_utils,node_training_system toneRose
class node_evaluation,node_visualization,node_image_user toneIndigo
```

## Components

### Inference orchestration

- [Stage runner](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/pipeline.py): `infer_scripts/pipeline.py`
- [Case state](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/core/manifest.py): `infer_scripts/core/manifest.py`

### Segmentation and review

- [Segmentation engine](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/engine.py): `infer_scripts/segmentation/engine.py`
- [Automatic segmentation](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/automatic/runner.py): `infer_scripts/segmentation/automatic/runner.py`
- [Interactive review](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/segmentation/interactive/review.py): `infer_scripts/segmentation/interactive/review.py`

### 3D generation

- [Depth estimation](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/utils/depth_estimation.py): `infer_scripts/utils/depth_estimation.py`
- [CCM inference stage](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/2_inference_CCM.py): `infer_scripts/2_inference_CCM.py`
- [CCM voxel pipeline](https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/pipelines/shape_synthesis/pipeline_ccm_voxel.py): `Mira-CCM/src/miraccm/pipelines/shape_synthesis/pipeline_ccm_voxel.py`
- [Object mesh generation](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/3_inference_mesh.py): `infer_scripts/3_inference_mesh.py`
- [Scene assembly](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/5_construct_scene.py): `infer_scripts/5_construct_scene.py`
- [Environment map](https://github.com/vast-ai-research/mira-scene/blob/main/infer_scripts/6_generate_environment_map.py): `infer_scripts/6_generate_environment_map.py`

### Model and data

- [CCM voxel transformer](https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/models/transformers/dit_ccm_voxel.py): `Mira-CCM/src/miraccm/models/transformers/dit_ccm_voxel.py`
- [Scene datasets](https://github.com/vast-ai-research/mira-scene/tree/main/UniDataset/src/UniDataset/Scene): `UniDataset/src/UniDataset/Scene`
- [Image and mask transforms](https://github.com/vast-ai-research/mira-scene/blob/main/UniDataset/src/UniDataset/utils/img_and_mask_transforms.py): `UniDataset/src/UniDataset/utils/img_and_mask_transforms.py`
- [Voxel utilities](https://github.com/vast-ai-research/mira-scene/blob/main/UniDataset/src/UniDataset/utils/voxel_utils.py): `UniDataset/src/UniDataset/utils/voxel_utils.py`
- [CCM training system](https://github.com/vast-ai-research/mira-scene/blob/main/Mira-CCM/src/miraccm/systems/shape_synthesis/system_ccm_voxel.py): `Mira-CCM/src/miraccm/systems/shape_synthesis/system_ccm_voxel.py`

### Evaluation and viewing

- [Scene evaluation](https://github.com/vast-ai-research/mira-scene/blob/main/eval_scripts/eval_scene.py): `eval_scripts/eval_scene.py`
- [Result visualization](https://github.com/vast-ai-research/mira-scene/blob/main/visualization/visualize_results.py): `visualization/visualize_results.py`

### Other components

- **Input image**

## Connections

- Input image → Stage runner: submits image (evidence: `README.md`)
- Stage runner → Segmentation engine: runs segmentation (evidence: `README.md`)
- Stage runner → Depth estimation: runs depth (evidence: `README.md`)
- Stage runner → CCM inference stage: dispatches CCM (evidence: `infer_scripts/pipeline.py`)
- Stage runner → Object mesh generation: runs mesh generation (evidence: `README.md`)
- Stage runner → Scene assembly: runs assembly (evidence: `README.md`)
- Stage runner → Environment map: runs map generation (evidence: `README.md`)
- Stage runner → Case state: tracks stage state (evidence: `infer_scripts/pipeline.py`)
- Segmentation engine → Automatic segmentation: uses automatic runner (evidence: `infer_scripts/segmentation/engine.py`)
- Segmentation engine → Interactive review: publishes review inputs (evidence: `infer_scripts/segmentation/engine.py`)
- CCM inference stage → CCM voxel pipeline: runs inference (evidence: `infer_scripts/2_inference_CCM.py`)
- CCM voxel pipeline → CCM voxel transformer: uses transformer (evidence: `Mira-CCM/src/miraccm/pipelines/shape_synthesis/pipeline_ccm_voxel.py`)
- Scene datasets → Image and mask transforms: uses transforms (evidence: `UniDataset/src/UniDataset/Scene/infinigen_composite_scene_depth.py`)
- Scene datasets → Voxel utilities: uses voxel utilities (evidence: `UniDataset/src/UniDataset/Scene/infinigen_composite_scene_depth.py`)
- CCM training system → CCM voxel pipeline
- Scene evaluation → Scene assembly: evaluates results
- Result visualization → Scene assembly: visualizes results
