SurroundOcc icon indicating copy to clipboard operation
SurroundOcc copied to clipboard

How to get dense visualization about process_your_own_data.py?

Open Xpangz opened this issue 2 years ago • 6 comments

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

Xpangz avatar Aug 03 '23 10:08 Xpangz

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

weiyithu avatar Aug 04 '23 08:08 weiyithu

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

weiyithu avatar Aug 09 '23 13:08 weiyithu

I understand. Thank you for your reply!

Xpangz avatar Aug 10 '23 01:08 Xpangz

@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 avatar Jan 13 '24 08:01 AlphaPlusTT

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

AlphaPlusTT avatar Jan 14 '24 16:01 AlphaPlusTT