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:
- Python3
- MXNet
- GluonCV
- NumPy
- opencv-python
- Matplotlib
- PyPNG
- Dlib (Only needed for selfie2anime)
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
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
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