Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
junyanz committed Jul 31, 2020
1 parent 676ec87 commit 1988a48
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ cd CUT

### CUT and FastCUT Training and Test

- Download the grumpifycat dataset (Fig 8 of the paper. Russian Blue -> Grumpy Cats)
- Download the `grumpifycat` dataset (Fig 8 of the paper. Russian Blue -> Grumpy Cats)
```bash
bash ./datasets/download_cut_dataset.sh grumpifycat
```
Expand All @@ -119,7 +119,7 @@ The checkpoints will be stored at `./checkpoints/grumpycat_*/web`.

- Test the CUT model:
```bash
python test.py --dataroot ./datasets/grumpifycat --name grumpycat_CUT --CUT_mode CUT
python test.py --dataroot ./datasets/grumpifycat --name grumpycat_CUT --CUT_mode CUT --phase train

```

Expand Down Expand Up @@ -177,4 +177,4 @@ If you use this code for your research, please cite our [paper](https://arxiv.or


### Acknowledgments
We thank Allan Jabri and Phillip Isola for helpful discussion and feedback. Our code is developed based on [pytorch-CycleGAN-and-pix2pix](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix). We also thank [pytorch-fid](https://github.com/mseitzer/pytorch-fid) for FID computation and [drn](https://github.com/fyu/drn) for mIoU computation, and [stylegan2-pytorch](https://github.com/rosinality/stylegan2-pytorch/) for the PyTorch implementation of StyleGAN2 used in single-image translation.
We thank Allan Jabri and Phillip Isola for helpful discussion and feedback. Our code is developed based on [pytorch-CycleGAN-and-pix2pix](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix). We also thank [pytorch-fid](https://github.com/mseitzer/pytorch-fid) for FID computation, [drn](https://github.com/fyu/drn) for mIoU computation, and [stylegan2-pytorch](https://github.com/rosinality/stylegan2-pytorch/) for the PyTorch implementation of StyleGAN2 used in our single-image translation setting.
8 changes: 6 additions & 2 deletions models/cut_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
import torch
from .base_model import BaseModel
from . import networks
from .nce import PatchNCELoss
from .patchnce import PatchNCELoss
import util.util as util


class CUTModel(BaseModel):
""" This class implements CUT and FastCUT model
""" This class implements CUT and FastCUT model, described in the paper
Contrastive Learning for Unpaired Image-to-Image Translation
Taesung Park, Alexei A. Efros, Richard Zhang, Jun-Yan Zhu
ECCV, 2020
The code borrows heavily from the PyTorch implementation of CycleGAN
https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix
"""
Expand Down
2 changes: 0 additions & 2 deletions models/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import numpy as np
from .stylegan_networks import StyleGAN2Discriminator, StyleGAN2Generator, TileStyleGAN2Discriminator

# from IPython import embed

###############################################################################
# Helper Functions
###############################################################################
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions models/stylegan_networks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
The network architectures is based on PyTorch implemenation of StyleGAN2Encoder.
Original PyTorch repo: https://github.com/rosinality/style-based-gan-pytorch
Origianl StyelGAN2 paper: https://github.com/NVlabs/stylegan2
We use the network architeture for our single-image traning setting.
"""

import math
import numpy as np
import random
Expand Down

0 comments on commit 1988a48

Please sign in to comment.