Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
8c5dd998
Commit
8c5dd998
authored
May 18, 2020
by
zhangwenwei
Browse files
Merge branch 'fix_docstring' into 'master'
Fix docstring problems See merge request open-mmlab/mmdet.3d!37
parents
701e5032
673a54de
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
43 deletions
+43
-43
mmdet3d/core/evaluation/indoor_eval.py
mmdet3d/core/evaluation/indoor_eval.py
+9
-9
mmdet3d/datasets/indoor_base_dataset.py
mmdet3d/datasets/indoor_base_dataset.py
+4
-4
mmdet3d/datasets/pipelines/indoor_augment.py
mmdet3d/datasets/pipelines/indoor_augment.py
+11
-11
mmdet3d/datasets/pipelines/indoor_loading.py
mmdet3d/datasets/pipelines/indoor_loading.py
+5
-5
mmdet3d/datasets/pipelines/indoor_sample.py
mmdet3d/datasets/pipelines/indoor_sample.py
+3
-3
tools/data_converter/indoor_converter.py
tools/data_converter/indoor_converter.py
+1
-1
tools/data_converter/scannet_data_utils.py
tools/data_converter/scannet_data_utils.py
+5
-5
tools/data_converter/sunrgbd_data_utils.py
tools/data_converter/sunrgbd_data_utils.py
+5
-5
No files found.
mmdet3d/core/evaluation/indoor_eval.py
View file @
8c5dd998
...
...
@@ -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
D
epth to
L
idar.
"""Boxes3d
d
epth to
l
idar.
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 (
L
ist[float]): a list, iou threshold.
iou_thr (
l
ist[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
R
ecall.
"""Evaluate mAP and
r
ecall.
Generic functions to compute precision/recall for object detection
for multiple classes.
Args:
det_infos (
L
ist[
L
ist
L
ist[
[
tuple]]]): Label, bbox and
det_infos (
l
ist[
l
ist
[l
ist[tuple]]]): Label, bbox and
score of the detection result.
gt_infos (
L
ist[
L
ist[
L
ist]]): Label, bbox of the groundtruth.
ovthresh (
L
ist[float]): iou threshold.
gt_infos (
l
ist[
l
ist[
l
ist]]): Label, bbox of the groundtruth.
ovthresh (
l
ist[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 (
L
ist[
L
ist[dict]]): GT annotations.
dt_annos (
L
ist[
L
ist[List[tuple]]]): Detection annotations.
metric (
L
ist[float]): AP IoU thresholds.
gt_annos (
l
ist[
l
ist[dict]]): GT annotations.
dt_annos (
l
ist[
l
ist[List[tuple]]]): Detection annotations.
metric (
l
ist[float]): AP IoU thresholds.
label2cat (dict): {label: cat}.
Return:
...
...
mmdet3d/datasets/indoor_base_dataset.py
View file @
8c5dd998
...
...
@@ -98,12 +98,12 @@ class IndoorBaseDataset(torch_data.Dataset):
return
class_names
def
_generate_annotations
(
self
,
output
):
"""Generate
A
nnotations.
"""Generate
a
nnotations.
Transform results of the model to the form of the evaluation.
Args:
output (
L
ist): The output of the model.
output (
l
ist): The output of the model.
"""
result
=
[]
bs
=
len
(
output
)
...
...
@@ -140,8 +140,8 @@ class IndoorBaseDataset(torch_data.Dataset):
Evaluation in indoor protocol.
Args:
results (
L
ist): List of result.
metric (
L
ist[float]): AP IoU thresholds.
results (
l
ist): List of result.
metric (
l
ist[float]): AP IoU thresholds.
"""
results
=
self
.
format_results
(
results
)
from
mmdet3d.core.evaluation
import
indoor_eval
...
...
mmdet3d/datasets/pipelines/indoor_augment.py
View file @
8c5dd998
...
...
@@ -5,10 +5,10 @@ from mmdet.datasets.builder import PIPELINES
@
PIPELINES
.
register_module
()
class
IndoorFlipData
(
object
):
"""Indoor
F
lip
D
ata.
"""Indoor
f
lip
d
ata.
Flip point cloud and ground truth boxes.
The point cloud will
v
e flipped along the yz plane
The point cloud will
b
e 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
P
oints
C
olor
J
itter.
"""Indoor
p
oints
c
olor
j
itter.
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 (
L
ist[float]): Mean color of the point cloud.
color_mean (
l
ist[float]): Mean color of the point cloud.
Default: [0.5, 0.5, 0.5].
bright_range (
L
ist[float]): Range of brightness.
bright_range (
l
ist[float]): Range of brightness.
Default: [0.8, 1.2].
color_shift_range (
L
ist[float]): Range of color shift.
color_shift_range (
l
ist[float]): Range of color shift.
Default: [0.95, 1.05].
jitter_range (
L
ist[float]): Range of jittering.
jitter_range (
l
ist[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
G
lobal
R
otate
S
cale.
"""Indoor
g
lobal
r
otate
and s
cale.
Augment sunrgbd and scannet data with global rotating and scaling.
Args:
use_height (bool): Whether to use height.
Default: True.
rot_range (
L
ist[float]): Range of rotation.
rot_range (
l
ist[float]): Range of rotation.
Default: None.
scale_range (
L
ist[float]): Range of scale.
scale_range (
l
ist[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
A
ligned
B
oxes.
"""Rotate
a
ligned
b
oxes.
Rotate function for the aligned boxes.
...
...
mmdet3d/datasets/pipelines/indoor_loading.py
View file @
8c5dd998
...
...
@@ -6,12 +6,12 @@ from mmdet.datasets.builder import PIPELINES
@
PIPELINES
.
register_module
()
class
IndoorPointsColorNormalize
(
object
):
"""Indoor
P
oints
C
olor
N
ormalize
"""Indoor
p
oints
c
olor
n
ormalize
Normalize color of the points.
Args:
color_mean (
L
ist[float]): Mean color of the point cloud.
color_mean (
l
ist[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
L
oad
P
oints
F
rom
F
ile.
"""Indoor
l
oad
p
oints
f
rom
f
ile.
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 (
L
ist[int]): Which dimensions of the points to be used.
use_dim (
l
ist[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
L
oad
A
nnotations3D.
"""Indoor
l
oad
a
nnotations3D.
Load instance mask and semantic mask of points.
"""
...
...
mmdet3d/datasets/pipelines/indoor_sample.py
View file @
8c5dd998
...
...
@@ -5,7 +5,7 @@ from mmdet.datasets.builder import PIPELINES
@
PIPELINES
.
register_module
()
class
IndoorPointSample
(
object
):
"""
P
oint
S
ample.
"""
Indoor p
oint
s
ample.
Sampling data to a certain number.
...
...
@@ -22,7 +22,7 @@ class IndoorPointSample(object):
num_samples
,
replace
=
None
,
return_choices
=
False
):
"""Points
R
andom
S
ampling.
"""Points
r
andom
s
ampling.
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
)
...
...
tools/data_converter/indoor_converter.py
View file @
8c5dd998
...
...
@@ -9,7 +9,7 @@ def create_indoor_info_file(data_path,
pkl_prefix
=
'sunrgbd'
,
save_path
=
None
,
use_v1
=
False
):
"""Create indoor
information file.
"""Create indoor information file.
Get information of the raw data and save it to the pkl file.
...
...
tools/data_converter/scannet_data_utils.py
View file @
8c5dd998
...
...
@@ -6,12 +6,12 @@ import numpy as np
class
ScanNetData
(
object
):
"""ScanNet
D
ata
"""ScanNet
d
ata
.
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 (
L
ist[int]): Index list of the sample.
sample_id_list (
l
ist[int]): Index list of the sample.
Default: None.
Returns:
infos (
L
ist[dict]): Information of the raw data.
infos (
l
ist[dict]): Information of the raw data.
"""
def
process_single_scene
(
sample_idx
):
...
...
tools/data_converter/sunrgbd_data_utils.py
View file @
8c5dd998
...
...
@@ -7,7 +7,7 @@ import scipy.io as sio
def
random_sampling
(
points
,
num_points
,
replace
=
None
,
return_choices
=
False
):
"""Random
S
ampling.
"""Random
s
ampling.
Sampling point cloud to a certain number of points.
...
...
@@ -57,9 +57,9 @@ class SUNRGBDInstance(object):
class
SUNRGBDData
(
object
):
"""SUNRGBD
D
ata
"""SUNRGBD
d
ata
.
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 (
L
ist[int]): Index list of the sample.
sample_id_list (
l
ist[int]): Index list of the sample.
Default: None.
Returns:
infos (
L
ist[dict]): Information of the raw data.
infos (
l
ist[dict]): Information of the raw data.
"""
def
process_single_scene
(
sample_idx
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment