comparison python/storage.py @ 589:5800a87f11ae

corrected one bug and changed attribute names
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 05 Dec 2014 15:14:44 -0500
parents c5406edbcf12
children dc2d0a0d7fe1
comparison
equal deleted inserted replaced
588:c5406edbcf12 589:5800a87f11ae
284 elif trajectoryType in ['bbtop', 'bbbottom']: 284 elif trajectoryType in ['bbtop', 'bbbottom']:
285 if trajectoryType == 'bbtop': 285 if trajectoryType == 'bbtop':
286 corner = 'top_left' 286 corner = 'top_left'
287 elif trajectoryType == 'bbbottom': 287 elif trajectoryType == 'bbbottom':
288 corner = 'bottom_right' 288 corner = 'bottom_right'
289 queryStatement = 'SELECT object_id, frame_number, x_'+corner+', y_'+corner+' FROM '+tableName+' '+trajectoryIdQuery+'ORDER BY object_id, frame_number' 289 queryStatement = 'SELECT object_id, frame_number, x_'+corner+', y_'+corner+' FROM '+tableName+' '+idQuery+'ORDER BY object_id, frame_number'
290 cursor.execute(queryStatement) 290 cursor.execute(queryStatement)
291 logging.debug(queryStatement) 291 logging.debug(queryStatement)
292 else: 292 else:
293 print('no trajectory type was chosen') 293 print('no trajectory type was chosen')
294 except sqlite3.OperationalError as error: 294 except sqlite3.OperationalError as error:
373 objects = [] 373 objects = []
374 374
375 connection.close() 375 connection.close()
376 return objects 376 return objects
377 377
378 def loadGroundTruthFromSqlite(filename, gtType, gtNumbers = None): 378 def loadGroundTruthFromSqlite(filename, gtType = 'bb', gtNumbers = None):
379 'Loads bounding box annotations (ground truth) from an SQLite ' 379 'Loads bounding box annotations (ground truth) from an SQLite '
380 connection = sqlite3.connect(filename) 380 connection = sqlite3.connect(filename)
381 gt = [] 381 gt = []
382 382
383 if gtType == 'bb': 383 if gtType == 'bb':