Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/storage.py @ 1216:8356e15fd691
fix for result files
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Sun, 07 May 2023 16:24:27 -0400 |
| parents | 1b472cddf9b1 |
| children | 83ca1493d55c |
comparison
equal
deleted
inserted
replaced
| 1215:1b472cddf9b1 | 1216:8356e15fd691 |
|---|---|
| 1297 return calib | 1297 return calib |
| 1298 | 1298 |
| 1299 # from https://github.com/utiasSTARS/pykitti/blob/master/pykitti/utils.py | 1299 # from https://github.com/utiasSTARS/pykitti/blob/master/pykitti/utils.py |
| 1300 | 1300 |
| 1301 | 1301 |
| 1302 def loadTrajectoriesFromKITTI(filename, kittiCalibration, oxts): | 1302 def loadTrajectoriesFromKITTI(filename, kittiCalibration, oxts, resultFile = False): |
| 1303 '''Reads data from KITTI ground truth or output from an object detection and tracking method | 1303 '''Reads data from KITTI ground truth or output from an object detection and tracking method |
| 1304 | 1304 |
| 1305 kittiCalibration is obtained from loading training/testing calibration file for each sequence 00XX.txt | 1305 kittiCalibration is obtained from loading training/testing calibration file for each sequence 00XX.txt |
| 1306 oxts is obtained using utils.load_oxts_packets_and_poses(['./training/oxts/0001.txt']) from pykitti | 1306 oxts is obtained using utils.load_oxts_packets_and_poses(['./training/oxts/0001.txt']) from pykitti |
| 1307 | 1307 |
| 1326 'h', # box height | 1326 'h', # box height |
| 1327 'w', # box width | 1327 'w', # box width |
| 1328 'l', # box length (in meters) | 1328 'l', # box length (in meters) |
| 1329 'x', 'y', 'z', # location (x,y,z) in camera coord | 1329 'x', 'y', 'z', # location (x,y,z) in camera coord |
| 1330 'ry'] # yaw angle (around Y-axis in camera coordinates) [-pi..pi] | 1330 'ry'] # yaw angle (around Y-axis in camera coordinates) [-pi..pi] |
| 1331 if resultFile: | |
| 1332 header.append('score') | |
| 1331 data = read_csv(filename, delimiter = ' ', names = header) | 1333 data = read_csv(filename, delimiter = ' ', names = header) |
| 1332 data = data[data.trackingid > -1] | 1334 data = data[data.trackingid > -1] |
| 1333 | 1335 |
| 1334 objects = [] | 1336 objects = [] |
| 1335 featureNum = 0 | 1337 featureNum = 0 |
