Mercurial Hosting > traffic-intelligence
diff scripts/learn-motion-patterns.py @ 1046:f2ba9858e6c6
motion pattern learning seems to work
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 05 Jul 2018 23:12:11 -0400 |
parents | 75a6ad604cc5 |
children |
line wrap: on
line diff
--- a/scripts/learn-motion-patterns.py Thu Jul 05 17:45:18 2018 -0400 +++ b/scripts/learn-motion-patterns.py Thu Jul 05 23:12:11 2018 -0400 @@ -14,7 +14,7 @@ parser.add_argument('-i', dest = 'inputPrototypeDatabaseFilename', help = 'name of the Sqlite database file for prototypes to start the algorithm with') parser.add_argument('-t', dest = 'trajectoryType', help = 'type of trajectories to process', choices = ['feature', 'object'], default = 'feature') parser.add_argument('--nfeatures-per-object', dest = 'nLongestFeaturesPerObject', help = 'maximum number of features per object to load', type = int) -parser.add_argument('-n', dest = 'nTrajectories', help = 'number of the object or feature trajectories to load', type = int, default = None) +parser.add_argument('-n', dest = 'nObjects', help = 'number of the object or feature trajectories to load', type = int, default = None) parser.add_argument('-e', dest = 'epsilon', help = 'distance for the similarity of trajectory points', type = float, required = True) parser.add_argument('--metric', dest = 'metric', help = 'metric for the similarity of trajectory points', default = 'cityblock') # default is manhattan distance parser.add_argument('-s', dest = 'minSimilarity', help = 'minimum similarity to put a trajectory in a cluster', type = float, required = True) @@ -44,7 +44,7 @@ print('Cannot learn and assign simultaneously') sys.exit(0) -objects = storage.loadTrajectoriesFromSqlite(args.databaseFilename, args.trajectoryType, args.nTrajectories, timeStep = args.positionSubsamplingRate, nLongestFeaturesPerObject = args.nLongestFeaturesPerObject) +objects = storage.loadTrajectoriesFromSqlite(args.databaseFilename, args.trajectoryType, args.nObjects, timeStep = args.positionSubsamplingRate, nLongestFeaturesPerObject = args.nLongestFeaturesPerObject) if args.trajectoryType == 'object' and args.nLongestFeaturesPerObject is not None: objectsWithFeatures = objects objects = [f for o in objectsWithFeatures for f in o.getFeatures()]