-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproject.py
32 lines (26 loc) · 961 Bytes
/
project.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
#!/usr/bin/env python3.4
#
# Irmak Sirer
# License: MIT
# 2016-09
import argparse
import os
import tensorflow as tf
from model import DCGAN
parser = argparse.ArgumentParser()
parser.add_argument('--lr', type=float, default=0.0005)
parser.add_argument('--momentum', type=float, default=0.75)
parser.add_argument('--nIter', type=int, default=2000)
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='projections')
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.project(args)