ufownl / cycle_gan

CycleGAN with Spectral Normalization implemented and Class Activation Mapping Attention using MXNet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cycle_gan

CycleGAN with Spectral Normalization and Class Activation Mapping Attention implemented using MXNet.

I tried to train it using the dataset selfie2anime and got the following results:

p1 p2 p3 p4 p5 p6 p7 p8 p9

Requirements

Usage

Get pre-trained models

You can checkout the pre-trained models in pretrained/* branches. For example, use the following command to get the pre-trained selfie2anime model:

git clone --branch pretrained/selfie2anime https://github.com/ufownl/cycle_gan.git

Run selfie2anime cli-demo

Simplest:

python3 selfie2anime.py /path/to/selfie

Details:

usage: selfie2anime.py [-h] [--resize RESIZE] [--device_id DEVICE_ID] [--gpu]
                       IMG [IMG ...]

Start a selfie2anime tester.

positional arguments:
  IMG                   path of the image file[s]

optional arguments:
  -h, --help            show this help message and exit
  --resize RESIZE       set the short size of fake image (default: 256)
  --device_id DEVICE_ID
                        select device that the model using (default: 0)
  --gpu                 using gpu acceleration

Run selfie2anime demo server

In addition to the cli-demo above, you can also run the demo server of selfie2anime, then click here to visit the demo page.

Simplest:

python3 server.py --model selfie2anime

Details:

usage: server.py [-h] [--reversed] [--model MODEL] [--resize RESIZE] [--addr ADDR]
                 [--port PORT] [--device_id DEVICE_ID] [--gpu]

This is CycleGAN demo server.

optional arguments:
  -h, --help            show this help message and exit
  --reversed            reverse transformation
  --model MODEL         set the model used by the server (default: vangogh2photo)
  --resize RESIZE       set the short size of fake image (default: 256)
  --addr ADDR           set address of cycle_gan server (default: 0.0.0.0)
  --port PORT           set port of cycle_gan server (default: 80)
  --device_id DEVICE_ID
                        select device that the model using (default: 0)
  --gpu                 using gpu acceleration

References

About

CycleGAN with Spectral Normalization implemented and Class Activation Mapping Attention using MXNet.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%