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
c2fe651f
Commit
c2fe651f
authored
Jul 20, 2022
by
zhangshilong
Committed by
ChaimZhu
Jul 20, 2022
Browse files
refactor directory
parent
bc5806ba
Changes
275
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
75 additions
and
21 deletions
+75
-21
mmdet3d/structures/bbox_3d/base_box3d.py
mmdet3d/structures/bbox_3d/base_box3d.py
+0
-0
mmdet3d/structures/bbox_3d/box_3d_mode.py
mmdet3d/structures/bbox_3d/box_3d_mode.py
+0
-0
mmdet3d/structures/bbox_3d/cam_box3d.py
mmdet3d/structures/bbox_3d/cam_box3d.py
+1
-1
mmdet3d/structures/bbox_3d/coord_3d_mode.py
mmdet3d/structures/bbox_3d/coord_3d_mode.py
+2
-1
mmdet3d/structures/bbox_3d/depth_box3d.py
mmdet3d/structures/bbox_3d/depth_box3d.py
+1
-1
mmdet3d/structures/bbox_3d/lidar_box3d.py
mmdet3d/structures/bbox_3d/lidar_box3d.py
+1
-1
mmdet3d/structures/bbox_3d/utils.py
mmdet3d/structures/bbox_3d/utils.py
+1
-1
mmdet3d/structures/det3d_data_sample.py
mmdet3d/structures/det3d_data_sample.py
+13
-4
mmdet3d/structures/ops/__init__.py
mmdet3d/structures/ops/__init__.py
+38
-0
mmdet3d/structures/ops/box_np_ops.py
mmdet3d/structures/ops/box_np_ops.py
+3
-2
mmdet3d/structures/ops/iou3d_calculator.py
mmdet3d/structures/ops/iou3d_calculator.py
+2
-2
mmdet3d/structures/ops/transforms.py
mmdet3d/structures/ops/transforms.py
+1
-0
mmdet3d/structures/point_data.py
mmdet3d/structures/point_data.py
+0
-0
mmdet3d/structures/points/__init__.py
mmdet3d/structures/points/__init__.py
+0
-0
mmdet3d/structures/points/base_points.py
mmdet3d/structures/points/base_points.py
+1
-1
mmdet3d/structures/points/cam_points.py
mmdet3d/structures/points/cam_points.py
+1
-1
mmdet3d/structures/points/depth_points.py
mmdet3d/structures/points/depth_points.py
+1
-1
mmdet3d/structures/points/lidar_points.py
mmdet3d/structures/points/lidar_points.py
+1
-1
mmdet3d/utils/__init__.py
mmdet3d/utils/__init__.py
+8
-4
mmdet3d/utils/array_converter.py
mmdet3d/utils/array_converter.py
+0
-0
No files found.
mmdet3d/
core/bbox/
structures/base_box3d.py
→
mmdet3d/structures/
bbox_3d/
base_box3d.py
View file @
c2fe651f
File moved
mmdet3d/
core/bbox/
structures/box_3d_mode.py
→
mmdet3d/structures/
bbox_3d/
box_3d_mode.py
View file @
c2fe651f
File moved
mmdet3d/
core/bbox/
structures/cam_box3d.py
→
mmdet3d/structures/
bbox_3d/
cam_box3d.py
View file @
c2fe651f
...
...
@@ -2,7 +2,7 @@
import
numpy
as
np
import
torch
from
..
.points
import
BasePoints
from
mmdet3d.structures
.points
import
BasePoints
from
.base_box3d
import
BaseInstance3DBoxes
from
.utils
import
rotation_3d_in_axis
,
yaw2local
...
...
mmdet3d/
core/bbox/
structures/coord_3d_mode.py
→
mmdet3d/structures/
bbox_3d/
coord_3d_mode.py
View file @
c2fe651f
...
...
@@ -4,7 +4,8 @@ from enum import IntEnum, unique
import
numpy
as
np
import
torch
from
...points
import
BasePoints
,
CameraPoints
,
DepthPoints
,
LiDARPoints
from
mmdet3d.structures.points
import
(
BasePoints
,
CameraPoints
,
DepthPoints
,
LiDARPoints
)
from
.base_box3d
import
BaseInstance3DBoxes
from
.box_3d_mode
import
Box3DMode
...
...
mmdet3d/
core/bbox/
structures/depth_box3d.py
→
mmdet3d/structures/
bbox_3d/
depth_box3d.py
View file @
c2fe651f
...
...
@@ -2,7 +2,7 @@
import
numpy
as
np
import
torch
from
mmdet3d.
co
re.points
import
BasePoints
from
mmdet3d.
structu
re
s
.points
import
BasePoints
from
.base_box3d
import
BaseInstance3DBoxes
from
.utils
import
rotation_3d_in_axis
...
...
mmdet3d/
core/bbox/
structures/lidar_box3d.py
→
mmdet3d/structures/
bbox_3d/
lidar_box3d.py
View file @
c2fe651f
...
...
@@ -2,7 +2,7 @@
import
numpy
as
np
import
torch
from
mmdet3d.
co
re.points
import
BasePoints
from
mmdet3d.
structu
re
s
.points
import
BasePoints
from
.base_box3d
import
BaseInstance3DBoxes
from
.utils
import
rotation_3d_in_axis
...
...
mmdet3d/
core/bbox/
structures/utils.py
→
mmdet3d/structures/
bbox_3d/
utils.py
View file @
c2fe651f
...
...
@@ -4,7 +4,7 @@ from logging import warning
import
numpy
as
np
import
torch
from
mmdet3d.
core.
utils
import
array_converter
from
mmdet3d.utils
.array_converter
import
array_converter
@
array_converter
(
apply_to
=
(
'val'
,
))
...
...
mmdet3d/
core/data_
structures/det3d_data_sample.py
→
mmdet3d/structures/det3d_data_sample.py
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
from
typing
import
Dict
,
List
,
Optional
,
Tuple
,
Union
import
torch
from
mmengine.data
import
InstanceData
from
mmdet.
core.data_
structures
import
DetDataSample
from
mmdet.structures
import
DetDataSample
from
.point_data
import
PointData
...
...
@@ -54,8 +57,8 @@ class Det3DDataSample(DetDataSample):
Examples:
>>> from mmengine.data import InstanceData
>>> from mmdet3d.
co
re import Det3DDataSample
>>> from mmdet3d.
core.bbox
import BaseInstance3DBoxes
>>> from mmdet3d.
structu
re
s
import Det3DDataSample
>>> from mmdet3d.
structures
import BaseInstance3DBoxes
>>> data_sample = Det3DDataSample()
>>> meta_info = dict(img_shape=(800, 1196, 3),
...
...
@@ -109,7 +112,7 @@ class Det3DDataSample(DetDataSample):
>>> assert 'pred_instances' in data_sample
>>> pred_instances_3d = InstanceData(metainfo=meta_info)
>>> pred_instances_3d.bbox
es
_3d = BaseInstance3DBoxes(torch.rand((5, 7)))
>>> pred_instances_3d.bbox_3d = BaseInstance3DBoxes(torch.rand((5, 7)))
>>> pred_instances_3d.scores_3d = torch.rand((5, ))
>>> pred_instances_3d.labels_3d = torch.rand((5, ))
>>> data_sample = Det3DDataSample(pred_instances_3d=pred_instances_3d)
...
...
@@ -225,3 +228,9 @@ class Det3DDataSample(DetDataSample):
@
pred_pts_seg
.
deleter
def
pred_pts_seg
(
self
):
del
self
.
_pred_pts_seg
SampleList
=
List
[
Det3DDataSample
]
OptSampleList
=
Optional
[
SampleList
]
ForwardResults
=
Union
[
Dict
[
str
,
torch
.
Tensor
],
List
[
Det3DDataSample
],
Tuple
[
torch
.
Tensor
],
torch
.
Tensor
]
mmdet3d/structures/ops/__init__.py
0 → 100644
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
# yapf:disable
from
.box_np_ops
import
(
box2d_to_corner_jit
,
box3d_to_bbox
,
box_camera_to_lidar
,
boxes3d_to_corners3d_lidar
,
camera_to_lidar
,
center_to_corner_box2d
,
center_to_corner_box3d
,
center_to_minmax_2d
,
corner_to_standup_nd_jit
,
corner_to_surfaces_3d
,
corner_to_surfaces_3d_jit
,
corners_nd
,
create_anchors_3d_range
,
depth_to_lidar_points
,
depth_to_points
,
get_frustum
,
iou_jit
,
minmax_to_corner_2d
,
points_in_convex_polygon_3d_jit
,
points_in_convex_polygon_jit
,
points_in_rbbox
,
projection_matrix_to_CRT_kitti
,
rbbox2d_to_near_bbox
,
remove_outside_points
,
rotation_points_single_angle
,
surface_equ_3d
)
# yapf:enable
from
.iou3d_calculator
import
(
AxisAlignedBboxOverlaps3D
,
BboxOverlaps3D
,
BboxOverlapsNearest3D
,
axis_aligned_bbox_overlaps_3d
,
bbox_overlaps_3d
,
bbox_overlaps_nearest_3d
)
from
.transforms
import
bbox3d2result
,
bbox3d2roi
,
bbox3d_mapping_back
__all__
=
[
'box2d_to_corner_jit'
,
'box3d_to_bbox'
,
'box_camera_to_lidar'
,
'boxes3d_to_corners3d_lidar'
,
'camera_to_lidar'
,
'center_to_corner_box2d'
,
'center_to_corner_box3d'
,
'center_to_minmax_2d'
,
'corner_to_standup_nd_jit'
,
'corner_to_surfaces_3d'
,
'corner_to_surfaces_3d_jit'
,
'corners_nd'
,
'create_anchors_3d_range'
,
'depth_to_lidar_points'
,
'depth_to_points'
,
'get_frustum'
,
'iou_jit'
,
'minmax_to_corner_2d'
,
'points_in_convex_polygon_3d_jit'
,
'points_in_convex_polygon_jit'
,
'points_in_rbbox'
,
'projection_matrix_to_CRT_kitti'
,
'rbbox2d_to_near_bbox'
,
'remove_outside_points'
,
'rotation_points_single_angle'
,
'surface_equ_3d'
,
'BboxOverlapsNearest3D'
,
'BboxOverlaps3D'
,
'bbox_overlaps_nearest_3d'
,
'bbox_overlaps_3d'
,
'AxisAlignedBboxOverlaps3D'
,
'axis_aligned_bbox_overlaps_3d'
,
'bbox3d_mapping_back'
,
'bbox3d2roi'
,
'bbox3d2result'
]
mmdet3d/
core/bbox
/box_np_ops.py
→
mmdet3d/
structures/ops
/box_np_ops.py
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
# TODO: clean the functions in this file and move the APIs into box
structures
# TODO: clean the functions in this file and move the APIs into box
bbox_3d
# in the future
# NOTICE: All functions in this file are valid for LiDAR or depth boxes only
# if we use default parameters.
...
...
@@ -7,7 +7,8 @@
import
numba
import
numpy
as
np
from
.structures.utils
import
limit_period
,
points_cam2img
,
rotation_3d_in_axis
from
mmdet3d.structures.bbox_3d
import
(
limit_period
,
points_cam2img
,
rotation_3d_in_axis
)
def
camera_to_lidar
(
points
,
r_rect
,
velo2cam
):
...
...
mmdet3d/
core/bbox/iou_calculator
s/iou3d_calculator.py
→
mmdet3d/
structures/op
s/iou3d_calculator.py
View file @
c2fe651f
...
...
@@ -2,8 +2,8 @@
import
torch
from
mmdet3d.registry
import
TASK_UTILS
from
mmdet
.co
re.bbox
import
bbox_overlaps
from
.
.structures
import
get_box_type
from
mmdet
3d.structu
re
s
.bbox
_3d
import
get_box_type
from
mmdet
.structures
.bbox
import
bbox_overlaps
@
TASK_UTILS
.
register_module
()
...
...
mmdet3d/
core/bbox
/transforms.py
→
mmdet3d/
structures/ops
/transforms.py
View file @
c2fe651f
...
...
@@ -47,6 +47,7 @@ def bbox3d2roi(bbox_list):
return
rois
# TODO delete this
def
bbox3d2result
(
bboxes
,
scores
,
labels
,
attrs
=
None
):
"""Convert detection results to a list of numpy arrays.
...
...
mmdet3d/
core/data_
structures/point_data.py
→
mmdet3d/structures/point_data.py
View file @
c2fe651f
File moved
mmdet3d/
co
re/points/__init__.py
→
mmdet3d/
structu
re
s
/points/__init__.py
View file @
c2fe651f
File moved
mmdet3d/
co
re/points/base_points.py
→
mmdet3d/
structu
re
s
/points/base_points.py
View file @
c2fe651f
...
...
@@ -5,7 +5,7 @@ from abc import abstractmethod
import
numpy
as
np
import
torch
from
..bbox
.structures
.utils
import
rotation_3d_in_axis
from
..bbox
_3d
.utils
import
rotation_3d_in_axis
class
BasePoints
(
object
):
...
...
mmdet3d/
co
re/points/cam_points.py
→
mmdet3d/
structu
re
s
/points/cam_points.py
View file @
c2fe651f
...
...
@@ -58,6 +58,6 @@ class CameraPoints(BasePoints):
:obj:`BasePoints`: The converted point of the same type
in the `dst` mode.
"""
from
mmdet3d.
core.bbox
import
Coord3DMode
from
mmdet3d.
structures
import
Coord3DMode
return
Coord3DMode
.
convert_point
(
point
=
self
,
src
=
Coord3DMode
.
CAM
,
dst
=
dst
,
rt_mat
=
rt_mat
)
mmdet3d/
co
re/points/depth_points.py
→
mmdet3d/
structu
re
s
/points/depth_points.py
View file @
c2fe651f
...
...
@@ -53,6 +53,6 @@ class DepthPoints(BasePoints):
:obj:`BasePoints`: The converted point of the same type
in the `dst` mode.
"""
from
mmdet3d.
core.bbox
import
Coord3DMode
from
mmdet3d.
structures
import
Coord3DMode
return
Coord3DMode
.
convert_point
(
point
=
self
,
src
=
Coord3DMode
.
DEPTH
,
dst
=
dst
,
rt_mat
=
rt_mat
)
mmdet3d/
co
re/points/lidar_points.py
→
mmdet3d/
structu
re
s
/points/lidar_points.py
View file @
c2fe651f
...
...
@@ -53,6 +53,6 @@ class LiDARPoints(BasePoints):
:obj:`BasePoints`: The converted point of the same type
in the `dst` mode.
"""
from
mmdet3d.
core.bbox
import
Coord3DMode
from
mmdet3d.
structures
import
Coord3DMode
return
Coord3DMode
.
convert_point
(
point
=
self
,
src
=
Coord3DMode
.
LIDAR
,
dst
=
dst
,
rt_mat
=
rt_mat
)
mmdet3d/utils/__init__.py
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
from
mmcv.utils
import
Registry
,
build_from_cfg
,
print_log
from
.array_converter
import
ArrayConverter
,
array_converter
from
.collect_env
import
collect_env
from
.compat_cfg
import
compat_cfg
from
.logger
import
get_root_logger
from
.setup_env
import
register_all_modules
,
setup_multi_processes
from
.typing
import
(
ConfigType
,
InstanceList
,
MultiConfig
,
OptConfigType
,
OptInstanceList
,
OptMultiConfig
,
OptSamplingResultList
)
__all__
=
[
'Registry'
,
'build_from_cfg'
,
'get_root_logger'
,
'collect_env'
,
'print_log'
,
'setup_multi_processes'
,
'compat_cfg'
,
'register_all_modules'
'get_root_logger'
,
'collect_env'
,
'setup_multi_processes'
,
'compat_cfg'
,
'register_all_modules'
,
'find_latest_checkpoint'
,
'array_converter'
,
'ArrayConverter'
,
'ConfigType'
,
'OptConfigType'
,
'MultiConfig'
,
'OptMultiConfig'
,
'InstanceList'
,
'OptInstanceList'
,
'OptSamplingResultList'
]
mmdet3d/
core/
utils/array_converter.py
→
mmdet3d/utils/array_converter.py
View file @
c2fe651f
File moved
Prev
1
…
6
7
8
9
10
11
12
13
14
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