Mercurial Hosting > traffic-intelligence
annotate scripts/nomad/site-parameters-optimization.py @ 1219:8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 19 Jun 2023 17:09:56 -0400 |
parents | 606817bc31e8 |
children | 5a207c838323 |
rev | line source |
---|---|
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
1 #! /usr/bin/env python3 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
2 import os |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
3 import sys |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
4 import glob |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
5 from trafficintelligence import storage, moving |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
6 import subprocess |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
7 import numpy as np |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
8 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
9 |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
10 def loadParametersStartProcess(filename, intersections): |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
11 # load initial parameters from x.txt |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
12 f = open(filename, 'r+') |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
13 l = f.readline() |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
14 x = [s for s in l.strip().split(" ")] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
15 f.close() |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
16 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
17 # create para-value list |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
18 para = paraValueList(x) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
19 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
20 # run process including trackingfeature, groupfeature, load groundtruth, compute mota |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
21 print(process(para, intersections)) |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
22 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
23 def paraValueList(x): |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
24 #create para-value list |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
25 #list of the 8 parameters and their values |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
26 p = 8*[None] |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
27 p[0] = '--feature-quality' #]0.-0.4] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
28 p[1] = '--min-feature-distanceklt' #]0.-6] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
29 p[2] = '--window-size' #[1-10]integer |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
30 p[3] = '--min-tracking-error' #[0.01-0.3] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
31 p[4] = '--min-feature-time' #[2-100]integer |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
32 p[5] = '--mm-connection-distance' #[0.5-100] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
33 p[6] = '--mm-segmentation-distance' #[1-100] ~mm-connection-distance / 2.5 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
34 p[7] = '--min-nfeatures-group' #[2-4] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
35 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
36 para = [] |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
37 if len(x) == 4: |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
38 for n in range(4): |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
39 para = para + [p[4+n],x[n]] |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
40 else: |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
41 for n in range(len(x)): |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
42 para = para + [p[n],x[n]] |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
43 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
44 return para |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
45 |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
46 def process(para, intersections): |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
47 Mota = [] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
48 gtDatabaseaAbsPaths = [] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
49 configFileAbsPaths = [] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
50 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
51 cwd = os.getcwd() |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
52 # move to the location of the intersection |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
53 for intersectionPath in intersections: |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
54 intersectionAbsPath = os.path.abspath(intersectionPath) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
55 os.chdir(intersectionAbsPath) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
56 # iterate through all the subdirectories to find ground truth sqlite files |
1190
d24d57e4de24
work on optimization
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1189
diff
changeset
|
57 newPaths = [os.path.abspath(intersectionAbsPath + '/' + file) for file in glob.glob('**/*_gt.sqlite', recursive=True)] |
d24d57e4de24
work on optimization
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1189
diff
changeset
|
58 gtDatabaseaAbsPaths.extend(newPaths) |
d24d57e4de24
work on optimization
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1189
diff
changeset
|
59 configFilename = os.path.abspath(intersectionAbsPath + '/' + glob.glob('*.cfg', recursive=True)[0]) |
d24d57e4de24
work on optimization
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1189
diff
changeset
|
60 configFileAbsPaths.extend([configFilename]*len(newPaths)) |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
61 os.chdir(cwd) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
62 for gtDatabaseAbsPath, configFileAbsPath in zip(gtDatabaseaAbsPaths, configFileAbsPaths): |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
63 gtDatabaseBasename = gtDatabaseAbsPath[:-10] |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
64 videoFilename = gtDatabaseBasename + ".avi" # careful, it may be necessary to check video type / extension |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
65 if not os.path.exists(videoFilename): |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
66 print('Video file {} does not exist'.format(videoFilename)) |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
67 databaseFilename = gtDatabaseBasename + ".sqlite" |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
68 gtDatabaseDirname = os.path.dirname(gtDatabaseAbsPath) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
69 homographyFilename = gtDatabaseDirname + "/homography.txt" |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
70 maskFilename = gtDatabaseDirname + "/mask.png" |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
71 # Skip feature tracking if the user specified to optimize only grouping parameters |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
72 if len(para) > 8: |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
73 # Track features |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
74 trackingFeature(para, configFileAbsPath, videoFilename, databaseFilename, homographyFilename, maskFilename) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
75 # Group features |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
76 groupFeature(para, configFileAbsPath, videoFilename, databaseFilename, homographyFilename, maskFilename) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
77 #load trajectory |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
78 objects = storage.loadTrajectoriesFromSqlite(databaseFilename, 'object') |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
79 #load ground truth |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
80 annotations = storage.loadTrajectoriesFromSqlite(gtDatabaseAbsPath, 'object') |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
81 # Appending negative mota because nomad minimizes the output |
1191
f3b3696f5640
adding time interval for MOTA computation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1190
diff
changeset
|
82 matchingDistance = 5 |
1192
606817bc31e8
bug correction
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1191
diff
changeset
|
83 inter = moving.TimeInterval.unionIntervals([a.getTimeInterval() for a in annotations]) |
1191
f3b3696f5640
adding time interval for MOTA computation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1190
diff
changeset
|
84 motp, mota, mt, mme, fpt, gt, gtMatches, toMatches = moving.computeClearMOT(annotations, objects, matchingDistance, inter.first, inter.last) |
f3b3696f5640
adding time interval for MOTA computation
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1190
diff
changeset
|
85 Mota.append(-mota) |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
86 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
87 # Change to the previous directory |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
88 os.chdir(cwd) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
89 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
90 return np.mean(Mota) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
91 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
92 def trackingFeature(para, config, video, db, homo, mask): |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
93 # remove previous tracking |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
94 if os.path.exists(db): |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
95 os.remove(db) |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
96 # trackingfeature command parameters |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
97 tf = ['feature-based-tracking', config, '--tf', '--video-filename', video, '--database-filename', db, '--homography-filename', homo, '--mask-filename', mask] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
98 # run in command line and print directly |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
99 subprocess.check_output(tf + para) |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
100 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
101 def groupFeature(para, config, video, db, homo, mask): |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
102 #remove previous grouping |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
103 storage.deleteFromSqlite(db, 'object') |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
104 #groupfeature command parameters |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
105 gf = ['feature-based-tracking', config, '--gf', '--video-filename', video, '--database-filename', db, '--homography-filename', homo, '--mask-filename', mask] |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
106 #run in command line and print directly |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
107 subprocess.check_output(gf + para) # ['--min-feature-time', 'x', '--mm-connection-distance', 'x', '--mm-segmentation-distance', 'x', '--min-nfeatures-group', 'x'] |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
108 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
109 |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
110 if __name__ == "__main__": |
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
111 # Load args that were given with select-arguments.py |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
112 # with open('arguments.txt', 'r') as f: |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
113 # args = f.read().split('\n') |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
114 # intersections = args[0] |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
115 # optimizeGroupingOnly = eval(args[1]) |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
116 # intersections = eval(intersections) |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
117 |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
118 # Just write the intersections to optimize here |
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
119 intersections = ['../12-laurier'] |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
120 |
1219
8a626226793e
update where optimization uses either nomad-parameter file depending on optimizing 1 or 2 steps
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
1192
diff
changeset
|
121 loadParametersStartProcess(sys.argv[1], intersections) |
1186
7117a31555c1
Etienne Beauchamp s work on optimization with Nomad software
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
122 sys.exit(0) |