IDDM集成设计扩散模型, 支持DDPM、DDIM、PLMS、webui和多GPU分布式训练。 Pytorch原生实现/生成模型/扩散模型/分布式训练
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 4 个月前 | ||
| 5 个月前 | ||
| 2 年前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 个月前 | ||
| 10 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 |
关于模型
该扩散模型包含经典的ldm、ddpm、ddim和plms等采样算法,来源于《High-Resolution Image Synthesis with Latent Diffusion Models》、《Denoising Diffusion Probabilistic Models》、《Denoising Diffusion Implicit Models》和《Pseudo Numerical Methods for Diffusion Models on Manifolds》等论文。
我们将此项目命名为IDDM: Integrated Design Diffusion Model,中文名为集成设计扩散模型。在此项目中进行模型复现、训练器和生成器编写、部分算法和网络结构的改进与优化,该仓库持续维护。
如果有任何问题,请先到此issue进行问题查询,若无法解决可以加入我们的QQ群:949120343、开启新issue提问或联系我的邮箱:chenyu1998424@gmail.com/chairc1998@163.com。如果你认为我的项目有意思请给我点一颗⭐⭐⭐Star⭐⭐⭐吧。
快速开始
本地运行
使用git clone 方法或直接下载本仓库代码zip文件,本地配置环境运行即可
git clone https://github.com/chairc/Integrated-Design-Diffusion-Model.git
cd Integrated-Design-Diffusion-Model
# 在虚拟环境中运行项目(推荐)
conda create -n iddm python=3.10
pip install -r requirements.txt
# 训练模型
cd iddm/tools
python train.py --xxx xxx # 用个人参数替换-xxx
# 生成图像
python generate.py --xxx xxx # 用个人参数替换-xxx
Docker运行
运行构建脚本+运行容器bash脚本,详细修改内容请参考docker_run.sh脚本,如遇下载问题请修改Dockerfile的中国区域下载地址
# 构建项目挂载
bash docker_run.sh -a /path/to/project
# 构建指定路径挂载
bash docker_run.sh \
-d /path/to/datasets \
-r /path/to/results \
-w /path/to/weights
其中,/path/to/project、/path/to/datasets、/path/to/results和/path/to/weights为本地的路径,用于挂载全项目、数据集、结果和权重目录
安装
除了本地运行外,也可采用下列两种方式安装本代码
方式1:使用pip安装(推荐)
pip install iddm
需要以下前置安装包
coloredlogs==15.0.1
gradio==6.0.0
matplotlib==3.7.1
numpy==1.25.0
Pillow==12.2.0
Requests==2.32.4
scikit-image==0.22.0
torch_summary==1.4.5
tqdm==4.66.3
pytorch_fid==0.3.0
fastapi==0.115.6
tensorboard==2.19.0
tensorboardX==2.6.1
transformers==5.0.0
# 如果您想使用 flash attention,请安装 flash-attn
# 编译自己的环境:pip install flash-attn --no-build-isolation
# 或从GitHub下载flash-attn.whl 文件:https://github.com/Dao-AILab/flash-attention/releases/tag/v2.8.2
# 可选安装(默认不安装)
flash-attn==2.8.2
# 如果你想下载GPU版本请使用:pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 -f https://download.pytorch.org/whl/torch_stable.html
# 想了解更多信息请访问:https://pytorch.org/get-started/previous-versions/#linux-and-windows-25
# 更多版本请访问:https://pytorch.org/get-started/previous-versions
# 需要注意torch版本 >= 1.10.0
# 更多信息:https://pytorch.org/get-started/locally/ (推荐)
torch>=1.10.0
torchvision>=0.10.0
方式2:仓库安装
git clone https://github.com/chairc/Integrated-Design-Diffusion-Model.git
cd Integrated-Design-Diffusion-Model
pip install . # 或者 python setup.py install
接下来要做
指南
开发、使用前请认真阅读指南内容哦~
| 指南名称 | 文档 |
|---|---|
| 模型训练 | 训练.md |
| 模型生成 | 生成.md |
| 模型结果 | 结果.md |
| 模型评估 | 评估.md |
| 模型列表 | 模型列表.md |
引用
如果在学术论文中使用该项目进行实验,在可能的情况下,请适当引用我们的项目,为此我们表示感谢。具体引用格式可访问此网站。
@software{chen_2024_10866128,
author = {Chen Yu},
title = {IDDM: Integrated Design Diffusion Model},
month = mar,
year = 2024,
publisher = {Zenodo},
doi = {10.5281/zenodo.10866128},
url = {https://doi.org/10.5281/zenodo.10866128}
}
引用详情可以参考此处:
