https://github.com/pfnet-research/chainer-pix2pix
chainer implementation of pix2pix
https://github.com/pfnet-research/chainer-pix2pix
chainer generative-adversarial-network pix2pix
Last synced: 6 days ago
JSON representation
chainer implementation of pix2pix
- Host: GitHub
- URL: https://github.com/pfnet-research/chainer-pix2pix
- Owner: pfnet-research
- Created: 2016-12-03T16:14:06.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-20T08:08:22.000Z (over 7 years ago)
- Last Synced: 2025-04-13T10:38:07.354Z (6 months ago)
- Topics: chainer, generative-adversarial-network, pix2pix
- Language: Python
- Size: 797 KB
- Stars: 131
- Watchers: 6
- Forks: 40
- Open Issues: 4
-
Metadata Files:
- Readme: README-ja.md
Awesome Lists containing this project
README
# chainer-pix2pix
chainer implementation of pix2pix
https://phillipi.github.io/pix2pix/# Example result on CMP facade dataset
![]()
左からinput, output, ground_truth# usage
1. chainerの最新版を入れる
2. facade datasetを http://cmp.felk.cvut.cz/~tylecr1/facade/ から持ってくる
3. `python train_facade.py -g [GPUの番号] -i [データセットのroot directory] --out [出力ディレクトリ] --snapshot_interval 10000`
4. 数時間待つ
- `--out`で指定したディレクトリに、`--snapshot_interval`で指定した頻度で、現在のモデルと、結果を可視化した画像が記録される
- モデルは結構サイズが大きいので、`--snapshot_interval`を下げすぎないように注意# facade以外のデータセットでやるとき
- データセットを用意する。位置の合った画像(あるいは画像的な構造を持つarray)のペアが必要。数百枚程度でもそれっぽい結果が出せると言われている。
- `facade_dataset.py`を書き換える。get_exampleが呼ばれた時に、i番目の(入力画像, 教師出力画像)が返るようになっていれば良い(両方numpy array)。
- `updater.py`でlossの計算を行っているが(現在はL1 loss + adversarial loss)、変える必要があれば変える。
- `facade_visualizer.py`の可視化コードをデータセットに合わせて書き換える。
- `train_facade.py`は50行目くらいのin_ch, out_chをデータセットに合わせて書き換える。