https://github.com/guyi2000/palette-pl-sample
A minimum exemplar of the Palette model implemented using the PyTorch Lightning framework.
https://github.com/guyi2000/palette-pl-sample
ai diffusion diffusion-models pytorch-lightning
Last synced: 10 months ago
JSON representation
A minimum exemplar of the Palette model implemented using the PyTorch Lightning framework.
- Host: GitHub
- URL: https://github.com/guyi2000/palette-pl-sample
- Owner: guyi2000
- License: mit
- Created: 2023-03-30T12:11:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-30T12:16:21.000Z (about 3 years ago)
- Last Synced: 2025-03-25T10:44:47.193Z (about 1 year ago)
- Topics: ai, diffusion, diffusion-models, pytorch-lightning
- Language: Jupyter Notebook
- Homepage:
- Size: 452 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Palette: image-to-image diffusion model
A minimum exemplar of the [Palette](https://iterative-refinement.github.io/palette/) model implemented using the [PyTorch Lightning](https://lightning.ai/docs/pytorch/latest/) framework.
## Environment Setup
Setup the environment with the following commands:
```shell
conda create -n palette
conda activate palette
# Install pytorch & torchvision
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
# Install pytorch-lightning
conda install pytorch-lightning -c conda-forge
# Install pytorch-lightning CLO
pip install "pytorch-lightning[extra]"
# Install tensorboard
conda install tensorboard
# Install opencv for python
pip install opencv-python
```
Then, you need download the dataset [CelebaHQ here](https://www.kaggle.com/datasets/badasstechie/celebahq-resized-256x256). Put it in the `./data` directory and unzip.
```shell
unzip achieve.zip
```
## Usage
To **train** the model, run the following command:
```shell
python main.py fit -c ./conf/config.yaml
```
To **test** the model, run the following command:
```shell
python main.py test -c ./conf/config.yaml
```
## Acknowledgments
This code borrows heavily from [guided diffusion model](https://github.com/openai/guided-diffusion) and so on.