milmillin / ReparamCAD

12 stars 2 forks source link

ReparamCAD: Zero-shot CAD Program Re-Parameterization for Interactive Manipulation

Public code release for "ReparamCAD: Zero-shot CAD Program Re-Parameterization for Interactive Manipulation, SIGGRAPH Asia 2023 Conference Papers, authored by Milin Kodnongbua, Benjamin Jones, Maaz Bin Safeer Ahmad, Vladimir Kim, and Adriana Schulz.

You are permitted to use/edit/recompose the code for non-commercial purposes only.

Installation

  1. Create a conda environment with:

    conda env create -f environment.yml
    conda activate rpcad
  2. Get CUDA Toolkit 11.

  3. Download sd-v1-4.ckpt from https://huggingface.co/CompVis/stable-diffusion-v-1-4-original to weights/sd-v1-4.ckpt, or:

cd weights
wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt

Usage

Step 1: Running the generation process for each prompt

python run.py name="example" prompt="a chair" init.model="chair_arm" task="sd"

Step 2: Running the constraint discovery

python TODO

Development

  1. Install pre-commit to format Python code.
pip install pre-commit
pre-commit install
  1. Add a filter to remove notebook output
git config --local filter.remove-notebook-ouput.clean "jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR"
  1. To run the scripts in Hyak, load my fork of simple_slurm.
pip install -e git+https://github.com/milmillin/simple_slurm.git#egg=simple_slurm

Citation

TODO