Modified from `https://github.com/nv-tlabs/lift-splat-shoot`. Args: x_bound (list): Boundaries for x. y_bound (list): Boundaries for y. z_bound (list): Boundaries for z. d_bound (list): Boundaries for d. final_dim (list): Dimension
(self, x_bound, y_bound, z_bound, d_bound, final_dim,
downsample_factor, output_channels, img_backbone_conf,
img_neck_conf, depth_net_conf, seg_net_conf=None, queue_len=1, fpn_in_channels=[64, 128, 256, 512])
| 353 | @BACKBONES.register_module() |
| 354 | class LSS(BaseModule): |
| 355 | def __init__(self, x_bound, y_bound, z_bound, d_bound, final_dim, |
| 356 | downsample_factor, output_channels, img_backbone_conf, |
| 357 | img_neck_conf, depth_net_conf, seg_net_conf=None, queue_len=1, fpn_in_channels=[64, 128, 256, 512]): |
| 358 | """Modified from `https://github.com/nv-tlabs/lift-splat-shoot`. |
| 359 | Args: |
| 360 | x_bound (list): Boundaries for x. |
| 361 | y_bound (list): Boundaries for y. |
| 362 | z_bound (list): Boundaries for z. |
| 363 | d_bound (list): Boundaries for d. |
| 364 | final_dim (list): Dimension for input images. |
| 365 | downsample_factor (int): Downsample factor between feature map |
| 366 | and input image. |
| 367 | output_channels (int): Number of channels for the output |
| 368 | feature map. |
| 369 | img_backbone_conf (dict): Config for image backbone. |
| 370 | img_neck_conf (dict): Config for image neck. |
| 371 | depth_net_conf (dict): Config for depth net. |
| 372 | """ |
| 373 | |
| 374 | super(LSS, self).__init__() |
| 375 | self.downsample_factor = downsample_factor |
| 376 | self.fp16_enabled = False |
| 377 | self.d_bound = d_bound |
| 378 | self.final_dim = final_dim |
| 379 | self.output_channels = output_channels |
| 380 | self.queue_len = queue_len |
| 381 | if self.queue_len!=1: |
| 382 | self.bev_multiframe_merge = nn.Conv2d(output_channels*queue_len, |
| 383 | output_channels, |
| 384 | kernel_size=3, |
| 385 | stride=1, |
| 386 | padding=1, |
| 387 | bias=False) |
| 388 | self.register_buffer( |
| 389 | 'voxel_size', |
| 390 | torch.Tensor([row[2] for row in [x_bound, y_bound, z_bound]])) |
| 391 | self.register_buffer( |
| 392 | 'voxel_coord', |
| 393 | torch.Tensor([ |
| 394 | row[0] + row[2] / 2.0 for row in [x_bound, y_bound, z_bound] |
| 395 | ])) |
| 396 | self.register_buffer( |
| 397 | 'voxel_num', |
| 398 | torch.LongTensor([(row[1] - row[0]) / row[2] |
| 399 | for row in [x_bound, y_bound, z_bound]])) |
| 400 | self.register_buffer('frustum', self.create_frustum()) |
| 401 | self.depth_channels, _, _, _ = self.frustum.shape |
| 402 | |
| 403 | self.img_backbone = build_backbone(img_backbone_conf) |
| 404 | self.img_neck = build_neck(img_neck_conf) |
| 405 | self.neck_conv = nn.Conv2d(in_channels=img_neck_conf["out_channels"], out_channels=depth_net_conf["in_channels"], kernel_size=1) |
| 406 | self.depth_net = self._configure_depth_net(depth_net_conf) |
| 407 | |
| 408 | |
| 409 | self.seg_net = self._configure_seg_net(seg_net_conf, fpn_in_channels) |
| 410 | |
| 411 | self.seg_res_to_image_feature =nn.Sequential( |
| 412 | nn.Conv2d(seg_net_conf['out_channels'], 64, 1), |
nothing calls this directly
no test coverage detected