Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 1.25 KB

README.md

File metadata and controls

53 lines (44 loc) · 1.25 KB

leaf LEAF: Latent Diffusion with Efficient Encoder Distillation for Aligned Features in Medical Image Segmentation

Performance

leaf

Setup

  1. Clone the repository:
git clone https://github.com/lispear/LEAF.git
cd LEAF-master
  1. Install dependencies (requires conda):
conda create -n leaf python=3.11.11 -y
conda activate leaf
pip install -r requirements.txt 

Training

  1. Create assets directory:
mkdir assets
cd assets
  1. Prepare pre-trained models:
  • Download U-Net and VAE
  • Place the downloaded files in the assets folder.
  • Extract the weights:
unzip kl-f8.zip -d vae
unzip lsun_churches.zip -d unet
cd ..
python extract_weights.py
  1. Generate training configuration:
python src/util/config_util.py --output config.yaml
  1. Run training script:
accelerate launch \
    --num_processes 1 \
    --num_machines 1 \
    --mixed_precision 'no' \
    --dynamo_backend 'no' \
    train.py --config config.yaml