"examples/pytorch/hilander/dataset/__init__.py" did not exist on "66ad774f9eb7cbbb18b1c98f4abce43c2fb63170"
Commit ec84da2b authored by zhangwenwei's avatar zhangwenwei
Browse files

Merge branch 'refine_docstrings' into 'master'

Refine mmdet3d docstrings

See merge request open-mmlab/mmdet.3d!135
parents a05dff6f b27919fc
......@@ -14,12 +14,12 @@ def chamfer_distance(src,
"""Calculate Chamfer Distance of two sets.
Args:
src (Tensor): Source set with shape [B, N, C] to
src (torch.Tensor): Source set with shape [B, N, C] to
calculate Chamfer Distance.
dst (Tensor): Destination set with shape [B, M, C] to
dst (torch.Tensor): Destination set with shape [B, M, C] to
calculate Chamfer Distance.
src_weight (Tensor or float): Weight of source loss.
dst_weight (Tensor or float): Weight of destination loss.
src_weight (torch.Tensor or float): Weight of source loss.
dst_weight (torch.Tensor or float): Weight of destination loss.
criterion_mode (str): Criterion mode to calculate distance.
The valid modes are smooth_l1, l1 or l2.
reduction (str): Method to reduce losses.
......@@ -27,12 +27,14 @@ def chamfer_distance(src,
Returns:
tuple: Source and Destination loss with indices.
- loss_src (Tensor): The min distance from source to destination.
- loss_dst (Tensor): The min distance from destination to source.
- indices1 (Tensor): Index the min distance point for each point
in source to destination.
- indices2 (Tensor): Index the min distance point for each point
in destination to source.
- loss_src (torch.Tensor): The min distance
from source to destination.
- loss_dst (torch.Tensor): The min distance
from destination to source.
- indices1 (torch.Tensor): Index the min distance point
for each point in source to destination.
- indices2 (torch.Tensor): Index the min distance point
for each point in destination to source.
"""
if criterion_mode == 'smooth_l1':
......@@ -106,14 +108,14 @@ class ChamferDistance(nn.Module):
"""Forward function of loss calculation.
Args:
source (Tensor): Source set with shape [B, N, C] to
source (torch.Tensor): Source set with shape [B, N, C] to
calculate Chamfer Distance.
target (Tensor): Destination set with shape [B, M, C] to
target (torch.Tensor): Destination set with shape [B, M, C] to
calculate Chamfer Distance.
src_weight (Tensor | float, optional): Weight of source loss.
Defaults to 1.0.
dst_weight (Tensor | float, optional): Weight of destination loss.
Defaults to 1.0.
src_weight (torch.Tensor | float, optional):
Weight of source loss. Defaults to 1.0.
dst_weight (torch.Tensor | float, optional):
Weight of destination loss. Defaults to 1.0.
reduction_override (str, optional): Method to reduce losses.
The valid reduction method are 'none', 'sum' or 'mean'.
Defaults to None.
......
......@@ -147,14 +147,14 @@ class SparseUNet(nn.Module):
"""Forward of upsample and residual block.
Args:
x_lateral (SparseConvTensor): lateral tensor
x_bottom (SparseConvTensor): feature from bottom layer
x_lateral (:obj:`SparseConvTensor`): lateral tensor
x_bottom (:obj:`SparseConvTensor`): feature from bottom layer
lateral_layer (SparseBasicBlock): convolution for lateral tensor
merge_layer (SparseSequential): convolution for merging features
upsample_layer (SparseSequential): convolution for upsampling
Returns:
SparseConvTensor: upsampled feature
:obj:`SparseConvTensor`: upsampled feature
"""
x = lateral_layer(x_lateral)
x.features = torch.cat((x_bottom.features, x.features), dim=1)
......@@ -169,11 +169,11 @@ class SparseUNet(nn.Module):
"""reduce channel for element-wise addition.
Args:
x (SparseConvTensor): x.features (N, C1)
x (:obj:`SparseConvTensor`): x.features (N, C1)
out_channels (int): the number of channel after reduction
Returns:
SparseConvTensor: channel reduced feature
:obj:`SparseConvTensor`: channel reduced feature
"""
features = x.features
n, in_channels = features.shape
......
......@@ -66,11 +66,13 @@ class VoteModule(nn.Module):
"""forward.
Args:
seed_points (Tensor): (B, N, 3) coordinate of the seed points.
seed_feats (Tensor): (B, C, N) features of the seed points.
seed_points (torch.Tensor): (B, N, 3) coordinate of the seed
points.
seed_feats (torch.Tensor): (B, C, N) features of the seed points.
Returns:
tuple[Tensor]:
tuple[torch.Tensor]:
- vote_points: Voted xyz based on the seed points
with shape (B, M, 3) M=num_seed*vote_per_seed.
- vote_features: Voted features based on the seed points with
......@@ -106,14 +108,14 @@ class VoteModule(nn.Module):
"""Calculate loss of voting module.
Args:
seed_points (Tensor): coordinate of the seed points.
vote_points (Tensor): coordinate of the vote points.
seed_indices (Tensor): indices of seed points in raw points.
vote_targets_mask (Tensor): mask of valid vote targets.
vote_targets (Tensor): targets of votes.
seed_points (torch.Tensor): coordinate of the seed points.
vote_points (torch.Tensor): coordinate of the vote points.
seed_indices (torch.Tensor): indices of seed points in raw points.
vote_targets_mask (torch.Tensor): mask of valid vote targets.
vote_targets (torch.Tensor): targets of votes.
Returns:
Tensor: weighted vote loss.
torch.Tensor: weighted vote loss.
"""
batch_size, num_seed = seed_points.shape[:2]
......
......@@ -37,7 +37,7 @@ class PartA2BboxHead(nn.Module):
regression layers.
roi_feat_size (int): The size of pooled roi features.
with_corner_loss (bool): Whether to use corner loss or not.
bbox_coder (BaseBBoxCoder): Bbox coder for box head.
bbox_coder (:obj:`BaseBBoxCoder`): Bbox coder for box head.
conv_cfg (dict): Config dict of convolutional layers
norm_cfg (dict): Config dict of normalization layers
loss_bbox (dict): Config dict of box regression loss.
......@@ -285,15 +285,15 @@ class PartA2BboxHead(nn.Module):
"""Coumputing losses.
Args:
cls_score (Torch.tensor): Scores of each roi.
bbox_pred (Torch.tensor): Predictions of bboxes.
rois (Torch.tensor): Roi bboxes.
labels (Torch.tensor): Labels of class.
bbox_targets (Torch.tensor): Target of positive bboxes.
pos_gt_bboxes (Torch.tensor): Gt of positive bboxes.
reg_mask (Torch.tensor): Mask for positive bboxes.
label_weights (Torch.tensor): Weights of class loss.
bbox_weights (Torch.tensor): Weights of bbox loss.
cls_score (torch.Tensor): Scores of each roi.
bbox_pred (torch.Tensor): Predictions of bboxes.
rois (torch.Tensor): Roi bboxes.
labels (torch.Tensor): Labels of class.
bbox_targets (torch.Tensor): Target of positive bboxes.
pos_gt_bboxes (torch.Tensor): Gt of positive bboxes.
reg_mask (torch.Tensor): Mask for positive bboxes.
label_weights (torch.Tensor): Weights of class loss.
bbox_weights (torch.Tensor): Weights of bbox loss.
Returns:
dict: Computed losses.
......@@ -357,9 +357,9 @@ class PartA2BboxHead(nn.Module):
"""Generate targets.
Args:
sampling_results (list[:obj:SamplingResult]):
sampling_results (list[:obj:`SamplingResult`]):
Sampled results from rois.
rcnn_train_cfg (ConfigDict): Training config of rcnn.
rcnn_train_cfg (:obj:`ConfigDict`): Training config of rcnn.
concat (bool): Whether to concatenate targets between batches.
Returns:
......@@ -511,7 +511,7 @@ class PartA2BboxHead(nn.Module):
class_labels (torch.Tensor): Label of classes
class_pred (torch.Tensor): Score for nms.
img_metas (list[dict]): Contain pcd and img's meta info.
cfg (ConfigDict): Testing config.
cfg (:obj:`ConfigDict`): Testing config.
Returns:
list[tuple]: Decoded bbox, scores and labels after nms.
......
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