Skip to content

Commit 43a046c

Browse files
author
Cuong Ngo
committed
Add discretization option for both width & height
1 parent 1987a3a commit 43a046c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/config/kitti_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
BEV_WIDTH = 608 # across y axis -25m ~ 25m
3434
BEV_HEIGHT = 608 # across x axis 0m ~ 50m
3535

36-
DISCRETIZATION = (boundary["maxX"] - boundary["minX"]) / BEV_HEIGHT
36+
DISCRETIZATION_X = (boundary["maxX"] - boundary["minX"]) / BEV_HEIGHT
37+
DISCRETIZATION_Y = (boundary["maxY"] - boundary["minY"]) / BEV_WIDTH
3738

3839
colors = [[0, 255, 255], [0, 0, 255], [255, 0, 0]]
3940

src/data_process/kitti_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def load_img_only(self, index):
7979
sample_id = int(self.sample_id_list[index])
8080
lidarData = self.get_lidar(sample_id)
8181
b = kitti_bev_utils.removePoints(lidarData, cnf.boundary)
82-
rgb_map = kitti_bev_utils.makeBVFeature(b, cnf.DISCRETIZATION, cnf.boundary)
82+
rgb_map = kitti_bev_utils.makeBVFeature(b, cnf.DISCRETIZATION_X, cnf.DISCRETIZATION_Y, cnf.boundary)
8383
img_file = os.path.join(self.image_dir, '{:06d}.png'.format(sample_id))
8484

8585
return img_file, rgb_map
@@ -103,7 +103,7 @@ def load_img_with_targets(self, index):
103103
lidarData, labels[:, 1:] = self.lidar_transforms(lidarData, labels[:, 1:])
104104

105105
b = kitti_bev_utils.removePoints(lidarData, cnf.boundary)
106-
rgb_map = kitti_bev_utils.makeBVFeature(b, cnf.DISCRETIZATION, cnf.boundary)
106+
rgb_map = kitti_bev_utils.makeBVFeature(b, cnf.DISCRETIZATION_X, cnf.DISCRETIZATION_Y, cnf.boundary)
107107
target = kitti_bev_utils.build_yolo_target(labels)
108108
img_file = os.path.join(self.image_dir, '{:06d}.png'.format(sample_id))
109109

0 commit comments

Comments
 (0)