How aim-uofa/gsi-bench works
Purpose and Top-Level Entry Points
GSI-Bench benchmarks generative image-editing models on 3D spatial understanding: instruction compliance (IC), spatial accuracy (SA), appearance consistency (AC), and edit locality (EL). The normal user entry point is evaluation/run.sh or the staged commands in evaluation/eval.sh, followed by evaluation/eval/aggregate.py. Two optional dataset-construction pipelines live independently under robothor/ and mesatask/.
Evaluation Orchestration and Contracts
Evaluation consumes externally generated PNGs arranged per model and benchmark split, plus downloaded dataset and weight symlinks. evaluation/eval.sh orchestrates IC/SA/EL across models and datasets; evaluation/eval/eval.py is the core evaluator; evaluation/eval/aggregate.py merges metric outputs into final per-model/per-dataset reports. The principal boundary is filesystem-based: generators need not integrate with this repository if they emit the prescribed image naming/layout.
Vision-Based Spatial Scoring
The evaluation stack loads samples and edited images, detects/segments target objects, and compares edited versus reference geometry and image regions. evaluation/models/model.py provides model-facing evaluation integration, while evaluation/utils/wrap_model.py and evaluation/utils/box_utils.py support model invocation and spatial-box operations. DetAny3D is vendored as the central perception backend under evaluation/utils/detect_anything/modeling/, including image encoding, prompt encoding, mask decoding, and depth prediction.
Text-Grounded Detection Boundary
Optional text-prompt object detection is supplied by the vendored GroundingDINO package. Its inference integration is concentrated in evaluation/src/groundingdino/groundingdino/util/inference.py, with model registration in evaluation/src/groundingdino/groundingdino/models/registry.py and Swin configurations under evaluation/src/groundingdino/groundingdino/config/. It requires separately downloaded weights and is installed as an editable local package.
MLLM Appearance-Consistency Pipeline
AC is separated from the deterministic vision-metric path. evaluation/mllm_eval/mllm_eval.py runs inference using prompts from evaluation/mllm_eval/prompts.py; evaluation/mllm_eval/build_lmdb.py prepares image data; results are consumed during aggregation. This stage requires vLLM and an externally supplied Qwen3-VL model, making it a runtime/service boundary rather than a bundled model.
RoboTHOR Dataset Generation
robothor/ produces indoor-scene edit records using AI2-THOR. Shell entry points such as robothor/scripts/generate_train.sh invoke scene/action generation, while robothor/action_utils/environment_utils.py manages simulator interaction and modules such as robothor/action_utils/object_relative.py implement command families. The output boundary is JSONL plus RGB/depth/segmentation assets; AI2-THOR scene assets, NVIDIA GPU, and headless CloudRendering/X are external dependencies.
MesaTask Dataset Generation
mesatask/ transforms tabletop 3D layouts into paired image-editing examples. mesatask/generate_atomic_transforms.py creates move/rotate/scale variants; mesatask/organize_image_editing_dataset.py assembles rendered assets and metadata; mesatask/tools/layout2scene/reconstruct_blender.py supports Blender-based scene reconstruction. Layout assets come from the external MesaTask-10K dataset; Blender rendering and optional Drake physical optimization are distinct runtime boundaries.
Main entry points: eval.py Core evaluator · mllm_eval.py MLLM AC scoring · aggregate.py Report aggregation · run.sh Evaluation entrypoint
Components 21
Evaluation
Scores externally generated benchmark edits.
- Generated PNGs · Images must follow the prescribed model and split layout.
- Evaluation entrypoint · Normal user entrypoint for staged evaluation.
evaluation/run.sh - Metric orchestration · Runs IC, SA, and EL across models and datasets.
evaluation/eval.sh - Core evaluator · Loads samples and compares edits with references.
evaluation/eval/eval.py - Model integration · Model-facing evaluation interface.
evaluation/models/model.py - Spatial utilities · Model wrapping and spatial-box operations.
evaluation/utils/box_utils.py - MLLM AC scoring · Appearance-consistency inference using external Qwen3-VL.
evaluation/mllm_eval/mllm_eval.py - AC prompts
evaluation/mllm_eval/prompts.py - AC image preparation
evaluation/mllm_eval/build_lmdb.py - Report aggregation · Merges deterministic metrics and AC results per model and dataset.
evaluation/eval/aggregate.py - Benchmark reports · Final per-model and per-dataset metric reports.
Vision Backends
Vendored spatial and text-grounded perception.
- DetAny3D · Encodes images and prompts, decodes masks, and predicts depth.
evaluation/utils/detect_anything/modeling/__init__.py - GroundingDINO inference · Optional prompt-based object detection integration.
evaluation/src/groundingdino/groundingdino/util/inference.py - GroundingDINO registry
evaluation/src/groundingdino/groundingdino/models/registry.py
RoboTHOR Generation
Indoor-scene dataset construction pipeline.
- RoboTHOR generation · Generates indoor scene edit records through AI2-THOR.
robothor/scripts/generate_train.sh - Simulator interaction · Manages simulator scenes and actions.
robothor/action_utils/environment_utils.py - RoboTHOR records · JSONL records with RGB, depth, and segmentation assets.
MesaTask Generation
Tabletop dataset construction pipeline.
- Atomic transforms · Creates move, rotate, and scale variants.
mesatask/generate_atomic_transforms.py - Dataset assembly · Assembles rendered assets and editing metadata.
mesatask/organize_image_editing_dataset.py - Blender reconstruction · Reconstructs scenes for rendering.
mesatask/tools/layout2scene/reconstruct_blender.py - MesaTask examples · Paired tabletop image-editing examples.
Connections 20
- Generated PNGs → Evaluation entrypoint: input images
- Evaluation entrypoint → Metric orchestration: starts
- Metric orchestration → Core evaluator: runs IC/SA/EL
- Generated PNGs → Core evaluator: loads edits
- Core evaluator → Model integration: uses
- Model integration → Spatial utilities: uses
- Core evaluator → DetAny3D: segments and estimates depth
- Core evaluator → GroundingDINO inference: optional text detection
- GroundingDINO inference → GroundingDINO registry: resolves model
- Generated PNGs → AC image preparation: prepares images
- AC image preparation → MLLM AC scoring: image store
- AC prompts → MLLM AC scoring: prompts
- MLLM AC scoring → Report aggregation: AC results
- Core evaluator → Report aggregation: IC/SA/EL outputs
- Report aggregation → Benchmark reports: publishes
- RoboTHOR generation → Simulator interaction: drives
- Simulator interaction → RoboTHOR records: writes
- Atomic transforms → Blender reconstruction: scene variants
- Blender reconstruction → Dataset assembly: rendered assets
- Dataset assembly → MesaTask examples: writes