You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

kitti_config.py 2.7 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import math
  2. import numpy as np
  3. # Car and Van ==> Car class
  4. # Pedestrian and Person_Sitting ==> Pedestrian Class
  5. # for train
  6. CLASS_NAME_TO_ID = {
  7. 'Pedestrian': 0,
  8. 'Car': 1,
  9. 'Cyclist': 2,
  10. 'Van': 1,
  11. 'Truck': -3,
  12. 'Person_sitting': 0,
  13. 'Tram': -99,
  14. 'Misc': -99,
  15. 'TraffiCone': -1,
  16. 'DontCare': -1
  17. }
  18. # for test
  19. CLASS_ID_TO_NAME = {
  20. 0: 'Pedestrian', # Person_sitting in the same class
  21. 1: 'Car', # Van in the same class
  22. 2: 'Cyclist'
  23. }
  24. colors = [[0, 255, 255], [0, 0, 255], [255, 0, 0], [255, 120, 0],
  25. [255, 120, 120], [0, 120, 0], [120, 255, 255], [120, 0, 255]]
  26. #####################################################################################
  27. boundary = {
  28. "minX": -50,
  29. "maxX": 50,
  30. "minY": -25,
  31. "maxY": 25,
  32. "minZ": -2.73,
  33. "maxZ": 1.27
  34. }
  35. bound_size_x = boundary['maxX'] - boundary['minX']
  36. bound_size_y = boundary['maxY'] - boundary['minY']
  37. bound_size_z = boundary['maxZ'] - boundary['minZ']
  38. boundary_back = {
  39. "minX": -50,
  40. "maxX": 0,
  41. "minY": -25,
  42. "maxY": 25,
  43. "minZ": -2.73,
  44. "maxZ": 1.27
  45. }
  46. BEV_WIDTH = 608 # across y axis -25m ~ 25m
  47. BEV_HEIGHT = 1216 # across x axis 0m ~ 50m
  48. DISCRETIZATION = (boundary["maxX"] - boundary["minX"]) / BEV_HEIGHT
  49. DISCRETIZATION_Y = (boundary["maxX"] - boundary["minX"]) / BEV_HEIGHT
  50. DISCRETIZATION_X = (boundary["maxY"] - boundary["minY"]) / BEV_WIDTH
  51. # maximum number of points per voxel
  52. T = 35
  53. # voxel size
  54. vd = 0.1 # z
  55. vh = 0.05 # y
  56. vw = 0.05 # x
  57. # voxel grid
  58. W = math.ceil(bound_size_x / vw)
  59. H = math.ceil(bound_size_y / vh)
  60. D = math.ceil(bound_size_z / vd)
  61. # Following parameters are calculated as an average from KITTI dataset for simplicity
  62. #####################################################################################
  63. Tr_velo_to_cam = np.array([
  64. [7.49916597e-03, -9.99971248e-01, -8.65110297e-04, -6.71807577e-03],
  65. [1.18652889e-02, 9.54520517e-04, -9.99910318e-01, -7.33152811e-02],
  66. [9.99882833e-01, 7.49141178e-03, 1.18719929e-02, -2.78557062e-01],
  67. [0, 0, 0, 1]
  68. ])
  69. # cal mean from train set
  70. R0 = np.array([
  71. [0.99992475, 0.00975976, -0.00734152, 0],
  72. [-0.0097913, 0.99994262, -0.00430371, 0],
  73. [0.00729911, 0.0043753, 0.99996319, 0],
  74. [0, 0, 0, 1]
  75. ])
  76. P2 = np.array([[719.787081, 0., 608.463003, 44.9538775],
  77. [0., 719.787081, 174.545111, 0.1066855],
  78. [0., 0., 1., 3.0106472e-03],
  79. [0., 0., 0., 0]
  80. ])
  81. R0_inv = np.linalg.inv(R0)
  82. Tr_velo_to_cam_inv = np.linalg.inv(Tr_velo_to_cam)
  83. P2_inv = np.linalg.pinv(P2)
  84. #####################################################################################

一站式算法开发平台、高性能分布式深度学习框架、先进算法模型库、视觉模型炼知平台、数据可视化分析平台等一系列平台及工具,在模型高效分布式训练、数据处理和可视分析、模型炼知和轻量化等技术上形成独特优势,目前已在产学研等各领域近千家单位及个人提供AI应用赋能