Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 909:cd038493f8c6
finished image extraction script for HoG-SVM training
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 26 Jun 2017 17:45:32 -0400 |
| parents | b297525b2cbf |
| children | b58a1061a717 |
comparison
equal
deleted
inserted
replaced
| 908:b297525b2cbf | 909:cd038493f8c6 |
|---|---|
| 414 dbfn = dbFilenames[i] | 414 dbfn = dbFilenames[i] |
| 415 else: | 415 else: |
| 416 dbfn = filename | 416 dbfn = filename |
| 417 cursor.execute('INSERT INTO prototypes (id, dbfilename, trajectory_type, nMatchings) VALUES ({},\"{}\",\"{}\",{})'.format(protoId, dbfn, trajectoryType, n)) | 417 cursor.execute('INSERT INTO prototypes (id, dbfilename, trajectory_type, nMatchings) VALUES ({},\"{}\",\"{}\",{})'.format(protoId, dbfn, trajectoryType, n)) |
| 418 cursor.execute('SELECT * from sqlite_master WHERE type = \"table\" and name = \"{}\"'.format(tableNames[trajectoryType])) | 418 cursor.execute('SELECT * from sqlite_master WHERE type = \"table\" and name = \"{}\"'.format(tableNames[trajectoryType])) |
| 419 if len(cursor.fetchall) == 0: | 419 if len(cursor.fetchall()) == 0: |
| 420 pass # save prototype trajectory data | 420 pass # save prototype trajectory data |
| 421 except sqlite3.OperationalError as error: | 421 except sqlite3.OperationalError as error: |
| 422 printDBError(error) | 422 printDBError(error) |
| 423 connection.commit() | 423 connection.commit() |
| 424 connection.close() | 424 connection.close() |
