Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/nomad/site-parameters-optimization.py @ 1190:d24d57e4de24
work on optimization
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 28 Jun 2022 01:04:58 +0200 |
| parents | ccab20f85710 |
| children | f3b3696f5640 |
comparison
equal
deleted
inserted
replaced
| 1189:ccab20f85710 | 1190:d24d57e4de24 |
|---|---|
| 49 # move to the location of the intersection | 49 # move to the location of the intersection |
| 50 for intersectionPath in intersections: | 50 for intersectionPath in intersections: |
| 51 intersectionAbsPath = os.path.abspath(intersectionPath) | 51 intersectionAbsPath = os.path.abspath(intersectionPath) |
| 52 os.chdir(intersectionAbsPath) | 52 os.chdir(intersectionAbsPath) |
| 53 # iterate through all the subdirectories to find ground truth sqlite files | 53 # iterate through all the subdirectories to find ground truth sqlite files |
| 54 gtDatabaseaAbsPaths.extend([os.path.abspath(intersectionAbsPath + '/' + file) for file in glob.glob('**/*_gt.sqlite', recursive=True)]) | 54 newPaths = [os.path.abspath(intersectionAbsPath + '/' + file) for file in glob.glob('**/*_gt.sqlite', recursive=True)] |
| 55 configFileAbsPaths.append(os.path.abspath(intersectionAbsPath + '/' + glob.glob('*.cfg', recursive=True)[0])) | 55 gtDatabaseaAbsPaths.extend(newPaths) |
| 56 configFilename = os.path.abspath(intersectionAbsPath + '/' + glob.glob('*.cfg', recursive=True)[0]) | |
| 57 configFileAbsPaths.extend([configFilename]*len(newPaths)) | |
| 56 os.chdir(cwd) | 58 os.chdir(cwd) |
| 57 for gtDatabaseAbsPath, configFileAbsPath in zip(gtDatabaseaAbsPaths, configFileAbsPaths): | 59 for gtDatabaseAbsPath, configFileAbsPath in zip(gtDatabaseaAbsPaths, configFileAbsPaths): |
| 58 gtDatabaseBasename = gtDatabaseAbsPath[:-10] | 60 gtDatabaseBasename = gtDatabaseAbsPath[:-10] |
| 59 videoFilename = gtDatabaseBasename + ".MP4" | 61 videoFilename = gtDatabaseBasename + ".MP4" |
| 60 databaseFilename = gtDatabaseBasename + ".sqlite" | 62 databaseFilename = gtDatabaseBasename + ".sqlite" |
