Mercurial Hosting > traffic-intelligence
diff python/utils.py @ 364:a50a69e04c2a
script modification so that command line arguments take precedence over config file
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 12 Jul 2013 02:29:49 -0400 |
parents | 72aa44072093 |
children | 90bdabc06e9f |
line wrap: on
line diff
--- a/python/utils.py Fri Jul 12 01:26:22 2013 -0400 +++ b/python/utils.py Fri Jul 12 02:29:49 2013 -0400 @@ -441,14 +441,18 @@ def loadConfigFile(self, filename): from ConfigParser import ConfigParser from numpy import loadtxt - + from os import path + config = ConfigParser() config.readfp(FakeSecHead(openCheck(filename))) self.sectionHeader = config.sections()[0] self.videoFilename = config.get(self.sectionHeader, 'video-filename') self.databaseFilename = config.get(self.sectionHeader, 'database-filename') self.homographyFilename = config.get(self.sectionHeader, 'homography-filename') - self.homography = loadtxt(self.homographyFilename) + if (path.exists(self.homographyFilename)): + self.homography = loadtxt(self.homographyFilename) + else: + self.homography = None self.firstFrameNum = config.getint(self.sectionHeader, 'frame1') self.videoFrameRate = config.getfloat(self.sectionHeader, 'video-fps')