Mercurial Hosting > traffic-intelligence
diff scripts/classify-objects.py @ 685:94b291a5f933 dev
several updates for display
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 05 Jun 2015 17:13:28 +0200 |
parents | 6d2ece4aed7c |
children | cdee6a3a47b4 |
line wrap: on
line diff
--- a/scripts/classify-objects.py Fri Jun 05 13:26:51 2015 +0200 +++ b/scripts/classify-objects.py Fri Jun 05 17:13:28 2015 +0200 @@ -12,6 +12,7 @@ parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True) +parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to classify', type = int, default = None) parser.add_argument('--plot-speed-distributions', dest = 'plotSpeedDistribution', help = 'simply plots the distributions used for each user type', action = 'store_true') parser.add_argument('--max-speed-distribution-plot', dest = 'maxSpeedDistributionPlot', help = 'if plotting the user distributions, the maximum speed to display', type = float, default = 50.) #parser.add_argument('-u', dest = 'undistort', help = 'undistort the video (because features have been extracted that way)', action = 'store_true') @@ -60,11 +61,11 @@ plt.show() sys.exit() -objects = storage.loadTrajectoriesFromSqlite(params.databaseFilename, 'object') -features = storage.loadTrajectoriesFromSqlite(params.databaseFilename, 'feature') +objects = storage.loadTrajectoriesFromSqlite(params.databaseFilename, 'object', args.nObjects, withFeatures = True) +#features = storage.loadTrajectoriesFromSqlite(params.databaseFilename, 'feature') intervals = [] for obj in objects: - obj.setFeatures(features) + #obj.setFeatures(features) intervals.append(obj.getTimeInterval()) timeInterval = moving.unionIntervals(intervals)