美文网首页
CycleGAN-苹果变橘子大法

CycleGAN-苹果变橘子大法

作者: LucasJin | 来源:发表于2017-05-25 22:55 被阅读304次

this repo based on the original implementation of CycleGAN: https://github.com/jinfagang/pytorch_cycle_gan.git, in this version I reconstruct some code and made a generate API to simply generate image from your own single image and your trained model.

CycleGAN - Generate Image Like Magic

I have trained apple2orange and horse2zebra for now, here is the real result of convert
apple -> orange:

</img>

</img>

</img>

I only trained about 50 epochs, but the result is fair enough for now. Laterly I will finish horse2zebra model, and update some more results.

Requirements

  • Python3+
  • PyTorch
  • visdom
  • PIL

Usage

  • For Train

About how to train, simply run this:

python3 train.py --dataroot ./datasets/apple2orange --name apple2orange --model cycle_gan

One things have to mention that, --name indicates the model save dir, and --model is using cycle_gan or pixel2pixel , I only tried cycle_gan.

  • For Generate

Train is very simple, but the original repo have not implement predict API, so I managed to write by myself. Here is the way to use:

python3 generate.py --image_path ./apple_test.jpg --name apple2orange --model cycle_gan --gpu_ids -1

As you can see, you only need to specific image path where stores your image to generate, and --name is the same as previous trained, as well as model type. --gpu_ids indicates we are inference using CPU.

OK, that's all.

Research and Discuss

I really love to connect to people, so if you have any question about this repo, you can find me on wechat jintianiloveu, I have some groups which discuss about GANs I will invite you in if you like.

Copyright

(c) 2017 Jin Fagang under LICENSE Apache 2.0

相关文章

  • CycleGAN-苹果变橘子大法

    this repo based on the original implementation of CycleGA...

  • 无题

    橘子 橘子有酸有甜 橘子有大有小 苹果 苹果有大有小 苹果有红有青 人呢 人呢有好有坏 人呢有男有女 你能吃橘子吃...

  • 我想要的是苹果 你却给了我橘子

    苹果小姐,长相甜美,性情温婉。橘子先生,长相一般,沉默内敛。苹果小姐认识橘子先生10年,橘子先生喜欢苹果小姐10年...

  • 橘子,苹果?

  • 水果拼盘

    今天中午,我是用橘子和苹果做的。它的四周都是橘子。眼睛,鼻子是苹果,嘴也是橘子。头发也是苹果。我是先那...

  • 苹果和橘子

    昨天乐乐被一道这样的题难住了: 苹果是橘子的4倍,如果每天吃3个橘子,8个苹果,当橘子吃完后,苹果还剩40个,请问...

  • 水果平盘

    首先拿出一个苹果再拿出几个橘子冼干净,然后再把苹果和橘子剥皮。把苹果有水果刀切成一小段一小段的,再把橘子把...

  • 喜欢是和你好好说话

    --1-- 苹果先生:“论文写完了吗” 橘子小姐:“没,考完试再写” 苹果先生:“哦哦” 橘子小姐忙着玩自己的手机...

  • 学习小组Day1笔记-陈冰雪

    Day1 陈冰雪 标题和列表 无序列表 苹果 香蕉 橘子 有序列表 苹果 香蕉 橘子 链接和图片 NCBI 引用 ...

  • 夏季苹果橘子

    阳历七月中旬了,算是夏天吧。晚上郭宛玉说,她还有苹果没吃。我有些惊讶的,因为在我有限的记忆里,苹果不都是秋冬季节的...

网友评论

      本文标题:CycleGAN-苹果变橘子大法

      本文链接:https://www.haomeiwen.com/subject/erftfxtx.html