Vote module. Generate votes from seed point features. Args: in_channels (int): Number of channels of seed point features. vote_per_seed (int): Number of votes generated from each seed point. gt_per_seed (int): Number of ground truth votes generated from
| 7 | |
| 8 | |
| 9 | class VoteModule(nn.Module): |
| 10 | """Vote module. |
| 11 | |
| 12 | Generate votes from seed point features. |
| 13 | |
| 14 | Args: |
| 15 | in_channels (int): Number of channels of seed point features. |
| 16 | vote_per_seed (int): Number of votes generated from each seed point. |
| 17 | gt_per_seed (int): Number of ground truth votes generated |
| 18 | from each seed point. |
| 19 | num_points (int): Number of points to be used for voting. |
| 20 | conv_channels (tuple[int]): Out channels of vote |
| 21 | generating convolution. |
| 22 | conv_cfg (dict): Config of convolution. |
| 23 | Default: dict(type='Conv1d'). |
| 24 | norm_cfg (dict): Config of normalization. |
| 25 | Default: dict(type='BN1d'). |
| 26 | norm_feats (bool): Whether to normalize features. |
| 27 | Default: True. |
| 28 | with_res_feat (bool): Whether to predict residual features. |
| 29 | Default: True. |
| 30 | vote_xyz_range (list[float], None): The range of points translation. |
| 31 | vote_loss (dict): Config of vote loss. |
| 32 | """ |
| 33 | |
| 34 | def __init__(self, |
| 35 | in_channels, |
| 36 | vote_per_seed=1, |
| 37 | gt_per_seed=3, |
| 38 | num_points=-1, |
| 39 | conv_channels=(16, 16), |
| 40 | conv_cfg=dict(type='Conv1d'), |
| 41 | norm_cfg=dict(type='BN1d'), |
| 42 | act_cfg=dict(type='ReLU'), |
| 43 | norm_feats=True, |
| 44 | with_res_feat=True, |
| 45 | vote_xyz_range=None, |
| 46 | vote_loss=None): |
| 47 | super().__init__() |
| 48 | self.in_channels = in_channels |
| 49 | self.vote_per_seed = vote_per_seed |
| 50 | self.gt_per_seed = gt_per_seed |
| 51 | self.num_points = num_points |
| 52 | self.norm_feats = norm_feats |
| 53 | self.with_res_feat = with_res_feat |
| 54 | |
| 55 | assert vote_xyz_range is None or is_tuple_of(vote_xyz_range, float) |
| 56 | self.vote_xyz_range = vote_xyz_range |
| 57 | |
| 58 | if vote_loss is not None: |
| 59 | self.vote_loss = build_loss(vote_loss) |
| 60 | |
| 61 | prev_channels = in_channels |
| 62 | vote_conv_list = list() |
| 63 | for k in range(len(conv_channels)): |
| 64 | vote_conv_list.append( |
| 65 | ConvModule( |
| 66 | prev_channels, |
no outgoing calls