<img src='imgs/horse2zebra.gif' align="right" width=384>
<br><br><br>
# CycleGAN and pix2pix in PyTorch
We provide PyTorch implementations for both unpaired and paired image-to-image translation.
The code was written by [Jun-Yan Zhu](https://github.com/junyanz) and [Taesung Park](https://github.com/taesung), and supported by [Tongzhou Wang](https://ssnl.github.io/).
This PyTorch implementation produces results comparable to or better than our original Torch software. If you would like to reproduce the same results as in the papers, check out the original [CycleGAN Torch](https://github.com/junyanz/CycleGAN) and [pix2pix Torch](https://github.com/phillipi/pix2pix) code
**Note**: The current software works well with PyTorch 0.4+. Check out the older [branch](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/tree/pytorch0.3.1) that supports PyTorch 0.1-0.3.
You may find useful information in [training/test tips](docs/tips.md) and [frequently asked questions](docs/qa.md).
**CycleGAN: [Project](https://junyanz.github.io/CycleGAN/) | [Paper](https://arxiv.org/pdf/1703.10593.pdf) | [Torch](https://github.com/junyanz/CycleGAN)**
<img src="https://junyanz.github.io/CycleGAN/images/teaser_high_res.jpg" width="800"/>
**Pix2pix: [Project](https://phillipi.github.io/pix2pix/) | [Paper](https://arxiv.org/pdf/1611.07004.pdf) | [Torch](https://github.com/phillipi/pix2pix)**
<img src="https://phillipi.github.io/pix2pix/images/teaser_v3.png" width="800px"/>
**[EdgesCats Demo](https://affinelayer.com/pixsrv/) | [pix2pix-tensorflow](https://github.com/affinelayer/pix2pix-tensorflow) | by [Christopher Hesse](https://twitter.com/christophrhesse)**
<img src='imgs/edges2cats.jpg' width="400px"/>
If you use this code for your research, please cite:
Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks
[Jun-Yan Zhu](https://people.eecs.berkeley.edu/~junyanz/)\*, [Taesung Park](https://taesung.me/)\*, [Phillip Isola](https://people.eecs.berkeley.edu/~isola/), [Alexei A. Efros](https://people.eecs.berkeley.edu/~efros)
In ICCV 2017. (* equal contributions) [[Bibtex]](https://junyanz.github.io/CycleGAN/CycleGAN.txt)
Image-to-Image Translation with Conditional Adversarial Networks
[Phillip Isola](https://people.eecs.berkeley.edu/~isola), [Jun-Yan Zhu](https://people.eecs.berkeley.edu/~junyanz), [Tinghui Zhou](https://people.eecs.berkeley.edu/~tinghuiz), [Alexei A. Efros](https://people.eecs.berkeley.edu/~efros)
In CVPR 2017. [[Bibtex]](http://people.csail.mit.edu/junyanz/projects/pix2pix/pix2pix.bib)
## Course
CycleGAN course assignment [code](http://www.cs.toronto.edu/~rgrosse/courses/csc321_2018/assignments/a4-code.zip) and [handout](http://www.cs.toronto.edu/~rgrosse/courses/csc321_2018/assignments/a4-handout.pdf) designed by Prof. [Roger Grosse](http://www.cs.toronto.edu/~rgrosse/) for [CSC321](http://www.cs.toronto.edu/~rgrosse/courses/csc321_2018/) "Intro to Neural Networks and Machine Learning" at University of Toronto. Please contact the instructor if you would like to adopt it in your course.
## Other implementations
### CycleGAN
<p><a href="https://github.com/leehomyc/cyclegan-1"> [Tensorflow]</a> (by Harry Yang),
<a href="https://github.com/architrathore/CycleGAN/">[Tensorflow]</a> (by Archit Rathore),
<a href="https://github.com/vanhuyz/CycleGAN-TensorFlow">[Tensorflow]</a> (by Van Huy),
<a href="https://github.com/XHUJOY/CycleGAN-tensorflow">[Tensorflow]</a> (by Xiaowei Hu),
<a href="https://github.com/LynnHo/CycleGAN-Tensorflow-Simple"> [Tensorflow-simple]</a> (by Zhenliang He),
<a href="https://github.com/luoxier/CycleGAN_Tensorlayer"> [TensorLayer]</a> (by luoxier),
<a href="https://github.com/Aixile/chainer-cyclegan">[Chainer]</a> (by Yanghua Jin),
<a href="https://github.com/yunjey/mnist-svhn-transfer">[Minimal PyTorch]</a> (by yunjey),
<a href="https://github.com/Ldpe2G/DeepLearningForFun/tree/master/Mxnet-Scala/CycleGAN">[Mxnet]</a> (by Ldpe2G),
<a href="https://github.com/tjwei/GANotebooks">[lasagne/keras]</a> (by tjwei)</p>
</ul>
### pix2pix
<p><a href="https://github.com/affinelayer/pix2pix-tensorflow"> [Tensorflow]</a> (by Christopher Hesse),
<a href="https://github.com/Eyyub/tensorflow-pix2pix">[Tensorflow]</a> (by Eyyüb Sariu),
<a href="https://github.com/datitran/face2face-demo"> [Tensorflow (face2face)]</a> (by Dat Tran),
<a href="https://github.com/awjuliani/Pix2Pix-Film"> [Tensorflow (film)]</a> (by Arthur Juliani),
<a href="https://github.com/kaonashi-tyc/zi2zi">[Tensorflow (zi2zi)]</a> (by Yuchen Tian),
<a href="https://github.com/pfnet-research/chainer-pix2pix">[Chainer]</a> (by mattya),
<a href="https://github.com/tjwei/GANotebooks">[tf/torch/keras/lasagne]</a> (by tjwei),
<a href="https://github.com/taey16/pix2pixBEGAN.pytorch">[Pytorch]</a> (by taey16)
</p>
</ul>
## Prerequisites
- Linux or macOS
- Python 2 or 3
- CPU or NVIDIA GPU + CUDA CuDNN
## Getting Started
### Installation
- Clone this repo:
```bash
git clone https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix
cd pytorch-CycleGAN-and-pix2pix
```
- Install PyTorch 0.4+ and torchvision from http://pytorch.org and other dependencies (e.g., [visdom](https://github.com/facebookresearch/visdom) and [dominate](https://github.com/Knio/dominate)). You can install all the dependencies by
```bash
pip install -r requirements.txt
```
- For Conda users, we include a script `./scripts/conda_deps.sh` to install PyTorch and other libraries.
### CycleGAN train/test
- Download a CycleGAN dataset (e.g. maps):
```bash
bash ./datasets/download_cyclegan_dataset.sh maps
```
- Train a model:
```bash
#!./scripts/train_cyclegan.sh
python train.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan
```
- To view training results and loss plots, run `python -m visdom.server` and click the URL http://localhost:8097. To see more intermediate results, check out `./checkpoints/maps_cyclegan/web/index.html`.
- Test the model:
```bash
#!./scripts/test_cyclegan.sh
python test.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan
```
- The test results will be saved to a html file here: `./results/maps_cyclegan/latest_test/index.html`.
### pix2pix train/test
- Download a pix2pix dataset (e.g.facades):
```bash
bash ./datasets/download_pix2pix_dataset.sh facades
```
- Train a model:
```bash
#!./scripts/train_pix2pix.sh
python train.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA
```
- To view training results and loss plots, run `python -m visdom.server` and click the URL http://localhost:8097. To see more intermediate results, check out `./checkpoints/facades_pix2pix/web/index.html`.
- Test the model (`bash ./scripts/test_pix2pix.sh`):
```bash
#!./scripts/test_pix2pix.sh
python test.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA
```
- The test results will be saved to a html file here: `./results/facades_pix2pix/test_latest/index.html`. You can find more scripts at `scripts` directory.
### Apply a pre-trained model (CycleGAN)
- You can download a pretrained model (e.g. horse2zebra) with the following script:
```bash
bash ./scripts/download_cyclegan_model.sh horse2zebra
```
- The pretrained model is saved at `./checkpoints/{name}_pretrained/latest_net_G.pth`. Check [here](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/scripts/download_cyclegan_model.sh#L3) for all the available CycleGAN models.
- To test the model, you also need to download the horse2zebra dataset:
```bash
bash ./datasets/download_cyclegan_dataset.sh horse2zebra
```
- Then generate the results using
```bash
python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout
```
- The option `--model test` is used for generating results of CycleGAN only for one side. This option will automatically set `--dataset_mode single`, which only loads the images from one set. On the contrary, using `--model cycle_gan` requ
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
毕业设计是高等教育阶段学生完成学业的一个重要环节,通常在学士或硕士学业即将结束时进行。这是学生将在整个学业中所学知识和技能应用到实际问题上的机会,旨在检验学生是否能够独立思考、解决问题,并展示其专业能力的一项综合性任务。 毕业设计的主要特点包括: 独立性: 毕业设计要求学生具备独立思考和解决问题的能力。学生需要选择一个合适的课题,研究相关文献,进行实地调查或实验,并提出独立见解。 实践性: 毕业设计是将理论知识应用到实际问题中的一次实践。通过完成毕业设计,学生能够将所学的专业知识转化为实际的解决方案,加深对专业领域的理解。 综合性: 毕业设计往往要求学生运用多个学科的知识,综合各种技能。这有助于培养学生的综合素养,提高他们的综合能力。 导师指导: 学生在毕业设计过程中通常由一名指导老师或导师团队提供指导和支持。导师负责引导学生确定研究方向、制定计划、提供建议,并在整个过程中监督进展。 学术规范: 毕业设计要求学生按照学术规范完成研究,包括文献综述、研究设计、数据采集与分析、结论和讨论等环节。学生需要撰写一篇完整的毕业论文,并进行答辩。
资源推荐
资源详情
资源评论
收起资源包目录
使用Qt实现的基于openpose和pix2pix对抗网络的游戏人物动作模拟。本科毕业设计。.zip (94个子文件)
SJT-code
mainwindow.h 2KB
QtPoseImitate.pro 2KB
fake.m4v 2MB
LICENSE 1KB
aboutdialog.ui 6KB
mainwindow.cpp 7KB
pytorch_pix2pix
pubgPoseFake.py 16KB
logswap 0B
pix2pix_class.py 2KB
data
__init__.py 2KB
base_data_loader.py 171B
image_dataset.py 2KB
base_dataset.py 3KB
unaligned_dataset.py 2KB
image_folder.py 2KB
aligned_dataset.py 3KB
single_dataset.py 1KB
LICENSE 3KB
normalization.py 2KB
options
__init__.py 0B
train_options.py 3KB
test_options.py 1KB
base_options.py 6KB
docs
datasets.md 5KB
qa.md 13KB
tips.md 8KB
pix2pix_test.py 2KB
environment.yml 247B
requirements.txt 64B
models
__init__.py 1KB
networks.py 15KB
base_model.py 6KB
test_model.py 2KB
cycle_gan_model.py 7KB
pix2pix_model.py 4KB
.gitignore 84B
train.py 2KB
test.py 2KB
util
__init__.py 0B
get_data.py 3KB
util.py 2KB
image_pool.py 1KB
visualizer.py 7KB
html.py 2KB
README.md 11KB
log
swap 72B
pubg.log 1KB
pbug_pix2pix
test_latest
images
curPose_real_B.jpg 7KB
curPose_real_A.jpg 4KB
curPose_fake_B.jpg 12KB
keras_openpose
util.py 3KB
model.py 9KB
model
get_keras_model.sh 110B
keras_openpose_test.py 15KB
config 763B
config_reader.py 1KB
config.py 6KB
config 793B
scripts
eval_cityscapes
evaluate.py 3KB
util.py 1KB
caffemodel
deploy.prototxt 11KB
cityscapes.py 6KB
download_fcn8s.sh 217B
edges
PostprocessHED.m 2KB
batch_hed.py 3KB
download_pix2pix_model.sh 331B
test_cyclegan.sh 115B
test_single.sh 164B
train_cyclegan.sh 118B
test_pix2pix.sh 161B
train_pix2pix.sh 203B
download_cyclegan_model.sh 577B
test_before_push.py 2KB
conda_deps.sh 223B
install_deps.sh 48B
main.cpp 176B
mainwindow.ui 8KB
getModels.sh 1KB
aboutdialog.h 297B
QtPoseImitate.pro.user 24KB
pose.m4v 1.12MB
.gitignore 83B
images.qrc 100B
images
fake.m4v 2MB
2019-04-2020-45-24_src.jpg 14KB
pose.m4v 1.12MB
2019-04-2020-45-24_pose.jpg 6KB
pose_128px.ico 66KB
src.m4v 2.17MB
2019-04-2020-45-24_fake.jpg 25KB
poster.png 2.62MB
src.m4v 2.17MB
aboutdialog.cpp 222B
README.md 10KB
共 94 条
- 1
资源评论
JJJ69
- 粉丝: 6369
- 资源: 5917
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【岗位说明】行政经理岗位职责.docx
- 【岗位说明】行政司机的岗位职责及工作规范.docx
- 【岗位说明】行政助理岗位职责.docx
- 【岗位说明】行政专员岗位职责.docx
- 【岗位说明】行政专员岗位职责及工作内容.docx
- 【岗位说明】行政专员岗位职责及任职要求.docx
- 【岗位说明】绩效经理岗位说明书.docx
- 【岗位说明】技术部文员岗位职责说明书.docx
- 【岗位说明】人力资源类部门组织结构与责权.docx
- 【岗位说明】人事行政经理岗位职责.docx
- 【岗位说明】人事行政主管岗位职责.docx
- 【岗位说明】人事主管岗位说明书.docx
- 【岗位说明】人事总监岗位职责.docx
- 【岗位说明】人事科岗位职责.docx
- 【岗位说明】外贸部经理岗位职责.docx
- 【岗位说明】招聘专员岗位说明书.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功