skyhehe123 / VoxelNet-pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

locally aggregated feature and mask

jiangwei221 opened this issue · comments

Hi:
Thanks for sharing this project!
I'm trying to understand one function:

class VFE(nn.Module):
def __init__(self,cin,cout):
super(VFE, self).__init__()
assert cout % 2 == 0
self.units = cout // 2
self.fcn = FCN(cin,self.units)
def forward(self, x, mask):
# point-wise feauture
pwf = self.fcn(x)
#locally aggregated feature
laf = torch.max(pwf,1)[0].unsqueeze(1).repeat(1,cfg.T,1)
# point-wise concat feature
pwcf = torch.cat((pwf,laf),dim=2)
# apply mask
mask = mask.unsqueeze(2).repeat(1, 1, self.units * 2)
pwcf = pwcf * mask.float()
return pwcf

Especially:

#locally aggregated feature
laf = torch.max(pwf,1)[0].unsqueeze(1).repeat(1,cfg.T,1)

The mask is not used for generating the locally aggregated feature. This may cause the local feature is consisted of (0,0,0) points.

For example, if an input is in shape (B, C, N), where B is the batch size, C is the number of channel, N is the number of the points. And the first half part of N are all negative values, and the second half is empty, which represented as (0,0,0). The locally aggregated feature which in shape (B, C, 1), after max operation should be all zeros, which is wrong I think.

Bests,