# Diff-Plugin
**Repository Path**: gao-zihui11/Diff-Plugin
## Basic Information
- **Project Name**: Diff-Plugin
- **Description**: diffusion实现多任务重建
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-05-14
- **Last Updated**: 2024-05-14
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Yuhao Liu
·
Zhanghan Ke十
.
Fang Liu十
.
Nanxuan Zhao
·
Rynson W.H. Lau十
#### Note that in the advanced options, you can adjust
- the image resolution in the format of `width==height` for flexible outputs;
- the diffusion steps for faster speed (by default is 20);
- the random seed to generate different results.
# Train your own task-plugin
### Step-1: construct your own dataset
1. Navigate to your training data directory:
```
cd data/train
touch task_name.csv
```
Arrange your data according to the format in `example.csv`, using **relative paths** for the samples specified in the train.sh script.
Note that we leave the data root for filling in the **train.sh** file and only support the relative path for the used samples.
Example for a sample named `a1`:
- Input: `/user/Dataset/task1/input/a1.jpg`
- GT: `/user/Dataset/task1/GT/a1.jpg`
Your `task_name.csv` should contain lines in the following format:
```
task1/input/a1.jpg,task1/GT/a1.jpg
```
## Step-2: start training
Replace `task` name with your task, and execute the training script with:
```
bash train.sh
```
Note that:
- For single GPU training, use `python xxx`; for multiple GPUs, use `accelerate xxx`.
- Ensure the task name matches the folder name in `data/train`
- Training was conducted on four A100 GPUs with a batch size of 64
## License
This project is released under the [Creative Commons Attribution NonCommercial ShareAlike 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode) license.
## Citation
If you find Diff-Plugin useful in your research, please consider citing:
```bibtex
@article{liu2024diff,
title={Diff-Plugin: Revitalizing Details for Diffusion-based Low-level Tasks},
author={Liu, Yuhao and Ke, Zhanghan and Liu, Fang and Zhao, Nanxuan and Rynson W.H. Lau},
journal={arXiv preprint arXiv:2403.00644},
year={2024}
}
```
## Acknowledgements
Special thanks to the following repositories for supporting our research:
- [Diffusers](https://github.com/huggingface/diffusers)
- [CLIP](https://github.com/openai/CLIP)
- [ControlNet](https://github.com/lllyasviel/ControlNet)
## Contact
This repository is maintained by Yuhao Liu ([@Yuhao](https://github.com/yuhaoliu7456)).
For questions, please contact `yuhaoliu7456@outlook.com`.