tusen-ai / SST

Code for a series of work in LiDAR perception, including SST (CVPR 22), FSD (NeurIPS 22), FSD++ (TPAMI 23), FSDv2, and CTRL (ICCV 23, oral).
Apache License 2.0
788 stars 100 forks source link

What is the goal of IngroupIndicesFunction? #182

Open ArseniuML opened 8 months ago

ArseniuML commented 8 months ago

As I can see, IngroupIndicesFunction from sst_ops.py is a random number generator. Why do you use it? I can imagine, that RNG can be useful for training, but you use it in the inference code...

I replaced

if len(torch.unique(batch_idx[fg_mask])) < batch_size:
    one_random_pos_per_sample = self.get_sample_beg_position(batch_idx, fg_mask)
    fg_mask[one_random_pos_per_sample] = True # at least one point per sample

to

if len(torch.unique(batch_idx[fg_mask])) < batch_size:
    one_random_pos_per_sample = 0
    fg_mask[one_random_pos_per_sample] = True # at least one point per sample

and inference results (FSDv2 with Argo2 config) seems to be identical (batch index is always 0 in my case).

Abyssaledge commented 8 months ago

It is designed to create a fake foreground point at the start position of each sample. So, if the inference batch_size is 1, they are the same.