Unverified Commit d99dbce7 authored by Lum's avatar Lum Committed by GitHub
Browse files

Add typehint for code under `mmdet3d/models/backbones` (#2464)



* [Docs] Update link of registry tutorial (#2442)

Registry docs are now under Advanced Tutorials.

* add typehint to the backbones of model.

* Update typehint with OptMultiConfig and Tensor to torch.Tensor

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dla.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dla.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update mmdet3d/models/backbones/dgcnn.py
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>

* Update typehint.

* add typehint to function mono_cam_box2vis and remove assert keyword.

* Update typehint.

* Fixed some problems.

---------
Co-authored-by: default avatarpd-michaelstanley <88335018+pd-michaelstanley@users.noreply.github.com>
Co-authored-by: default avatarXiang Xu <xuxiang0103@gmail.com>
parent 52fe5baa
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import warnings import warnings
from abc import ABCMeta from abc import ABCMeta
from typing import Optional, Tuple
from mmengine.model import BaseModule from mmengine.model import BaseModule
from torch import Tensor
from mmdet3d.utils import OptMultiConfig
class BasePointNet(BaseModule, metaclass=ABCMeta): class BasePointNet(BaseModule, metaclass=ABCMeta):
"""Base class for PointNet.""" """Base class for PointNet."""
def __init__(self, init_cfg=None, pretrained=None): def __init__(self,
init_cfg: OptMultiConfig = None,
pretrained: Optional[str] = None):
super(BasePointNet, self).__init__(init_cfg) super(BasePointNet, self).__init__(init_cfg)
assert not (init_cfg and pretrained), \ assert not (init_cfg and pretrained), \
'init_cfg and pretrained cannot be setting at the same time' 'init_cfg and pretrained cannot be setting at the same time'
...@@ -18,7 +24,7 @@ class BasePointNet(BaseModule, metaclass=ABCMeta): ...@@ -18,7 +24,7 @@ class BasePointNet(BaseModule, metaclass=ABCMeta):
self.init_cfg = dict(type='Pretrained', checkpoint=pretrained) self.init_cfg = dict(type='Pretrained', checkpoint=pretrained)
@staticmethod @staticmethod
def _split_point_feats(points): def _split_point_feats(points: Tensor) -> Tuple[Tensor, Optional[Tensor]]:
"""Split coordinates and features of input points. """Split coordinates and features of input points.
Args: Args:
......
...@@ -13,6 +13,7 @@ from mmcv.cnn import build_activation_layer, build_norm_layer ...@@ -13,6 +13,7 @@ from mmcv.cnn import build_activation_layer, build_norm_layer
from mmcv.ops import (SparseConv3d, SparseConvTensor, SparseInverseConv3d, from mmcv.ops import (SparseConv3d, SparseConvTensor, SparseInverseConv3d,
SubMConv3d) SubMConv3d)
from mmengine.model import BaseModule from mmengine.model import BaseModule
from torch import Tensor
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType from mmdet3d.utils import ConfigType
...@@ -456,7 +457,7 @@ class Asymm3DSpconv(BaseModule): ...@@ -456,7 +457,7 @@ class Asymm3DSpconv(BaseModule):
indice_key='ddcm', indice_key='ddcm',
norm_cfg=norm_cfg) norm_cfg=norm_cfg)
def forward(self, voxel_features: torch.Tensor, coors: torch.Tensor, def forward(self, voxel_features: Tensor, coors: Tensor,
batch_size: int) -> SparseConvTensor: batch_size: int) -> SparseConvTensor:
"""Forward pass.""" """Forward pass."""
coors = coors.int() coors = coors.int()
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Sequence, Union
from mmengine.model import BaseModule from mmengine.model import BaseModule
from torch import Tensor
from torch import nn as nn from torch import nn as nn
from mmdet3d.models.layers import DGCNNFAModule, DGCNNGFModule from mmdet3d.models.layers import DGCNNFAModule, DGCNNGFModule
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType, OptMultiConfig
@MODELS.register_module() @MODELS.register_module()
...@@ -30,14 +34,15 @@ class DGCNNBackbone(BaseModule): ...@@ -30,14 +34,15 @@ class DGCNNBackbone(BaseModule):
""" """
def __init__(self, def __init__(self,
in_channels, in_channels: int,
num_samples=(20, 20, 20), num_samples: Sequence[int] = (20, 20, 20),
knn_modes=('D-KNN', 'F-KNN', 'F-KNN'), knn_modes: Sequence[str] = ('D-KNN', 'F-KNN', 'F-KNN'),
radius=(None, None, None), radius: Sequence[Union[float, None]] = (None, None, None),
gf_channels=((64, 64), (64, 64), (64, )), gf_channels: Sequence[Sequence[int]] = ((64, 64), (64, 64),
fa_channels=(1024, ), (64, )),
act_cfg=dict(type='ReLU'), fa_channels: Sequence[int] = (1024, ),
init_cfg=None): act_cfg: ConfigType = dict(type='ReLU'),
init_cfg: OptMultiConfig = None):
super().__init__(init_cfg=init_cfg) super().__init__(init_cfg=init_cfg)
self.num_gf = len(gf_channels) self.num_gf = len(gf_channels)
...@@ -71,7 +76,7 @@ class DGCNNBackbone(BaseModule): ...@@ -71,7 +76,7 @@ class DGCNNBackbone(BaseModule):
self.FA_module = DGCNNFAModule( self.FA_module = DGCNNFAModule(
mlp_channels=cur_fa_mlps, act_cfg=act_cfg) mlp_channels=cur_fa_mlps, act_cfg=act_cfg)
def forward(self, points): def forward(self, points: Tensor) -> dict:
"""Forward pass. """Forward pass.
Args: Args:
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import warnings import warnings
from typing import List, Optional, Sequence, Tuple
import torch import torch
from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.cnn import build_conv_layer, build_norm_layer
from mmengine.model import BaseModule from mmengine.model import BaseModule
from torch import nn from torch import Tensor, nn
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType, OptConfigType, OptMultiConfig
def dla_build_norm_layer(cfg, num_features): def dla_build_norm_layer(cfg: ConfigType,
num_features: int) -> Tuple[str, nn.Module]:
"""Build normalization layer specially designed for DLANet. """Build normalization layer specially designed for DLANet.
Args: Args:
...@@ -53,13 +56,13 @@ class BasicBlock(BaseModule): ...@@ -53,13 +56,13 @@ class BasicBlock(BaseModule):
""" """
def __init__(self, def __init__(self,
in_channels, in_channels: int,
out_channels, out_channels: int,
norm_cfg, norm_cfg: ConfigType,
conv_cfg, conv_cfg: ConfigType,
stride=1, stride: int = 1,
dilation=1, dilation: int = 1,
init_cfg=None): init_cfg: OptMultiConfig = None):
super(BasicBlock, self).__init__(init_cfg) super(BasicBlock, self).__init__(init_cfg)
self.conv1 = build_conv_layer( self.conv1 = build_conv_layer(
conv_cfg, conv_cfg,
...@@ -84,7 +87,7 @@ class BasicBlock(BaseModule): ...@@ -84,7 +87,7 @@ class BasicBlock(BaseModule):
self.norm2 = dla_build_norm_layer(norm_cfg, out_channels)[1] self.norm2 = dla_build_norm_layer(norm_cfg, out_channels)[1]
self.stride = stride self.stride = stride
def forward(self, x, identity=None): def forward(self, x: Tensor, identity: Optional[Tensor] = None) -> Tensor:
"""Forward function.""" """Forward function."""
if identity is None: if identity is None:
...@@ -117,13 +120,13 @@ class Root(BaseModule): ...@@ -117,13 +120,13 @@ class Root(BaseModule):
""" """
def __init__(self, def __init__(self,
in_channels, in_channels: int,
out_channels, out_channels: int,
norm_cfg, norm_cfg: ConfigType,
conv_cfg, conv_cfg: ConfigType,
kernel_size, kernel_size: int,
add_identity, add_identity: bool,
init_cfg=None): init_cfg: OptMultiConfig = None):
super(Root, self).__init__(init_cfg) super(Root, self).__init__(init_cfg)
self.conv = build_conv_layer( self.conv = build_conv_layer(
conv_cfg, conv_cfg,
...@@ -137,7 +140,7 @@ class Root(BaseModule): ...@@ -137,7 +140,7 @@ class Root(BaseModule):
self.relu = nn.ReLU(inplace=True) self.relu = nn.ReLU(inplace=True)
self.add_identity = add_identity self.add_identity = add_identity
def forward(self, feat_list): def forward(self, feat_list: List[Tensor]) -> Tensor:
"""Forward function. """Forward function.
Args: Args:
...@@ -181,19 +184,19 @@ class Tree(BaseModule): ...@@ -181,19 +184,19 @@ class Tree(BaseModule):
""" """
def __init__(self, def __init__(self,
levels, levels: int,
block, block: nn.Module,
in_channels, in_channels: int,
out_channels, out_channels: int,
norm_cfg, norm_cfg: ConfigType,
conv_cfg, conv_cfg: ConfigType,
stride=1, stride: int = 1,
level_root=False, level_root: bool = False,
root_dim=None, root_dim: Optional[int] = None,
root_kernel_size=1, root_kernel_size: int = 1,
dilation=1, dilation: int = 1,
add_identity=False, add_identity: bool = False,
init_cfg=None): init_cfg: OptMultiConfig = None):
super(Tree, self).__init__(init_cfg) super(Tree, self).__init__(init_cfg)
if root_dim is None: if root_dim is None:
root_dim = 2 * out_channels root_dim = 2 * out_channels
...@@ -258,7 +261,10 @@ class Tree(BaseModule): ...@@ -258,7 +261,10 @@ class Tree(BaseModule):
bias=False), bias=False),
dla_build_norm_layer(norm_cfg, out_channels)[1]) dla_build_norm_layer(norm_cfg, out_channels)[1])
def forward(self, x, identity=None, children=None): def forward(self,
x: Tensor,
identity: Optional[Tensor] = None,
children: Optional[List[Tensor]] = None) -> Tensor:
children = [] if children is None else children children = [] if children is None else children
bottom = self.downsample(x) if self.downsample else x bottom = self.downsample(x) if self.downsample else x
identity = self.project(bottom) if self.project else bottom identity = self.project(bottom) if self.project else bottom
...@@ -302,16 +308,17 @@ class DLANet(BaseModule): ...@@ -302,16 +308,17 @@ class DLANet(BaseModule):
} }
def __init__(self, def __init__(self,
depth, depth: int,
in_channels=3, in_channels: int = 3,
out_indices=(0, 1, 2, 3, 4, 5), out_indices: Sequence[int] = (0, 1, 2, 3, 4, 5),
frozen_stages=-1, frozen_stages: int = -1,
norm_cfg=None, norm_cfg: OptConfigType = None,
conv_cfg=None, conv_cfg: OptConfigType = None,
layer_with_level_root=(False, True, True, True), layer_with_level_root: Sequence[bool] = (False, True, True,
with_identity_root=False, True),
pretrained=None, with_identity_root: bool = False,
init_cfg=None): pretrained: Optional[str] = None,
init_cfg: OptMultiConfig = None):
super(DLANet, self).__init__(init_cfg) super(DLANet, self).__init__(init_cfg)
if depth not in self.arch_settings: if depth not in self.arch_settings:
raise KeyError(f'invalida depth {depth} for DLA') raise KeyError(f'invalida depth {depth} for DLA')
...@@ -380,13 +387,13 @@ class DLANet(BaseModule): ...@@ -380,13 +387,13 @@ class DLANet(BaseModule):
self._freeze_stages() self._freeze_stages()
def _make_conv_level(self, def _make_conv_level(self,
in_channels, in_channels: int,
out_channels, out_channels: int,
num_convs, num_convs: int,
norm_cfg, norm_cfg: ConfigType,
conv_cfg, conv_cfg: ConfigType,
stride=1, stride: int = 1,
dilation=1): dilation: int = 1) -> nn.Sequential:
"""Conv modules. """Conv modules.
Args: Args:
...@@ -418,7 +425,7 @@ class DLANet(BaseModule): ...@@ -418,7 +425,7 @@ class DLANet(BaseModule):
in_channels = out_channels in_channels = out_channels
return nn.Sequential(*modules) return nn.Sequential(*modules)
def _freeze_stages(self): def _freeze_stages(self) -> None:
if self.frozen_stages >= 0: if self.frozen_stages >= 0:
self.base_layer.eval() self.base_layer.eval()
for param in self.base_layer.parameters(): for param in self.base_layer.parameters():
...@@ -436,7 +443,7 @@ class DLANet(BaseModule): ...@@ -436,7 +443,7 @@ class DLANet(BaseModule):
for param in m.parameters(): for param in m.parameters():
param.requires_grad = False param.requires_grad = False
def forward(self, x): def forward(self, x: Tensor) -> Tuple[Tensor, ...]:
outs = [] outs = []
x = self.base_layer(x) x = self.base_layer(x)
for i in range(self.num_levels): for i in range(self.num_levels):
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import copy import copy
import warnings import warnings
from typing import Dict, List, Optional, Sequence, Tuple, Union
import torch import torch
from mmcv.cnn import ConvModule from mmcv.cnn import ConvModule
from mmengine.model import BaseModule from mmengine.model import BaseModule
from torch import nn as nn from torch import Tensor, nn
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType, OptMultiConfig
@MODELS.register_module() @MODELS.register_module()
...@@ -27,16 +29,17 @@ class MultiBackbone(BaseModule): ...@@ -27,16 +29,17 @@ class MultiBackbone(BaseModule):
""" """
def __init__(self, def __init__(self,
num_streams, num_streams: int,
backbones, backbones: Union[List[dict], Dict],
aggregation_mlp_channels=None, aggregation_mlp_channels: Optional[Sequence[int]] = None,
conv_cfg=dict(type='Conv1d'), conv_cfg: ConfigType = dict(type='Conv1d'),
norm_cfg=dict(type='BN1d', eps=1e-5, momentum=0.01), norm_cfg: ConfigType = dict(
act_cfg=dict(type='ReLU'), type='BN1d', eps=1e-5, momentum=0.01),
suffixes=('net0', 'net1'), act_cfg: ConfigType = dict(type='ReLU'),
init_cfg=None, suffixes: Tuple[str] = ('net0', 'net1'),
pretrained=None, init_cfg: OptMultiConfig = None,
**kwargs): pretrained: Optional[str] = None,
**kwargs) -> None:
super().__init__(init_cfg=init_cfg) super().__init__(init_cfg=init_cfg)
assert isinstance(backbones, dict) or isinstance(backbones, list) assert isinstance(backbones, dict) or isinstance(backbones, list)
if isinstance(backbones, dict): if isinstance(backbones, dict):
...@@ -89,7 +92,7 @@ class MultiBackbone(BaseModule): ...@@ -89,7 +92,7 @@ class MultiBackbone(BaseModule):
'please use "init_cfg" instead') 'please use "init_cfg" instead')
self.init_cfg = dict(type='Pretrained', checkpoint=pretrained) self.init_cfg = dict(type='Pretrained', checkpoint=pretrained)
def forward(self, points): def forward(self, points: Tensor) -> dict:
"""Forward pass. """Forward pass.
Args: Args:
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple
import torch.nn as nn
from mmdet.models.backbones import RegNet from mmdet.models.backbones import RegNet
from torch import Tensor
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import OptMultiConfig
@MODELS.register_module() @MODELS.register_module()
...@@ -59,15 +64,19 @@ class NoStemRegNet(RegNet): ...@@ -59,15 +64,19 @@ class NoStemRegNet(RegNet):
(1, 1008, 1, 1) (1, 1008, 1, 1)
""" """
def __init__(self, arch, init_cfg=None, **kwargs): def __init__(self,
arch: dict,
init_cfg: OptMultiConfig = None,
**kwargs) -> None:
super(NoStemRegNet, self).__init__(arch, init_cfg=init_cfg, **kwargs) super(NoStemRegNet, self).__init__(arch, init_cfg=init_cfg, **kwargs)
def _make_stem_layer(self, in_channels, base_channels): def _make_stem_layer(self, in_channels: int,
base_channels: int) -> nn.Module:
"""Override the original function that do not initialize a stem layer """Override the original function that do not initialize a stem layer
since 3D detector's voxel encoder works like a stem layer.""" since 3D detector's voxel encoder works like a stem layer."""
return return
def forward(self, x): def forward(self, x: Tensor) -> Tuple[Tensor, ...]:
"""Forward function of backbone. """Forward function of backbone.
Args: Args:
......
...@@ -3,7 +3,7 @@ from typing import Tuple ...@@ -3,7 +3,7 @@ from typing import Tuple
import torch import torch
from mmcv.cnn import ConvModule from mmcv.cnn import ConvModule
from torch import nn as nn from torch import Tensor, nn
from mmdet3d.models.layers.pointnet_modules import build_sa_module from mmdet3d.models.layers.pointnet_modules import build_sa_module
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
...@@ -141,7 +141,7 @@ class PointNet2SAMSG(BasePointNet): ...@@ -141,7 +141,7 @@ class PointNet2SAMSG(BasePointNet):
bias=True)) bias=True))
sa_in_channel = cur_aggregation_channel sa_in_channel = cur_aggregation_channel
def forward(self, points: torch.Tensor): def forward(self, points: Tensor):
"""Forward pass. """Forward pass.
Args: Args:
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
from typing import Dict, List, Sequence
import torch import torch
from torch import nn as nn from torch import Tensor, nn
from mmdet3d.models.layers import PointFPModule, build_sa_module from mmdet3d.models.layers import PointFPModule, build_sa_module
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType, OptMultiConfig
from .base_pointnet import BasePointNet from .base_pointnet import BasePointNet
...@@ -31,20 +34,23 @@ class PointNet2SASSG(BasePointNet): ...@@ -31,20 +34,23 @@ class PointNet2SASSG(BasePointNet):
""" """
def __init__(self, def __init__(self,
in_channels, in_channels: int,
num_points=(2048, 1024, 512, 256), num_points: Sequence[int] = (2048, 1024, 512, 256),
radius=(0.2, 0.4, 0.8, 1.2), radius: Sequence[float] = (0.2, 0.4, 0.8, 1.2),
num_samples=(64, 32, 16, 16), num_samples: Sequence[int] = (64, 32, 16, 16),
sa_channels=((64, 64, 128), (128, 128, 256), (128, 128, 256), sa_channels: Sequence[Sequence[int]] = ((64, 64, 128),
(128, 128, 256)), (128, 128, 256),
fp_channels=((256, 256), (256, 256)), (128, 128, 256),
norm_cfg=dict(type='BN2d'), (128, 128, 256)),
sa_cfg=dict( fp_channels: Sequence[Sequence[int]] = ((256, 256), (256,
256)),
norm_cfg: ConfigType = dict(type='BN2d'),
sa_cfg: ConfigType = dict(
type='PointSAModule', type='PointSAModule',
pool_mod='max', pool_mod='max',
use_xyz=True, use_xyz=True,
normalize_xyz=True), normalize_xyz=True),
init_cfg=None): init_cfg: OptMultiConfig = None):
super().__init__(init_cfg=init_cfg) super().__init__(init_cfg=init_cfg)
self.num_sa = len(sa_channels) self.num_sa = len(sa_channels)
self.num_fp = len(fp_channels) self.num_fp = len(fp_channels)
...@@ -85,7 +91,7 @@ class PointNet2SASSG(BasePointNet): ...@@ -85,7 +91,7 @@ class PointNet2SASSG(BasePointNet):
fp_source_channel = cur_fp_mlps[-1] fp_source_channel = cur_fp_mlps[-1]
fp_target_channel = skip_channel_list.pop() fp_target_channel = skip_channel_list.pop()
def forward(self, points): def forward(self, points: Tensor) -> Dict[str, List[Tensor]]:
"""Forward pass. """Forward pass.
Args: Args:
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import warnings import warnings
from typing import Optional, Sequence, Tuple
from mmcv.cnn import build_conv_layer, build_norm_layer from mmcv.cnn import build_conv_layer, build_norm_layer
from mmengine.model import BaseModule from mmengine.model import BaseModule
from torch import Tensor
from torch import nn as nn from torch import nn as nn
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType, OptMultiConfig
@MODELS.register_module() @MODELS.register_module()
...@@ -22,14 +25,15 @@ class SECOND(BaseModule): ...@@ -22,14 +25,15 @@ class SECOND(BaseModule):
""" """
def __init__(self, def __init__(self,
in_channels=128, in_channels: int = 128,
out_channels=[128, 128, 256], out_channels: Sequence[int] = [128, 128, 256],
layer_nums=[3, 5, 5], layer_nums: Sequence[int] = [3, 5, 5],
layer_strides=[2, 2, 2], layer_strides: Sequence[int] = [2, 2, 2],
norm_cfg=dict(type='BN', eps=1e-3, momentum=0.01), norm_cfg: ConfigType = dict(
conv_cfg=dict(type='Conv2d', bias=False), type='BN', eps=1e-3, momentum=0.01),
init_cfg=None, conv_cfg: ConfigType = dict(type='Conv2d', bias=False),
pretrained=None): init_cfg: OptMultiConfig = None,
pretrained: Optional[str] = None) -> None:
super(SECOND, self).__init__(init_cfg=init_cfg) super(SECOND, self).__init__(init_cfg=init_cfg)
assert len(layer_strides) == len(layer_nums) assert len(layer_strides) == len(layer_nums)
assert len(out_channels) == len(layer_nums) assert len(out_channels) == len(layer_nums)
...@@ -75,7 +79,7 @@ class SECOND(BaseModule): ...@@ -75,7 +79,7 @@ class SECOND(BaseModule):
else: else:
self.init_cfg = dict(type='Kaiming', layer='Conv2d') self.init_cfg = dict(type='Kaiming', layer='Conv2d')
def forward(self, x): def forward(self, x: Tensor) -> Tuple[Tensor, ...]:
"""Forward function. """Forward function.
Args: Args:
......
...@@ -285,7 +285,6 @@ def mono_cam_box2vis(cam_box): ...@@ -285,7 +285,6 @@ def mono_cam_box2vis(cam_box):
from .cam_box3d import CameraInstance3DBoxes from .cam_box3d import CameraInstance3DBoxes
assert isinstance(cam_box, CameraInstance3DBoxes), \ assert isinstance(cam_box, CameraInstance3DBoxes), \
'input bbox should be CameraInstance3DBoxes!' 'input bbox should be CameraInstance3DBoxes!'
loc = cam_box.gravity_center loc = cam_box.gravity_center
dim = cam_box.dims dim = cam_box.dims
yaw = cam_box.yaw yaw = cam_box.yaw
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment