def forward(self, x, input_pts, return_features=False): # x1, pts1 = self.cv1(x, input_pts, 16, 2048) # x1 = F.relu(apply_bn(x1, self.bn1)) x2, pts2 = self.cv2(x, input_pts, 16, 1024) x2 = F.relu(apply_bn(x2, self.bn2)) x3, pts3 = self.cv3(x2, pts2, 16, 256) x3 = F.relu(apply_bn(x3, self.bn3)) x4, pts4 = self.cv4(x3, pts3, 8, 64) x4 = F.relu(apply_bn(x4, self.bn4)) x5, pts5 = self.cv5(x4, pts4, 8, 16) x5 = F.relu(apply_bn(x5, self.bn5)) x6, pts6 = self.cv6(x5, pts5, 4, 8) x6 = F.relu(apply_bn(x6, self.bn6)) x5d, _ = self.cv5d(x6, pts6, 4, pts5) x5d = F.relu(apply_bn(x5d, self.bn5d)) x5d = torch.cat([x5d, x5], dim=2) x4d, _ = self.cv4d(x5d, pts5, 4, pts4) x4d = F.relu(apply_bn(x4d, self.bn4d)) x4d = torch.cat([x4d, x4], dim=2) x3d, _ = self.cv3d(x4d, pts4, 4, pts3) x3d = F.relu(apply_bn(x3d, self.bn3d)) x3d = torch.cat([x3d, x3], dim=2) x2d, _ = self.cv2d(x3d, pts3, 8, pts2) x2d = F.relu(apply_bn(x2d, self.bn2d)) x2d = torch.cat([x2d, x2], dim=2) x1d, _ = self.cv1d(x2d, pts2, 8, input_pts) x1d = F.relu(apply_bn(x1d, self.bn1d)) # x1d = torch.cat([x1d, x1], dim=2) # x0d, _ = self.cv0d(x1d, pts1, 8, input_pts) # x0d = F.relu(apply_bn(x0d, self.bn0d)) xout = x1d xout = xout.view(-1, xout.size(2)) xout = self.drop(xout) xout = self.fcout(xout) xout = xout.view(x.size(0), -1, xout.size(1)) if return_features: return xout, x0d else: return xout
def forward(self, out1, out2, features1, features2, input_pts): x = torch.cat([features1, features2], dim=2) x1, _ = self.cv1(x, input_pts, 16, input_pts.size(1)) x1 = F.relu(apply_bn(x1, self.bn1)) x2, pts2 = self.cv2(x1, input_pts, 16, input_pts.size(1)) x2 = F.relu(apply_bn(x2, self.bn2)) xout = x2 xout = torch.cat([xout, out1, out2], dim=2) xout = xout.view(-1, xout.size(2)) xou = self.drop(xout) xout = self.fcout(xout) xout = xout.view(x.size(0), -1, xout.size(1)) # return xout + out1 + out2 return xout #+ out1 + out2
def forward(self, x, input_pts): x1, pts1 = self.cv1(x, input_pts, 32, 1024) x1 = self.relu(apply_bn(x1, self.bn1)) x2, pts2 = self.cv2(x1, pts1, 32, 256) x2 = self.relu(apply_bn(x2, self.bn2)) x3, pts3 = self.cv3(x2, pts2, 16, 64) x3 = self.relu(apply_bn(x3, self.bn3)) x4, pts4 = self.cv4(x3, pts3, 16, 16) x4 = self.relu(apply_bn(x4, self.bn4)) x5, _ = self.cv5(x4, pts4, 16, 1) x5 = self.relu(apply_bn(x5, self.bn5)) xout = x5.view(x5.size(0), -1) xout = self.dropout(xout) xout = self.fcout(xout) return xout