Skip to content

Michael-YuQ/infinigen-room-layout-env

Repository files navigation

infinigen-room-layout-env

Tests License: MIT

infinigen-room-layout-env is a Blender-free research repository for indoor layout generation. It extracts the part of the problem that many layout papers actually need for algorithm development:

  • a sequential placement environment for RL and search
  • a static validator for user-specified room layouts
  • an Infinigen-inspired room catalog for bedroom, living_room, and kitchen
  • a procedural room sampler that can generate an unbounded stream of numerical room instances without rendering, mesh generation, or Blender

The repository is intended for studying coarse indoor layout generation in a clean numerical setting where the algorithm decides what to place and where to place it, while the environment judges feasibility and constraint satisfaction.

Why This Repository Exists

Modern indoor scene pipelines often entangle several layers at once:

  • room generation
  • furniture selection
  • geometric layout
  • asset instantiation
  • Blender execution
  • rendering and post-processing

That makes it difficult to evaluate whether a layout policy itself is good. This repository isolates the layout layer so you can benchmark:

  • reinforcement-learning policies
  • search and optimization methods
  • object-subset selection algorithms
  • hybrid planners that mix learned proposals with explicit checking

Core Capabilities

  • SequentialLayoutEnv for interactive reset() / step() placement
  • StaticLayoutValidator for full-scene validation of user-provided placements
  • Infinigen-inspired object roles and room-specific constraints
  • Parameterized room schemas with variable room dimensions
  • Procedural room profiles with random doors, windows, and room options
  • Infinite room-instance streams for large-scale layout benchmarking
  • CPU-friendly toy baselines for GA and actor-critic experiments
  • Unit tests and GitHub Actions CI for reproducible setup

Installation

Minimal installation

git clone https://github.com/Michael-YuQ/infinigen-room-layout-env.git
cd infinigen-room-layout-env
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .

Optional PyTorch support

python -m pip install -e ".[torch]"

Reproducibility Check

Run the test suite on a clean machine:

python -m unittest discover -s tests -v

The repository is designed so that the geometry layer, validator, procedural sampler, and tests run without Blender, without the original Infinigen codebase, and without a GPU.

Quick Start

Static validator demo

python examples/demo_static_layout.py

Sequential environment demo

python examples/demo_env.py

Genetic baseline demo

python examples/demo_ga.py

Procedural room sampling demo

python examples/demo_procedural_rooms.py

Pointer actor-critic forward pass

This example requires PyTorch.

python examples/demo_model_forward.py

CPU actor-critic training

python examples/train_actor_critic.py \
  --task home_office \
  --episodes 500 \
  --device cpu \
  --outdir runs/home_office_ac

Procedural Room Sampling

One of the main goals of the current release is to support effectively infinite room generation in a purely numerical benchmark.

The procedural sampler varies:

  • room width and height
  • aspect ratio
  • room-level options such as has_tv and has_kitchen_barstools
  • door and window placement along sampled walls

It does not decide the furniture subset or the final placement. That remains the responsibility of your algorithm.

from infinigen_layout_env import StaticLayoutValidator, sample_room_instance

instance = sample_room_instance("living_room_open", seed=123)
validator = StaticLayoutValidator(instance.schema, features=instance.features)

print(instance.instance_id)
print(instance.schema.room_width, instance.schema.room_height)
print(instance.sampled_options)
print([feature.to_dict() for feature in instance.features])

For an infinite stream of room instances:

from infinigen_layout_env import iter_room_instances

sampler = iter_room_instances("bedroom_compact", seed=7)
first = next(sampler)
second = next(sampler)

Main API

Static validation

from infinigen_layout_env import build_living_room_schema
from infinigen_layout_env import StaticLayoutValidator, StaticPlacement

schema = build_living_room_schema(has_tv=True)
validator = StaticLayoutValidator(schema)

report = validator.validate(
    [
        StaticPlacement(
            instance_id="sofa_1",
            object_type="sofa",
            support_id="room::floor",
            center_x=3.1,
            center_y=0.475,
            rotation=0,
        ),
    ]
)

print(report.valid)
print(report.errors)

Sequential environment

from infinigen_layout_env import PlacementAction, SequentialLayoutEnv
from infinigen_layout_env.tasks import build_home_office_task

env = SequentialLayoutEnv(build_home_office_task())
observation, info = env.reset()
observation, reward, terminated, truncated, info = env.step(
    PlacementAction(
        item_id="desk",
        support_id="room::floor",
        u=0.14,
        v=0.5,
        rotation=0,
    )
)

Repository Layout

  • infinigen_layout_env/environment.py
    • sequential placement environment
  • infinigen_layout_env/static_layout.py
    • full-scene static validator
  • infinigen_layout_env/room_catalog.py
    • Infinigen-inspired room schemas and object catalog
  • infinigen_layout_env/procedural_rooms.py
    • parameterized room profiles and infinite room-instance sampling
  • infinigen_layout_env/constraints.py
    • low-level sequential placement constraint checker
  • infinigen_layout_env/ga.py
    • lightweight evolutionary baseline
  • infinigen_layout_env/models/
    • pointer-style actor-critic model skeleton
  • examples/
    • runnable examples
  • tests/
    • unit tests for environment, validator, and procedural sampling
  • docs/
    • extracted constraint notes and release notes

Documentation

Current Scope

This repository intentionally stays at the coarse-layout level.

What it models well:

  • support compatibility
  • wall-adjacent placement requirements
  • in-bounds checks
  • support-surface placement on desks, counters, and storage units
  • room-level count rules
  • simple wall-feature conflicts
  • programmatic generation of room-size and room-feature variants

What it does not yet fully model:

  • mesh-level geometry
  • full Infinigen accessibility fields
  • cutter and traversal graphs
  • photorealistic asset diversity
  • multi-room house graphs

Release Notes

The current public release is v0.2.0, which adds:

  • a static validator for Infinigen-inspired room schemas
  • sampled room dimensions in build_room_schema
  • procedural room profiles and infinite room-instance iterators
  • sampled door and window features
  • relaxed office-chair validation to better match Infinigen desk semantics
  • CI-backed reproducibility on Python 3.10, 3.11, and 3.12

Detailed notes are available in docs/releases/v0.2.0.md.

Citation

If this repository is useful in your research, please cite the repository URL and describe the benchmark setting you used, including:

  • room profile
  • random seed policy
  • whether object selection was learned or fixed
  • whether validation used sampled room features
  • whether the task used sequential placement or full-scene static validation

About

Blender-free indoor layout benchmark with a static validator, procedural room sampler, and RL/search baselines.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages