MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / PointNet

Class PointNet

src/shape_assembly/models/train/pose_estimator.py:5–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import torch.nn.functional as F
4
5class PointNet(nn.Module):
6 def __init__(self, out_channels=(32, 64, 128), train_with_norm=True):
7 super(PointNet, self).__init__()
8 self.layers = nn.ModuleList()
9 in_channels = 3
10 for out_channel in out_channels:
11 self.layers.append(nn.Conv1d(in_channels, out_channel, 1))
12 self.layers.append(nn.BatchNorm1d(out_channel) if train_with_norm else nn.Identity())
13 self.layers.append(nn.ReLU())
14 in_channels = out_channel
15 self.global_pool = nn.AdaptiveMaxPool1d(1)
16
17 def forward(self, x):
18 for layer in self.layers:
19 x = layer(x)
20 x = self.global_pool(x)
21 x = x.squeeze(-1)
22 return x
23
24class PoseClassifier(nn.Module):
25 def __init__(self, pointnet_out_dim=128, pose_dim=6, hidden_dims=(512, 256, 128)):

Callers 4

init_encoderMethod · 0.85
init_encoderMethod · 0.85
init_encoderMethod · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected