Mercurial Hosting > traffic-intelligence
changeset 922:acb5379c5fd7
corrected
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 05 Jul 2017 18:07:53 -0400 |
parents | 630934595871 |
children | 238008f81c16 |
files | python/storage.py scripts/learn-motion-patterns.py |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/python/storage.py Wed Jul 05 18:01:43 2017 -0400 +++ b/python/storage.py Wed Jul 05 18:07:53 2017 -0400 @@ -597,9 +597,9 @@ connection = sqlite3.connect(filename) cursor = connection.cursor() try: - cursor.execute('CREATE TABLE IF NOT EXISTS prototypes (dbfilename VARCHAR, id INTEGER, trajectory_type VARCHAR CHECK (trajectory_type IN (\"feature\", \"object\")), nmatchings INTEGER, PRIMARY KEY (id, dbfilename))') + cursor.execute('CREATE TABLE IF NOT EXISTS prototypes (filename VARCHAR, id INTEGER, trajectory_type VARCHAR CHECK (trajectory_type IN (\"feature\", \"object\")), nmatchings INTEGER, PRIMARY KEY (filename, id))') for p in prototypes: - cursor.execute('INSERT INTO prototypes (dbfilename, id, trajectory_type, nmatchings) VALUES (?,?,?,?)', (p.getFilename(), p.getNum(), p.getTrajectoryType(), p.getNMatchings())) + cursor.execute('INSERT INTO prototypes (filename, id, trajectory_type, nmatchings) VALUES (?,?,?,?)', (p.getFilename(), p.getNum(), p.getTrajectoryType(), p.getNMatchings())) except sqlite3.OperationalError as error: printDBError(error) connection.commit()
--- a/scripts/learn-motion-patterns.py Wed Jul 05 18:01:43 2017 -0400 +++ b/scripts/learn-motion-patterns.py Wed Jul 05 18:07:53 2017 -0400 @@ -71,7 +71,7 @@ print(clusterSizes) -prototypes = [moving.Prototype(objects[i].getNum(), args.databaseFilename, prototypeType, clusterSizes[i]) for i in prototypeIndices] +prototypes = [moving.Prototype(args.databaseFilename, objects[i].getNum(), prototypeType, clusterSizes[i]) for i in prototypeIndices] if args.outputPrototypeDatabaseFilename is None: outputPrototypeDatabaseFilename = args.databaseFilename else: