HouseDiffusion

repository·main·Indexed 42 days ago

https://github.com/aminshabani/house_diffusion

A diffusion model for vector floorplan generation utilizing both discrete and continuous denoising techniques. It includes scripts for training via image_train.py and sampling floorplans via image_sample.py, with support for the RPLAN and MagicPlan datasets.

Tokens
718
Snippets
3
Records
4
Agent score
4%

What's inside HouseDiffusion

  1. Set up the datasets directory

    main

    HouseDiffusion requires processed dataset files located in a datasets folder within the project root.

    1. Download Data: Obtain the RPLAN dataset from RPLAN's website or via their Google Form.
    2. Preprocessing: Use the data preprocessing from House-GAN++.
    3. Directory Structure: Place the processed files in the following structure:
    house_diffusion
    ├── datasets
    │   ├── rplan
    │   │   └── 0.json
    │   │   └── 1.json
    │   │   └── ...
    │   └── ...
    └── ...

    Alternative: If you encounter issues with the RPLAN dataset, it is recommended to use the MagicPlan dataset from the PuzzleFusion project.

  2. Install HouseDiffusion

    main

    To install HouseDiffusion, clone the repository, install the dependencies via requirements.txt, and install the package in editable mode. Note that this implementation is based on guided-diffusion, so you may need to follow its specific installation instructions if issues arise.

    git clone https://github.com/aminshabani/house_diffusion.git
    cd house_diffusion
    pip install -r requirements.txt
    pip install -e .
  3. Train the model using image_train.py

    main

    Run training experiments using the image_train.py script. You must specify the dataset, batch size, set name, and target set.

    Arguments:

    • --dataset: The name of the dataset to use (e.g., rplan).
    • --batch_size: Number of samples per batch.
    • --set_name: The name of the training set.
    • --target_set: The target set identifier.
    python image_train.py --dataset rplan --batch_size 32 --set_name train --target_set 8
  4. Sample floorplans using image_sample.py

    main

    To generate floorplan samples, run image_sample.py from inside the scripts directory.

    Arguments:

    • --dataset: The name of the dataset.
    • --batch_size: Number of samples per batch.
    • --set_name: The name of the evaluation set.
    • --target_set: The target set identifier.
    • --model_path: Path to the trained model checkpoint (e.g., ckpts/exp/model250000.pt).
    • --num_samples: Total number of samples to generate.

    For customization of visualizations, refer to the save_samples function in scripts/image_sample.py.

    python image_sample.py --dataset rplan --batch_size 32 --set_name eval --target_set 8 --model_path ckpts/exp/model250000.pt --num_samples 64