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

Method forward

src/shape_assembly/models/train/pose_estimator.py:37–54  ·  view source on GitHub ↗
(self, point_cloud, poses)

Source from the content-addressed store, hash-verified

35 self.classifier = nn.Sequential(*layers)
36
37 def forward(self, point_cloud, poses):
38 # Point cloud feature extraction
39 point_cloud_features = self.pointnet(point_cloud) # (batch_size, pointnet_out_dim)
40
41 # Repeat point cloud features for each pose
42 repeated_features = point_cloud_features.unsqueeze(1).repeat(1, poses.size(1), 1) # (batch_size, num_poses, pointnet_out_dim)
43
44 # Concatenate pose features with point cloud features
45 combined_features = torch.cat((repeated_features, poses), dim=-1) # (batch_size, num_poses, pointnet_out_dim + pose_dim)
46
47 # Flatten the input for the classifier
48 combined_features = combined_features.view(-1, combined_features.size(-1)) # (batch_size * num_poses, pointnet_out_dim + pose_dim)
49
50 # Classification
51 scores = self.classifier(combined_features) # (batch_size * num_poses, 1)
52 scores = scores.view(-1, poses.size(1)) # (batch_size, num_poses)
53
54 return scores
55
56
57batch_size = 8

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected