-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrun.py
executable file
·28 lines (20 loc) · 935 Bytes
/
run.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
# python script to run GAN algorithms.
import os, sys
import json
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--type', default='dcgan', help='Select GAN type (dcgan/context-encoder/ali/discogan/cyclegan/ebgan/lsgan).')
args = parser.parse_args()
params = vars(args)
print json.dumps(params, indent = 4)
gan_type = params['type']
if gan_type == 'dcgan': os.system('th __0_dcgan/script/main.lua')
elif gan_type == 'context-encoder' : os.system('th __1_context-encoder/script/main.lua')
elif gan_type == 'ali' : os.system('th __2_ali/script/main.lua')
elif gan_type == 'discogan' : os.system('th __3_discogan/script/main.lua')
elif gan_type == 'cyclegan' : os.system('th __4_cyclegan/script/main.lua')
elif gan_type == 'ebgan' : os.system('th __5_ebgan/script/main.lua')
elif gan_type == 'lsgan' : os.system('th __6_lsgan/script/main.lua')
else:
print('Error: wrong type arguments!')
os.exit()