-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdemo.py
46 lines (34 loc) · 1021 Bytes
/
demo.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
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
#coding=utf-8
import time
import subprocess
from six.moves import configparser
from numpy import loadtxt
import gmmreg
import plotting
def test(f_config, display=True):
model, scene, after_tps = gmmreg.run_config(f_config)
if display:
plotting.displayABC(model, scene, after_tps)
def run_executable(gmmreg_exe, f_config, method, display=True):
cmd = '%s %s %s'%(gmmreg_exe, f_config, method)
t1 = time.time()
subprocess.call(cmd, shell=True)
t2 = time.time()
print("Elasped time: {} seconds".format(t2 - t1))
if display:
display_pts(f_config)
def display_pts(f_config):
c = configparser.ConfigParser()
c.read(f_config)
section_common = 'FILES'
mf = c.get(section_common, 'model')
sf = c.get(section_common, 'scene')
tf = c.get(section_common, 'transformed_model')
m = loadtxt(mf)
s = loadtxt(sf)
t = loadtxt(tf)
plotting.displayABC(m,s,t)
import sys
if __name__ == '__main__':
test(sys.argv[1])