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
cbc2491f
Unverified
Commit
cbc2491f
authored
Oct 13, 2021
by
Tai-Wang
Committed by
GitHub
Oct 13, 2021
Browse files
Add code-spell pre-commit hook and fix typos (#995)
parent
6b1602f1
Changes
79
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
35 additions
and
36 deletions
+35
-36
docs_zh-CN/benchmarks.md
docs_zh-CN/benchmarks.md
+1
-1
docs_zh-CN/changelog.md
docs_zh-CN/changelog.md
+1
-1
docs_zh-CN/datasets/nuscenes_det.md
docs_zh-CN/datasets/nuscenes_det.md
+0
-1
docs_zh-CN/supported_tasks/lidar_det3d.md
docs_zh-CN/supported_tasks/lidar_det3d.md
+1
-1
docs_zh-CN/supported_tasks/lidar_sem_seg3d.md
docs_zh-CN/supported_tasks/lidar_sem_seg3d.md
+1
-1
docs_zh-CN/supported_tasks/vision_det3d.md
docs_zh-CN/supported_tasks/vision_det3d.md
+1
-1
docs_zh-CN/useful_tools.md
docs_zh-CN/useful_tools.md
+1
-1
mmdet3d/core/anchor/anchor_3d_generator.py
mmdet3d/core/anchor/anchor_3d_generator.py
+1
-1
mmdet3d/core/bbox/box_np_ops.py
mmdet3d/core/bbox/box_np_ops.py
+1
-1
mmdet3d/core/bbox/coders/smoke_bbox_coder.py
mmdet3d/core/bbox/coders/smoke_bbox_coder.py
+4
-4
mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py
mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py
+2
-2
mmdet3d/core/bbox/structures/utils.py
mmdet3d/core/bbox/structures/utils.py
+2
-2
mmdet3d/core/post_processing/box3d_nms.py
mmdet3d/core/post_processing/box3d_nms.py
+1
-1
mmdet3d/core/utils/gaussian.py
mmdet3d/core/utils/gaussian.py
+1
-1
mmdet3d/core/visualizer/open3d_vis.py
mmdet3d/core/visualizer/open3d_vis.py
+12
-12
mmdet3d/datasets/kitti_dataset.py
mmdet3d/datasets/kitti_dataset.py
+1
-1
mmdet3d/datasets/kitti_mono_dataset.py
mmdet3d/datasets/kitti_mono_dataset.py
+1
-1
mmdet3d/datasets/lyft_dataset.py
mmdet3d/datasets/lyft_dataset.py
+1
-1
mmdet3d/datasets/nuscenes_dataset.py
mmdet3d/datasets/nuscenes_dataset.py
+1
-1
mmdet3d/datasets/pipelines/loading.py
mmdet3d/datasets/pipelines/loading.py
+1
-1
No files found.
docs_zh-CN/benchmarks.md
View file @
cbc2491f
# 基准测试
\ No newline at end of file
# 基准测试
docs_zh-CN/changelog.md
View file @
cbc2491f
# 变更日志
\ No newline at end of file
# 变更日志
docs_zh-CN/datasets/nuscenes_det.md
View file @
cbc2491f
...
...
@@ -257,4 +257,3 @@ barrier 0.466 0.581 0.269 0.169 nan nan
总的来说,
`NuScenesBox`
和我们的
`CameraInstanceBoxes`
的主要区别主要体现在转向角(yaw)定义上。
`NuScenesBox`
定义了一个四元数或三个欧拉角的旋转,而我们的由于实际情况只定义了一个转向角(yaw),它需要我们在预处理和后处理中手动添加一些额外的旋转,例如
[
这里
](
https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/datasets/nuscenes_mono_dataset.py#L673
)
。
另外,请注意,角点和位置的定义在
`NuScenesBox`
中是分离的。例如,在单目 3D 检测中,框位置的定义在其相机坐标中(有关汽车设置,请参阅其官方
[
插图
](
https://www.nuscenes.org/nuscenes#data-collection
)
),即与
[
我们的
](
https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/cam_box3d.py
)
一致。相比之下,它的角点是通过
[
惯例
](
https://github.com/nutonomy/nuscenes-devkit/blob/02e9200218977193a1058dd7234f935834378319/python-sdk/nuscenes/utils/data_classes.py#L527
)
定义的,“x 向前, y 向左, z 向上”。它导致了与我们的
`CameraInstanceBoxes`
不同的维度和旋转定义理念。一个移除相似冲突的例子是 PR
[
#744
](
https://github.com/open-mmlab/mmdetection3d/pull/744
)
。同样的问题也存在于 LiDAR 系统中。为了解决它们,我们通常会在预处理和后处理中添加一些转换,以保证在整个训练和推理过程中框都在我们的坐标系系统里。
docs_zh-CN/supported_tasks/lidar_det3d.md
View file @
cbc2491f
# 基于Lidar的3D检测
\ No newline at end of file
# 基于Lidar的3D检测
docs_zh-CN/supported_tasks/lidar_sem_seg3d.md
View file @
cbc2491f
# 基于Lidar的3D语义分割
\ No newline at end of file
# 基于Lidar的3D语义分割
docs_zh-CN/supported_tasks/vision_det3d.md
View file @
cbc2491f
# 基于视觉的3D检测
\ No newline at end of file
# 基于视觉的3D检测
docs_zh-CN/useful_tools.md
View file @
cbc2491f
...
...
@@ -198,7 +198,7 @@ python tools/model_converters/publish_model.py work_dirs/faster_rcnn/latest.pth
为了转换 nuImages 数据集为 COCO 格式,请使用下面的指令:
```
shell
python -u tools/data_converter/nuimage_converter.py --data-root ${DATA_ROOT} --version ${VERIONS}
\
python -u tools/data_converter/nuimage_converter.py --data-root ${DATA_ROOT} --version ${VER
S
IONS}
\
--out-dir ${OUT_DIR} --nproc ${NUM_WORKERS} --extra-tag ${TAG}
```
...
...
mmdet3d/core/anchor/anchor_3d_generator.py
View file @
cbc2491f
...
...
@@ -99,7 +99,7 @@ class Anchor3DRangeGenerator(object):
list[torch.Tensor]: Anchors in multiple feature levels.
The sizes of each tensor should be [N, 4], where
N = width * height * num_base_anchors, width and height
are the sizes of the corresponding feature l
a
vel,
are the sizes of the corresponding feature l
e
vel,
num_base_anchors is the number of anchors for that level.
"""
assert
self
.
num_levels
==
len
(
featmap_sizes
)
...
...
mmdet3d/core/bbox/box_np_ops.py
View file @
cbc2491f
...
...
@@ -468,7 +468,7 @@ def rbbox2d_to_near_bbox(rbboxes):
(N, 5(x, y, xdim, ydim, rad)).
Returns:
np.ndarray: Bounding boxes with the sh
p
ae of
np.ndarray: Bounding boxes with the sha
p
e of
(N, 4(xmin, ymin, xmax, ymax)).
"""
rots
=
rbboxes
[...,
-
1
]
...
...
mmdet3d/core/bbox/coders/smoke_bbox_coder.py
View file @
cbc2491f
...
...
@@ -23,7 +23,7 @@ class SMOKECoder(BaseBBoxCoder):
self
.
bbox_code_size
=
code_size
def
encode
(
self
,
locations
,
dimensions
,
orientations
,
input_metas
):
"""Encode CameraInstance3DBoxes by locations, dime
m
sions, orientations.
"""Encode CameraInstance3DBoxes by locations, dime
n
sions, orientations.
Args:
locations (Tensor): Center location for 3D boxes.
...
...
@@ -55,7 +55,7 @@ class SMOKECoder(BaseBBoxCoder):
cam2imgs
,
trans_mats
,
locations
=
None
):
"""Decode regression into locations, dime
m
sions, orientations.
"""Decode regression into locations, dime
n
sions, orientations.
Args:
reg (Tensor): Batch regression for each predict center2d point.
...
...
@@ -80,7 +80,7 @@ class SMOKECoder(BaseBBoxCoder):
- locations (Tensor): Centers of 3D boxes.
shape: (batch * K (max_objs), 3)
- dimensions (Tensor): Dimensions of 3D boxes.
sh
p
ae: (batch * K (max_objs), 3)
sha
p
e: (batch * K (max_objs), 3)
- orientations (Tensor): Orientations of 3D
boxes.
shape: (batch * K (max_objs), 1)
...
...
@@ -185,7 +185,7 @@ class SMOKECoder(BaseBBoxCoder):
rays
=
torch
.
atan
(
locations
[:,
0
]
/
(
locations
[:,
2
]
+
1e-7
))
alphas
=
torch
.
atan
(
ori_vector
[:,
0
]
/
(
ori_vector
[:,
1
]
+
1e-7
))
# get cosine value positive and negtive index.
# get cosine value positive and neg
a
tive index.
cos_pos_inds
=
(
ori_vector
[:,
1
]
>=
0
).
nonzero
()
cos_neg_inds
=
(
ori_vector
[:,
1
]
<
0
).
nonzero
()
...
...
mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py
View file @
cbc2491f
...
...
@@ -106,7 +106,7 @@ def bbox_overlaps_nearest_3d(bboxes1,
Note:
This function first finds the nearest 2D boxes in bird eye view
(BEV), and then calculates the 2D IoU using :meth:`bbox_overlaps`.
Ths IoU calculator :class:`BboxOverlapsNearest3D` uses this
Th
i
s IoU calculator :class:`BboxOverlapsNearest3D` uses this
function to calculate IoUs of boxes.
If ``is_aligned`` is ``False``, then it calculates the ious between
...
...
@@ -258,7 +258,7 @@ def axis_aligned_bbox_overlaps_3d(bboxes1,
"""
assert
mode
in
[
'iou'
,
'giou'
],
f
'Unsupported mode
{
mode
}
'
# Either the boxes are empty or the length of boxes's last dimens
t
ion is 6
# Either the boxes are empty or the length of boxes's last dimension is 6
assert
(
bboxes1
.
size
(
-
1
)
==
6
or
bboxes1
.
size
(
0
)
==
0
)
assert
(
bboxes2
.
size
(
-
1
)
==
6
or
bboxes2
.
size
(
0
)
==
0
)
...
...
mmdet3d/core/bbox/structures/utils.py
View file @
cbc2491f
...
...
@@ -220,7 +220,7 @@ def points_img2cam(points, cam2img):
Args:
points (torch.Tensor): 2.5D points in 2D images, [N, 3],
3 corresponds with x, y in the image and depth.
cam2img (torch.Tensor): Camera in
s
trinsic matrix. The shape can be
cam2img (torch.Tensor): Camera intrinsic matrix. The shape can be
[3, 3], [3, 4] or [4, 4].
Returns:
...
...
@@ -239,7 +239,7 @@ def points_img2cam(points, cam2img):
pad_cam2img
[:
cam2img
.
shape
[
0
],
:
cam2img
.
shape
[
1
]]
=
cam2img
inv_pad_cam2img
=
torch
.
inverse
(
pad_cam2img
).
transpose
(
0
,
1
)
# Do operation in homogenous coordinates.
# Do operation in homogen
e
ous coordinates.
num_points
=
unnormed_xys
.
shape
[
0
]
homo_xys
=
torch
.
cat
([
unnormed_xys
,
xys
.
new_ones
((
num_points
,
1
))],
dim
=
1
)
points3D
=
torch
.
mm
(
homo_xys
,
inv_pad_cam2img
)[:,
:
3
]
...
...
mmdet3d/core/post_processing/box3d_nms.py
View file @
cbc2491f
...
...
@@ -26,7 +26,7 @@ def box3d_multiclass_nms(mlvl_bboxes,
The coordinate system of the BEV boxes is counterclockwise.
mlvl_scores (torch.Tensor): Multi-level boxes with shape
(N, C + 1). N is the number of boxes. C is the number of classes.
score_thr (float): Score thre
d
hold to filter boxes with low
score_thr (float): Score thre
s
hold to filter boxes with low
confidence.
max_num (int): Maximum number of boxes will be kept.
cfg (dict): Configuration dict of NMS.
...
...
mmdet3d/core/utils/gaussian.py
View file @
cbc2491f
...
...
@@ -28,7 +28,7 @@ def draw_heatmap_gaussian(heatmap, center, radius, k=1):
Args:
heatmap (torch.Tensor): Heatmap to be masked.
center (torch.Tensor): Center coord of the heatmap.
radius (int): Radius of gausian.
radius (int): Radius of gaus
s
ian.
K (int, optional): Multiple of masked_gaussian. Defaults to 1.
Returns:
...
...
mmdet3d/core/visualizer/open3d_vis.py
View file @
cbc2491f
...
...
@@ -80,10 +80,10 @@ def _draw_bboxes(bbox3d,
the color of points inside bbox3d. Default: (1, 0, 0).
rot_axis (int, optional): rotation axis of bbox. Default: 2.
center_mode (bool, optional): indicate the center of bbox is
bottom center or gravity center. ava
l
iable mode
bottom center or gravity center. avai
l
able mode
['lidar_bottom', 'camera_bottom']. Default: 'lidar_bottom'.
mode (str, optional): indicate type of the input points,
ava
l
iable mode ['xyz', 'xyzrgb']. Default: 'xyz'.
avai
l
able mode ['xyz', 'xyzrgb']. Default: 'xyz'.
"""
if
isinstance
(
bbox3d
,
torch
.
Tensor
):
bbox3d
=
bbox3d
.
cpu
().
numpy
()
...
...
@@ -154,9 +154,9 @@ def show_pts_boxes(points,
the color of points which are in bbox3d. Default: (1, 0, 0).
rot_axis (int, optional): rotation axis of bbox. Default: 2.
center_mode (bool, optional): indicate the center of bbox is bottom
center or gravity center. ava
l
iable mode
center or gravity center. avai
l
able mode
['lidar_bottom', 'camera_bottom']. Default: 'lidar_bottom'.
mode (str, optional): indicate type of the input points, ava
l
iable
mode (str, optional): indicate type of the input points, avai
l
able
mode ['xyz', 'xyzrgb']. Default: 'xyz'.
"""
# TODO: support score and class info
...
...
@@ -215,10 +215,10 @@ def _draw_bboxes_ind(bbox3d,
the color of points which are in bbox3d. Default: (1, 0, 0).
rot_axis (int, optional): rotation axis of bbox. Default: 2.
center_mode (bool, optional): indicate the center of bbox is
bottom center or gravity center. ava
l
iable mode
bottom center or gravity center. avai
l
able mode
['lidar_bottom', 'camera_bottom']. Default: 'lidar_bottom'.
mode (str, optional): indicate type of the input points,
ava
l
iable mode ['xyz', 'xyzrgb']. Default: 'xyz'.
avai
l
able mode ['xyz', 'xyzrgb']. Default: 'xyz'.
"""
if
isinstance
(
bbox3d
,
torch
.
Tensor
):
bbox3d
=
bbox3d
.
cpu
().
numpy
()
...
...
@@ -296,10 +296,10 @@ def show_pts_index_boxes(points,
the color of points which are in bbox3d. Default: (1, 0, 0).
rot_axis (int, optional): rotation axis of bbox. Default: 2.
center_mode (bool, optional): indicate the center of bbox is
bottom center or gravity center. ava
l
iable mode
bottom center or gravity center. avai
l
able mode
['lidar_bottom', 'camera_bottom']. Default: 'lidar_bottom'.
mode (str, optional): indicate type of the input points,
ava
l
iable mode ['xyz', 'xyzrgb']. Default: 'xyz'.
avai
l
able mode ['xyz', 'xyzrgb']. Default: 'xyz'.
"""
# TODO: support score and class info
assert
0
<=
rot_axis
<=
2
...
...
@@ -353,10 +353,10 @@ class Visualizer(object):
the color of points which are in bbox3d. Default: (1, 0, 0).
rot_axis (int, optional): rotation axis of bbox. Default: 2.
center_mode (bool, optional): indicate the center of bbox is
bottom center or gravity center. ava
l
iable mode
bottom center or gravity center. avai
l
able mode
['lidar_bottom', 'camera_bottom']. Default: 'lidar_bottom'.
mode (str, optional): indicate type of the input points,
ava
l
iable mode ['xyz', 'xyzrgb']. Default: 'xyz'.
avai
l
able mode ['xyz', 'xyzrgb']. Default: 'xyz'.
"""
def
__init__
(
self
,
...
...
@@ -409,9 +409,9 @@ class Visualizer(object):
to be visualized. The 3d bbox is in mode of
Box3DMode.DEPTH with gravity_center (please refer to
core.structures.box_3d_mode).
bbox_color (tuple[float]): the color of bbox. Defaul
e
: None.
bbox_color (tuple[float]): the color of bbox. Defaul
t
: None.
points_in_box_color (tuple[float]): the color of points which
are in bbox3d. Defaul
e
: None.
are in bbox3d. Defaul
t
: None.
"""
if
bbox_color
is
None
:
bbox_color
=
self
.
bbox_color
...
...
mmdet3d/datasets/kitti_dataset.py
View file @
cbc2491f
...
...
@@ -316,7 +316,7 @@ class KittiDataset(Custom3DDataset):
pklfile_prefix (str, optional): The prefix of pkl files, including
the file path and the prefix of filename, e.g., "a/b/prefix".
If not specified, a temp file will be created. Default: None.
submission_prefix (str, optional): The prefix of submission data
s
.
submission_prefix (str, optional): The prefix of submission data.
If not specified, the submission data will not be generated.
show (bool, optional): Whether to visualize.
Default: False.
...
...
mmdet3d/datasets/kitti_mono_dataset.py
View file @
cbc2491f
...
...
@@ -214,7 +214,7 @@ class KittiMonoDataset(NuScenesMonoDataset):
pklfile_prefix (str, optional): The prefix of pkl files, including
the file path and the prefix of filename, e.g., "a/b/prefix".
If not specified, a temp file will be created. Default: None.
submission_prefix (str, optional): The prefix of submission data
s
.
submission_prefix (str, optional): The prefix of submission data.
If not specified, the submission data will not be generated.
show (bool, optional): Whether to visualize.
Default: False.
...
...
mmdet3d/datasets/lyft_dataset.py
View file @
cbc2491f
...
...
@@ -143,7 +143,7 @@ class LyftDataset(Custom3DDataset):
"""
info
=
self
.
data_infos
[
index
]
# standard protoc
a
l modified from SECOND.Pytorch
# standard protoc
o
l modified from SECOND.Pytorch
input_dict
=
dict
(
sample_idx
=
info
[
'token'
],
pts_filename
=
info
[
'lidar_path'
],
...
...
mmdet3d/datasets/nuscenes_dataset.py
View file @
cbc2491f
...
...
@@ -210,7 +210,7 @@ class NuScenesDataset(Custom3DDataset):
- ann_info (dict): Annotation info.
"""
info
=
self
.
data_infos
[
index
]
# standard protoc
a
l modified from SECOND.Pytorch
# standard protoc
o
l modified from SECOND.Pytorch
input_dict
=
dict
(
sample_idx
=
info
[
'token'
],
pts_filename
=
info
[
'lidar_path'
],
...
...
mmdet3d/datasets/pipelines/loading.py
View file @
cbc2491f
...
...
@@ -49,7 +49,7 @@ class LoadMultiViewImageFromFiles(object):
if
self
.
to_float32
:
img
=
img
.
astype
(
np
.
float32
)
results
[
'filename'
]
=
filename
# unravel to list, see `DefaultFormatBundle` in formating.py
# unravel to list, see `DefaultFormatBundle` in format
t
ing.py
# which will transpose each image separately and then stack into array
results
[
'img'
]
=
[
img
[...,
i
]
for
i
in
range
(
img
.
shape
[
-
1
])]
results
[
'img_shape'
]
=
img
.
shape
...
...
Prev
1
2
3
4
Next
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