A minimum exemplar of the Palette model implemented using the PyTorch Lightning framework.
Setup the environment with the following commands:
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. Put it in the ./data
directory and unzip.
unzip achieve.zip
To train the model, run the following command:
python main.py fit -c ./conf/config.yaml
To test the model, run the following command:
python main.py test -c ./conf/config.yaml
This code borrows heavily from guided diffusion model and so on.