-
Notifications
You must be signed in to change notification settings - Fork 4
/
fittingScript.py
35 lines (27 loc) · 1.04 KB
/
fittingScript.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
from __future__ import print_function, division
import sys, os
import param as config
import aircap_main
import json
outDirName = sys.argv[1]
if config.data == 'raw':
data_root = './data/raw'
elif config.data == 'processed':
data_root = './data/processed'
else:
sys.exit("data parameter should be either 'raw' or 'processed'")
os.mkdir(outDirName)
fitter = aircap_main.aircapFitter(data_root=data_root,nn_list=config.nn_list,camlist=config.camlist)
fitter.fit(idxWin=config.idxWin,
lossW = config.lossW,
optimName=config.optimName,
optim_param=config.optim_param,
optimiters=config.optimiters,
gemanSigma=config.gemanSigma,
poseprior=config.posePrior,
camopt=config.camopt)
fitter.save_results(os.path.join(outDirName,'results'))
with open(os.path.join(outDirName,'config.txt'),'w') as f:
f.write(json.dumps({key:config.__dict__[key] for key in dir(config) if not key.startswith('__')}))
import error_script
error_script.err_func(os.path.join(outDirName,'results.npz'),config.data,outDirName)