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
15 changed files
with
28 additions
and
21 deletions
+28
-21
tests/test_models/test_fusion_layers/test_point_fusion.py
tests/test_models/test_fusion_layers/test_point_fusion.py
+1
-1
tests/test_models/test_fusion_layers/test_vote_fusion.py
tests/test_models/test_fusion_layers/test_vote_fusion.py
+1
-1
tests/test_models/test_losses.py
tests/test_models/test_losses.py
+1
-1
tests/test_models/test_preprocessors/test_data_preprocessor.py
.../test_models/test_preprocessors/test_data_preprocessor.py
+2
-2
tests/test_models/test_voxel_encoders/test_voxel_generator.py
...s/test_models/test_voxel_encoders/test_voxel_generator.py
+1
-1
tests/utils/data_utils.py
tests/utils/data_utils.py
+1
-1
tests/utils/model_utils.py
tests/utils/model_utils.py
+6
-5
tools/analysis_tools/benchmark.py
tools/analysis_tools/benchmark.py
+6
-1
tools/data_converter/create_gt_database.py
tools/data_converter/create_gt_database.py
+2
-2
tools/data_converter/kitti_converter.py
tools/data_converter/kitti_converter.py
+2
-1
tools/data_converter/nuscenes_converter.py
tools/data_converter/nuscenes_converter.py
+1
-1
tools/data_converter/update_infos_to_v2.py
tools/data_converter/update_infos_to_v2.py
+1
-1
tools/deployment/mmdet3d_handler.py
tools/deployment/mmdet3d_handler.py
+1
-1
tools/misc/fuse_conv_bn.py
tools/misc/fuse_conv_bn.py
+1
-1
tools/update_data_coords.py
tools/update_data_coords.py
+1
-1
No files found.
tests/test_models/test_fusion_layers/test_point_fusion.py
View file @
c2fe651f
...
...
@@ -7,7 +7,7 @@ CommandLine:
import
torch
from
mmdet3d.models.fusion_layers
import
PointFusion
from
mmdet3d.models.
layers.
fusion_layers
import
PointFusion
def
test_sample_single
():
...
...
tests/test_models/test_fusion_layers/test_vote_fusion.py
View file @
c2fe651f
...
...
@@ -7,7 +7,7 @@ CommandLine:
import
torch
from
mmdet3d.models.fusion_layers
import
VoteFusion
from
mmdet3d.models.
layers.
fusion_layers
import
VoteFusion
def
test_vote_fusion
():
...
...
tests/test_models/test_losses.py
View file @
c2fe651f
...
...
@@ -98,8 +98,8 @@ def test_chamfer_disrance():
def
test_paconv_regularization_loss
():
from
mmdet3d.models.layers
import
PAConv
,
PAConvCUDA
from
mmdet3d.models.losses
import
PAConvRegularizationLoss
from
mmdet3d.ops
import
PAConv
,
PAConvCUDA
class
ToyModel
(
nn
.
Module
):
...
...
tests/test_models/test_preprocessors/test_data_preprocessor.py
View file @
c2fe651f
...
...
@@ -3,8 +3,8 @@ from unittest import TestCase
import
torch
from
mmdet3d.core
import
Det3DDataSample
from
mmdet3d.models.data_preprocessors
import
Det3DDataPreprocessor
from
mmdet3d.structures
import
Det3DDataSample
class
TestDet3DDataPreprocessor
(
TestCase
):
...
...
@@ -33,7 +33,7 @@ class TestDet3DDataPreprocessor(TestCase):
processor
=
Det3DDataPreprocessor
(
mean
=
[
0
,
0
,
0
],
std
=
[
1
,
1
,
1
])
points
=
torch
.
randn
((
5000
,
3
))
image
=
torch
.
randint
(
0
,
256
,
(
3
,
11
,
10
))
image
=
torch
.
randint
(
0
,
256
,
(
3
,
11
,
10
))
.
float
()
inputs_dict
=
dict
(
points
=
points
,
img
=
image
)
data
=
[{
'inputs'
:
inputs_dict
,
'data_sample'
:
Det3DDataSample
()}]
...
...
tests/test_models/test_voxel_encoders/test_voxel_generator.py
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
import
numpy
as
np
from
mmdet3d.
core.voxel.voxel_generator
import
VoxelGenerator
from
mmdet3d.
models.task_modules.voxel
import
VoxelGenerator
def
test_voxel_generator
():
...
...
tests/utils/data_utils.py
View file @
c2fe651f
# Copyright (c) OpenMMLab. All rights reserved.
import
numpy
as
np
from
mmdet3d.core
import
LiDARInstance3DBoxes
# create a dummy `results` to test the pipeline
from
mmdet3d.datasets
import
LoadAnnotations3D
,
LoadPointsFromFile
from
mmdet3d.structures
import
LiDARInstance3DBoxes
def
create_dummy_data_info
(
with_ann
=
True
):
...
...
tests/utils/model_utils.py
View file @
c2fe651f
...
...
@@ -7,8 +7,9 @@ import numpy as np
import
torch
from
mmengine
import
InstanceData
from
mmdet3d.core
import
(
CameraInstance3DBoxes
,
DepthInstance3DBoxes
,
Det3DDataSample
,
LiDARInstance3DBoxes
,
PointData
)
from
mmdet3d.structures
import
(
CameraInstance3DBoxes
,
DepthInstance3DBoxes
,
Det3DDataSample
,
LiDARInstance3DBoxes
,
PointData
)
def
_setup_seed
(
seed
):
...
...
@@ -104,7 +105,6 @@ def _create_detector_inputs(seed=0,
points
=
torch
.
rand
([
num_points
,
points_feat_dim
])
else
:
points
=
None
if
with_img
:
if
isinstance
(
img_size
,
tuple
):
img
=
torch
.
rand
(
3
,
img_size
[
0
],
img_size
[
1
])
...
...
@@ -132,8 +132,9 @@ def _create_detector_inputs(seed=0,
gt_instance
=
InstanceData
()
gt_instance
.
labels
=
torch
.
randint
(
0
,
num_classes
,
[
num_gt_instance
])
gt_instance
.
bboxes
=
torch
.
rand
(
num_gt_instance
,
4
)
gt_instance
.
bboxes
[:,
2
:]
=
\
gt_instance
.
bboxes
[:,
:
2
]
+
gt_instance
.
bboxes
[:,
2
:]
gt_instance
.
bboxes
[:,
2
:]
=
gt_instance
.
bboxes
[:,
:
2
]
+
gt_instance
.
bboxes
[:,
2
:]
data_sample
.
gt_instances
=
gt_instance
data_sample
.
gt_pts_seg
=
PointData
()
...
...
tools/analysis_tools/benchmark.py
View file @
c2fe651f
...
...
@@ -7,7 +7,7 @@ from mmcv import Config
from
mmcv.parallel
import
MMDataParallel
from
mmcv.runner
import
load_checkpoint
,
wrap_fp16_model
from
mmdet3d.datasets
import
build_dataloader
,
build_dataset
from
mmdet3d.datasets
import
build_dataset
from
mmdet3d.models
import
build_detector
from
tools.misc.fuse_conv_bn
import
fuse_module
...
...
@@ -41,6 +41,11 @@ def main():
# build the dataloader
# TODO: support multiple images per gpu (only minor changes are needed)
dataset
=
build_dataset
(
cfg
.
data
.
test
)
# TODO fix this
def
build_dataloader
():
pass
data_loader
=
build_dataloader
(
dataset
,
samples_per_gpu
=
1
,
...
...
tools/data_converter/create_gt_database.py
View file @
c2fe651f
...
...
@@ -9,9 +9,9 @@ from mmcv.ops import roi_align
from
pycocotools
import
mask
as
maskUtils
from
pycocotools.coco
import
COCO
from
mmdet3d.core.bbox
import
box_np_ops
as
box_np_ops
from
mmdet3d.datasets
import
build_dataset
from
mmdet.core.evaluation.bbox_overlaps
import
bbox_overlaps
from
mmdet3d.structures.ops
import
box_np_ops
as
box_np_ops
from
mmdet.evaluation
import
bbox_overlaps
def
_poly2mask
(
mask_ann
,
img_h
,
img_w
):
...
...
tools/data_converter/kitti_converter.py
View file @
c2fe651f
...
...
@@ -6,7 +6,8 @@ import mmcv
import
numpy
as
np
from
nuscenes.utils.geometry_utils
import
view_points
from
mmdet3d.core.bbox
import
box_np_ops
,
points_cam2img
from
mmdet3d.structures
import
points_cam2img
from
mmdet3d.structures.ops
import
box_np_ops
from
.kitti_data_utils
import
WaymoInfoGatherer
,
get_kitti_image_info
from
.nuscenes_converter
import
post_process_coords
...
...
tools/data_converter/nuscenes_converter.py
View file @
c2fe651f
...
...
@@ -11,8 +11,8 @@ from nuscenes.utils.geometry_utils import view_points
from
pyquaternion
import
Quaternion
from
shapely.geometry
import
MultiPoint
,
box
from
mmdet3d.core.bbox
import
points_cam2img
from
mmdet3d.datasets
import
NuScenesDataset
from
mmdet3d.structures
import
points_cam2img
nus_categories
=
(
'car'
,
'truck'
,
'trailer'
,
'bus'
,
'construction_vehicle'
,
'bicycle'
,
'motorcycle'
,
'pedestrian'
,
'traffic_cone'
,
...
...
tools/data_converter/update_infos_to_v2.py
View file @
c2fe651f
...
...
@@ -16,9 +16,9 @@ import mmcv
import
numpy
as
np
from
nuscenes.nuscenes
import
NuScenes
from
mmdet3d.core.bbox
import
points_cam2img
from
mmdet3d.datasets.convert_utils
import
get_2d_boxes
from
mmdet3d.datasets.utils
import
convert_quaternion_to_matrix
from
mmdet3d.structures
import
points_cam2img
def
get_empty_instance
():
...
...
tools/deployment/mmdet3d_handler.py
View file @
c2fe651f
...
...
@@ -7,7 +7,7 @@ import torch
from
ts.torch_handler.base_handler
import
BaseHandler
from
mmdet3d.apis
import
inference_detector
,
init_model
from
mmdet3d.
co
re.points
import
get_points_type
from
mmdet3d.
structu
re
s
.points
import
get_points_type
class
MMdet3dHandler
(
BaseHandler
):
...
...
tools/misc/fuse_conv_bn.py
View file @
c2fe651f
...
...
@@ -12,7 +12,7 @@ def fuse_conv_bn(conv, bn):
"""During inference, the functionary of batch norm layers is turned off but
only the mean and var alone channels are used, which exposes the chance to
fuse it with the preceding conv layers to save computations and simplify
network
structures
."""
network
bboxes_3d
."""
conv_w
=
conv
.
weight
conv_b
=
conv
.
bias
if
conv
.
bias
is
not
None
else
torch
.
zeros_like
(
bn
.
running_mean
)
...
...
tools/update_data_coords.py
View file @
c2fe651f
...
...
@@ -5,7 +5,7 @@ from os import path as osp
import
mmcv
import
numpy
as
np
from
mmdet3d.
core.bbox
import
limit_period
from
mmdet3d.
structures
import
limit_period
def
update_sunrgbd_infos
(
root_dir
,
out_dir
,
pkl_files
):
...
...
Prev
1
…
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