weiyithu / SurroundOcc

[ICCV 2023] SurroundOcc: Multi-camera 3D Occupancy Prediction for Autonomous Driving
Apache License 2.0
772 stars 95 forks source link

How to get dense visualization about process_your_own_data.py? #66

Open Xpangz opened 1 year ago

Xpangz commented 1 year ago

Thanks for your excellent work! I used the data that you supplied for gt_generation_template, and ran process_your_own_data.py to generate the occ_gt_semantic files. The shape of these .npy files is (num_points, 3). I used visual.py to visualize the occupancy, but found that the visualization is sparse. I want to know how to get the visualization to be more dense? image

weiyithu commented 1 year ago

Hi, what's voxel size of your occupancy prediction? You should change the voxel_size in visual.py as yours.

weiyithu commented 1 year ago

If you visualize the occupancy groundtruth, you should set voxel size as 1 in visual.py since the distance between neighbored voxels is 1.

Xpangz commented 1 year ago

I understand. Thank you for your reply!

AlphaPlusTT commented 7 months ago

@weiyithu @Xpangz Hi there, why is the distance between neighboring voxels in the ground truth set to 1? Considering that the voxel_size is 0.5 during both the training and inference phases, does this imply that one ground truth label will be duplicated four times during the model training process?

AlphaPlusTT commented 7 months ago

1: 发现作者的回答并不是真正的原因,虽然groundtruthprediction的尺度不一致,比如说前者的一个维度是0-199步长是1,后者的一个维度是-49.75-49.75步长是0.5,但是在visual.py中的这个地方已经通过* voxel_size调整了步长: https://github.com/weiyithu/SurroundOcc/blob/f698d7968a60815067601776dabfca2a8b03500a/tools/visual.py#L43 并且在这里确定了调整步长后的尺度: https://github.com/weiyithu/SurroundOcc/blob/f698d7968a60815067601776dabfca2a8b03500a/tools/visual.py#L58 因此修复bug以后这里的voxel_size可以设置为任意值: https://github.com/weiyithu/SurroundOcc/blob/f698d7968a60815067601776dabfca2a8b03500a/tools/visual.py#L36 2: 这里之所以可视化的时候会出现“稀疏”的现象是因为groundtruth的数据类型是'int64',而这里取数组的一部分进行浮点运算无法改变原数组的数据类型: https://github.com/weiyithu/SurroundOcc/blob/f698d7968a60815067601776dabfca2a8b03500a/tools/visual.py#L43 举个例子: int((1+0.5)*0.5)=int(0.75)=0 然而作者的意图是想得到0.75,并不是得到0,所以才导致了可视化时“稀疏”的现象。 3: 修复的方法很简单,在下面的代码前面加上fov_voxels = fov_voxels.astype('float')即可: https://github.com/weiyithu/SurroundOcc/blob/f698d7968a60815067601776dabfca2a8b03500a/tools/visual.py#L43