Commit 8c5dd998 authored by zhangwenwei's avatar zhangwenwei
Browse files

Merge branch 'fix_docstring' into 'master'

Fix docstring problems

See merge request open-mmlab/mmdet.3d!37
parents 701e5032 673a54de
......@@ -5,7 +5,7 @@ from mmdet3d.core.bbox.iou_calculators.iou3d_calculator import bbox_overlaps_3d
def boxes3d_depth_to_lidar(boxes3d, mid_to_bottom=True):
"""Boxes3d Depth to Lidar.
"""Boxes3d depth to lidar.
Flip X-right,Y-forward,Z-up to X-forward,Y-left,Z-up.
......@@ -93,7 +93,7 @@ def eval_det_cls(pred, gt, iou_thr=None):
Args:
pred (dict): {img_id: [(bbox, score)]} where bbox is numpy array.
gt (dict): {img_id: [bbox]}.
iou_thr (List[float]): a list, iou threshold.
iou_thr (list[float]): a list, iou threshold.
Return:
ndarray: numpy array of length nd.
......@@ -193,16 +193,16 @@ def eval_det_cls(pred, gt, iou_thr=None):
def eval_map_recall(det_infos, gt_infos, ovthresh=None):
"""Evaluate mAP and Recall.
"""Evaluate mAP and recall.
Generic functions to compute precision/recall for object detection
for multiple classes.
Args:
det_infos (List[ListList[[tuple]]]): Label, bbox and
det_infos (list[list[list[tuple]]]): Label, bbox and
score of the detection result.
gt_infos (List[List[List]]): Label, bbox of the groundtruth.
ovthresh (List[float]): iou threshold.
gt_infos (list[list[list]]): Label, bbox of the groundtruth.
ovthresh (list[float]): iou threshold.
Default: None.
Return:
......@@ -267,9 +267,9 @@ def indoor_eval(gt_annos, dt_annos, metric, label2cat):
Evaluate the result of the detection.
Args:
gt_annos (List[List[dict]]): GT annotations.
dt_annos (List[List[List[tuple]]]): Detection annotations.
metric (List[float]): AP IoU thresholds.
gt_annos (list[list[dict]]): GT annotations.
dt_annos (list[list[List[tuple]]]): Detection annotations.
metric (list[float]): AP IoU thresholds.
label2cat (dict): {label: cat}.
Return:
......
......@@ -98,12 +98,12 @@ class IndoorBaseDataset(torch_data.Dataset):
return class_names
def _generate_annotations(self, output):
"""Generate Annotations.
"""Generate annotations.
Transform results of the model to the form of the evaluation.
Args:
output (List): The output of the model.
output (list): The output of the model.
"""
result = []
bs = len(output)
......@@ -140,8 +140,8 @@ class IndoorBaseDataset(torch_data.Dataset):
Evaluation in indoor protocol.
Args:
results (List): List of result.
metric (List[float]): AP IoU thresholds.
results (list): List of result.
metric (list[float]): AP IoU thresholds.
"""
results = self.format_results(results)
from mmdet3d.core.evaluation import indoor_eval
......
......@@ -5,10 +5,10 @@ from mmdet.datasets.builder import PIPELINES
@PIPELINES.register_module()
class IndoorFlipData(object):
"""Indoor Flip Data.
"""Indoor flip data.
Flip point cloud and ground truth boxes.
The point cloud will ve flipped along the yz plane
The point cloud will be flipped along the yz plane
and the xz plane with a certain probability.
Args:
......@@ -53,19 +53,19 @@ class IndoorFlipData(object):
@PIPELINES.register_module()
class IndoorPointsColorJitter(object):
"""Indoor Points Color Jitter.
"""Indoor points color jitter.
Randomly change the brightness and color of the point cloud, and
drop out the points' colors with a certain range and probability.
Args:
color_mean (List[float]): Mean color of the point cloud.
color_mean (list[float]): Mean color of the point cloud.
Default: [0.5, 0.5, 0.5].
bright_range (List[float]): Range of brightness.
bright_range (list[float]): Range of brightness.
Default: [0.8, 1.2].
color_shift_range (List[float]): Range of color shift.
color_shift_range (list[float]): Range of color shift.
Default: [0.95, 1.05].
jitter_range (List[float]): Range of jittering.
jitter_range (list[float]): Range of jittering.
Default: [-0.025, 0.025].
drop_prob (float): Probability to drop out points' color.
Default: 0.3
......@@ -118,16 +118,16 @@ class IndoorPointsColorJitter(object):
# TODO: try transform noise.
@PIPELINES.register_module()
class IndoorGlobalRotScale(object):
"""Indoor Global Rotate Scale.
"""Indoor global rotate and scale.
Augment sunrgbd and scannet data with global rotating and scaling.
Args:
use_height (bool): Whether to use height.
Default: True.
rot_range (List[float]): Range of rotation.
rot_range (list[float]): Range of rotation.
Default: None.
scale_range (List[float]): Range of scale.
scale_range (list[float]): Range of scale.
Default: None.
"""
......@@ -153,7 +153,7 @@ class IndoorGlobalRotScale(object):
return rot_mat
def _rotate_aligned_boxes(self, input_boxes, rot_mat):
"""Rotate Aligned Boxes.
"""Rotate aligned boxes.
Rotate function for the aligned boxes.
......
......@@ -6,12 +6,12 @@ from mmdet.datasets.builder import PIPELINES
@PIPELINES.register_module()
class IndoorPointsColorNormalize(object):
"""Indoor Points Color Normalize
"""Indoor points color normalize
Normalize color of the points.
Args:
color_mean (List[float]): Mean color of the point cloud.
color_mean (list[float]): Mean color of the point cloud.
"""
def __init__(self, color_mean):
......@@ -33,7 +33,7 @@ class IndoorPointsColorNormalize(object):
@PIPELINES.register_module()
class IndoorLoadPointsFromFile(object):
"""Indoor Load Points From File.
"""Indoor load points from file.
Load sunrgbd and scannet points from file.
......@@ -41,7 +41,7 @@ class IndoorLoadPointsFromFile(object):
use_height (bool): Whether to use height.
load_dim (int): The dimension of the loaded points.
Default: 6.
use_dim (List[int]): Which dimensions of the points to be used.
use_dim (list[int]): Which dimensions of the points to be used.
Default: [0, 1, 2].
"""
......@@ -78,7 +78,7 @@ class IndoorLoadPointsFromFile(object):
@PIPELINES.register_module()
class IndoorLoadAnnotations3D(object):
"""Indoor Load Annotations3D.
"""Indoor load annotations3D.
Load instance mask and semantic mask of points.
"""
......
......@@ -5,7 +5,7 @@ from mmdet.datasets.builder import PIPELINES
@PIPELINES.register_module()
class IndoorPointSample(object):
"""Point Sample.
"""Indoor point sample.
Sampling data to a certain number.
......@@ -22,7 +22,7 @@ class IndoorPointSample(object):
num_samples,
replace=None,
return_choices=False):
"""Points Random Sampling.
"""Points random sampling.
Sample points to a certain number.
......@@ -34,7 +34,7 @@ class IndoorPointSample(object):
Returns:
points (ndarray): 3D Points.
choices (ndarray): The generated random samples
choices (ndarray): The generated random samples.
"""
if replace is None:
replace = (points.shape[0] < num_samples)
......
......@@ -6,12 +6,12 @@ import numpy as np
class ScanNetData(object):
"""ScanNet Data
"""ScanNet data.
Generate scannet infos for scannet_converter
Generate scannet infos for scannet_converter.
Args:
root_path (str): Root path of the raw data
root_path (str): Root path of the raw data.
split (str): Set split type of the data. Default: 'train'.
"""
......@@ -56,11 +56,11 @@ class ScanNetData(object):
Args:
num_workers (int): Number of threads to be used. Default: 4.
has_label (bool): Whether the data has label. Default: True.
sample_id_list (List[int]): Index list of the sample.
sample_id_list (list[int]): Index list of the sample.
Default: None.
Returns:
infos (List[dict]): Information of the raw data.
infos (list[dict]): Information of the raw data.
"""
def process_single_scene(sample_idx):
......
......@@ -7,7 +7,7 @@ import scipy.io as sio
def random_sampling(points, num_points, replace=None, return_choices=False):
"""Random Sampling.
"""Random sampling.
Sampling point cloud to a certain number of points.
......@@ -57,9 +57,9 @@ class SUNRGBDInstance(object):
class SUNRGBDData(object):
"""SUNRGBD Data
"""SUNRGBD data.
Generate scannet infos for sunrgbd_converter
Generate scannet infos for sunrgbd_converter.
Args:
root_path (str): Root path of the raw data.
......@@ -130,11 +130,11 @@ class SUNRGBDData(object):
Args:
num_workers (int): Number of threads to be used. Default: 4.
has_label (bool): Whether the data has label. Default: True.
sample_id_list (List[int]): Index list of the sample.
sample_id_list (list[int]): Index list of the sample.
Default: None.
Returns:
infos (List[dict]): Information of the raw data.
infos (list[dict]): Information of the raw data.
"""
def process_single_scene(sample_idx):
......
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