Warvito / gradio_medical_ldm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gradio App - Brain Image Synthesis with Latent Diffusion Models

Alt Text

Instructions

  1. Install codecs for ffmpeg
sudo apt install ubuntu-restricted-extras
sudo apt install ffmpeg
  1. Create a virtual environment and install the dependencies
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
  1. Clone MONAI Generative Models repository and install it
git clone https://github.com/Project-MONAI/GenerativeModels.git
cd GenerativeModels
pip install .
cd ..
  1. Download the model weights to the pretrained_models directory The models can be downloaded from here and here.

They should be place in

gradio_medical_ldm/
    L pretrained_models/
        L autoencoder.pth
        L diffusion_model.pth
  1. Run the app
gradio app.py
  1. Open the app in your browser (tested with Chrome)

Notes

The outputs directory contain the generated .nii.gz images.

About


Languages

Language:Python 99.6%Language:Dockerfile 0.4%