You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.7 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Jittor 武汉大学队 手写数字生成
  2. ![主要结果](images/result1.png)
  3. ## 简介
  4. 本项目是 华中科技大学“武汉大学”队 参加 第二届计图人工智能挑战赛 热身赛 所使用的代码。项目使用 Jittor 框架实现的 Conditional GAN 模型在 MNIST 数据集上训练,并生成一串手写数字的图像。
  5. ## 安装
  6. ### 运行环境
  7. - Jittor 1.3.4.12
  8. - Numpy 1.22.4
  9. - Pillow 9.1.1
  10. ### 安装依赖
  11. 执行以下命令安装 python 依赖
  12. ```bash
  13. pip install -r requirements.txt
  14. ```
  15. ### 预训练模型
  16. 预训练模型[下载地址](https://drive.google.com/drive/folders/1qnS1SXwtmR-2H-i8vDxW1W4H5k1E2ENI?usp=sharing)。请将预训练模型放入 `saved/` 文件夹中供代码加载,并不要改变其文件名。
  17. ## 运行
  18. ### 训练
  19. ```bash
  20. python CGAN.py train
  21. ```
  22. 运行上述指令即可开始训练,训练使用 Jittor 框架内置的 MNIST 数据集格式,训练过程中每一个 epoch 的模型系数和结果文件将保存在 `saved/` 文件夹下。
  23. ### 推理
  24. ```bash
  25. python CGAN.py eval result.png 87
  26. ```
  27. 将预训练模型或自行训练的系数 `pkl` 文件放入 `saved/` 文件夹下,并使用上述指令进行推理。推理命令的格式为 `python CGAN.py [output file] [epoch]`,预训练模型 epoch 数为 87,故给出的上述指令使用的是预训练模型推理。
  28. ## 致谢
  29. 本项目参考了以下资料与项目,感谢作者的分享!
  30. - https://cg.cs.tsinghua.edu.cn/jittor/tutorial/2020-5-13-22-47-cgan/
  31. - https://github.com/Jittor/gan-jittor/blob/master/models/cgan/cgan.py
  32. - https://github.com/arturml/mnist-cgan/blob/master/mnist-cgan.ipynb

第二届计图人工智能挑战赛 华中科技大学“武汉大学”队 热身赛项目,使用了Jittor框架实现的Conditional GAN完成手写数字生成题目

Contributors (1)