comparison scripts/polytracktopdtv.py @ 1242:4cd8ace3552f

major update for classification, allowing the use of neural network classification
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 07 Feb 2024 11:43:03 -0500
parents 5654c9173548
children
comparison
equal deleted inserted replaced
1241:ab4c72b9475c 1242:4cd8ace3552f
23 '''Return a dictionnary with integer key and associated type string 23 '''Return a dictionnary with integer key and associated type string
24 i.e.: "0" -> "unknown" 24 i.e.: "0" -> "unknown"
25 "1" -> "car" 25 "1" -> "car"
26 "2" -> "pedestrians" 26 "2" -> "pedestrians"
27 "3" -> "motorcycle" 27 "3" -> "motorcycle"
28 "4" -> "bicycle" 28 "4" -> "cyclist"
29 "5" -> "bus" 29 "5" -> "bus"
30 "6" -> "truck" 30 "6" -> "truck"
31 ... and other type if the objects_type table is defined in SQLite''' 31 ... and other type if the objects_type table is defined in SQLite'''
32 typeDict = dict() 32 typeDict = dict()
33 cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='objects_type'") 33 cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='objects_type'")
36 if(data is None): 36 if(data is None):
37 typeDict["0"] = "unknown" 37 typeDict["0"] = "unknown"
38 typeDict["1"] = "car" 38 typeDict["1"] = "car"
39 typeDict["2"] = "pedestrians" 39 typeDict["2"] = "pedestrians"
40 typeDict["3"] = "motorcycle" 40 typeDict["3"] = "motorcycle"
41 typeDict["4"] = "bicycle" 41 typeDict["4"] = "cyclist"
42 typeDict["5"] = "bus" 42 typeDict["5"] = "bus"
43 typeDict["6"] = "truck" 43 typeDict["6"] = "truck"
44 44
45 else: 45 else:
46 cursor.execute("SELECT road_user_type, type_string FROM objects_type") 46 cursor.execute("SELECT road_user_type, type_string FROM objects_type")