forked from bamos/dcgan-completion.tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
complete.py
executable file
·35 lines (29 loc) · 1.11 KB
/
complete.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3.4
#
# Brandon Amos (http://bamos.github.io)
# License: MIT
# 2016-08-05
import argparse
import os
import tensorflow as tf
from model import DCGAN
parser = argparse.ArgumentParser()
parser.add_argument('--lr', type=float, default=0.01)
parser.add_argument('--momentum', type=float, default=0.9)
parser.add_argument('--nIter', type=int, default=1000)
parser.add_argument('--imgSize', type=int, default=64)
parser.add_argument('--lam', type=float, default=0.1)
parser.add_argument('--checkpointDir', type=str, default='checkpoint')
parser.add_argument('--outDir', type=str, default='completions')
parser.add_argument('--maskType', type=str,
choices=['random', 'center', 'left', 'full'],
default='center')
parser.add_argument('imgs', type=str, nargs='+')
args = parser.parse_args()
assert(os.path.exists(args.checkpointDir))
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
with tf.Session(config=config) as sess:
dcgan = DCGAN(sess, image_size=args.imgSize,
checkpoint_dir=args.checkpointDir, lam=args.lam)
dcgan.complete(args)