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
21599119
Commit
21599119
authored
May 05, 2020
by
zhangwenwei
Browse files
Merge branch 'master' of gitlab.sz.sensetime.com:open-mmlab/mmdet.3d into fix-train-runtime
parents
185ec6e8
343267ed
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
41 additions
and
43 deletions
+41
-43
mmdet3d/models/detectors/mvx_two_stage.py
mmdet3d/models/detectors/mvx_two_stage.py
+1
-1
mmdet3d/models/detectors/parta2.py
mmdet3d/models/detectors/parta2.py
+1
-1
mmdet3d/models/detectors/voxelnet.py
mmdet3d/models/detectors/voxelnet.py
+2
-2
mmdet3d/models/fusion_layers/point_fusion.py
mmdet3d/models/fusion_layers/point_fusion.py
+2
-3
mmdet3d/models/middle_encoders/pillar_scatter.py
mmdet3d/models/middle_encoders/pillar_scatter.py
+1
-1
mmdet3d/models/middle_encoders/sparse_encoder.py
mmdet3d/models/middle_encoders/sparse_encoder.py
+2
-2
mmdet3d/models/middle_encoders/sparse_unet.py
mmdet3d/models/middle_encoders/sparse_unet.py
+2
-2
mmdet3d/models/necks/second_fpn.py
mmdet3d/models/necks/second_fpn.py
+3
-4
mmdet3d/models/voxel_encoders/pillar_encoder.py
mmdet3d/models/voxel_encoders/pillar_encoder.py
+4
-4
mmdet3d/models/voxel_encoders/utils.py
mmdet3d/models/voxel_encoders/utils.py
+1
-2
mmdet3d/models/voxel_encoders/voxel_encoder.py
mmdet3d/models/voxel_encoders/voxel_encoder.py
+7
-7
mmdet3d/ops/__init__.py
mmdet3d/ops/__init__.py
+0
-1
mmdet3d/ops/norm.py
mmdet3d/ops/norm.py
+3
-9
mmdet3d/ops/sparse_block.py
mmdet3d/ops/sparse_block.py
+1
-4
mmdet3d/ops/spconv/conv.py
mmdet3d/ops/spconv/conv.py
+11
-0
No files found.
mmdet3d/models/detectors/mvx_two_stage.py
View file @
21599119
...
...
@@ -8,7 +8,7 @@ from .. import builder
from
.base
import
BaseDetector
@
DETECTORS
.
register_module
@
DETECTORS
.
register_module
()
class
MVXTwoStageDetector
(
BaseDetector
):
def
__init__
(
self
,
...
...
mmdet3d/models/detectors/parta2.py
View file @
21599119
...
...
@@ -6,7 +6,7 @@ from mmdet.models import DETECTORS, TwoStageDetector
from
..
import
builder
@
DETECTORS
.
register_module
@
DETECTORS
.
register_module
()
class
PartA2
(
TwoStageDetector
):
def
__init__
(
self
,
...
...
mmdet3d/models/detectors/voxelnet.py
View file @
21599119
...
...
@@ -6,7 +6,7 @@ from mmdet.models import DETECTORS, SingleStageDetector
from
..
import
builder
@
DETECTORS
.
register_module
@
DETECTORS
.
register_module
()
class
VoxelNet
(
SingleStageDetector
):
def
__init__
(
self
,
...
...
@@ -88,7 +88,7 @@ class VoxelNet(SingleStageDetector):
return
bbox_list
@
DETECTORS
.
register_module
@
DETECTORS
.
register_module
()
class
DynamicVoxelNet
(
VoxelNet
):
def
__init__
(
self
,
...
...
mmdet3d/models/fusion_layers/point_fusion.py
View file @
21599119
import
torch
import
torch.nn
as
nn
import
torch.nn.functional
as
F
from
mmcv.cnn
import
xavier_init
from
mmcv.cnn
import
ConvModule
,
xavier_init
from
mmdet.ops
import
ConvModule
from
..registry
import
FUSION_LAYERS
...
...
@@ -96,7 +95,7 @@ def point_sample(
return
point_features
.
squeeze
().
t
()
@
FUSION_LAYERS
.
register_module
@
FUSION_LAYERS
.
register_module
()
class
PointFusion
(
nn
.
Module
):
"""Fuse image features from fused single scale features
"""
...
...
mmdet3d/models/middle_encoders/pillar_scatter.py
View file @
21599119
...
...
@@ -4,7 +4,7 @@ from torch import nn
from
..registry
import
MIDDLE_ENCODERS
@
MIDDLE_ENCODERS
.
register_module
@
MIDDLE_ENCODERS
.
register_module
()
class
PointPillarsScatter
(
nn
.
Module
):
def
__init__
(
self
,
in_channels
,
output_shape
):
...
...
mmdet3d/models/middle_encoders/sparse_encoder.py
View file @
21599119
import
torch.nn
as
nn
from
mmcv.cnn
import
build_norm_layer
import
mmdet3d.ops.spconv
as
spconv
from
mmdet.ops
import
build_norm_layer
from
..registry
import
MIDDLE_ENCODERS
@
MIDDLE_ENCODERS
.
register_module
@
MIDDLE_ENCODERS
.
register_module
()
class
SparseEncoder
(
nn
.
Module
):
def
__init__
(
self
,
...
...
mmdet3d/models/middle_encoders/sparse_unet.py
View file @
21599119
import
torch
import
torch.nn
as
nn
from
mmcv.cnn
import
build_norm_layer
import
mmdet3d.ops.spconv
as
spconv
from
mmdet3d.ops
import
SparseBasicBlock
from
mmdet.ops
import
build_norm_layer
from
..registry
import
MIDDLE_ENCODERS
@
MIDDLE_ENCODERS
.
register_module
@
MIDDLE_ENCODERS
.
register_module
()
class
SparseUNet
(
nn
.
Module
):
def
__init__
(
self
,
...
...
mmdet3d/models/necks/second_fpn.py
View file @
21599119
...
...
@@ -2,16 +2,15 @@ from functools import partial
import
torch
import
torch.nn
as
nn
from
mmcv.cnn
import
constant_init
,
kaiming_init
from
mmcv.cnn
import
build_norm_layer
,
constant_init
,
kaiming_init
from
torch.nn
import
Sequential
from
torch.nn.modules.batchnorm
import
_BatchNorm
from
mmdet.models
import
NECKS
from
mmdet.ops
import
build_norm_layer
from
..
import
builder
@
NECKS
.
register_module
@
NECKS
.
register_module
()
class
SECONDFPN
(
nn
.
Module
):
"""Compare with RPN, RPNV2 support arbitrary number of stage.
"""
...
...
@@ -64,7 +63,7 @@ class SECONDFPN(nn.Module):
return
[
out
]
@
NECKS
.
register_module
@
NECKS
.
register_module
()
class
SECONDFusionFPN
(
SECONDFPN
):
"""Compare with RPN, RPNV2 support arbitrary number of stage.
"""
...
...
mmdet3d/models/voxel_encoders/pillar_encoder.py
View file @
21599119
import
torch
from
mmcv.cnn
import
build_norm_layer
from
torch
import
nn
from
mmdet3d.ops
import
DynamicScatter
from
mmdet.ops
import
build_norm_layer
from
..registry
import
VOXEL_ENCODERS
from
.utils
import
PFNLayer
,
get_paddings_indicator
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
PillarFeatureNet
(
nn
.
Module
):
def
__init__
(
self
,
...
...
@@ -118,7 +118,7 @@ class PillarFeatureNet(nn.Module):
return
features
.
squeeze
()
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
DynamicPillarFeatureNet
(
PillarFeatureNet
):
def
__init__
(
self
,
...
...
@@ -237,7 +237,7 @@ class DynamicPillarFeatureNet(PillarFeatureNet):
return
voxel_feats
,
voxel_coors
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
AlignedPillarFeatureNet
(
nn
.
Module
):
def
__init__
(
self
,
...
...
mmdet3d/models/voxel_encoders/utils.py
View file @
21599119
import
torch
from
mmcv.cnn
import
build_norm_layer
from
torch
import
nn
from
torch.nn
import
functional
as
F
from
mmdet.ops
import
build_norm_layer
class
Empty
(
nn
.
Module
):
...
...
mmdet3d/models/voxel_encoders/voxel_encoder.py
View file @
21599119
import
torch
from
mmcv.cnn
import
build_norm_layer
from
torch
import
nn
from
torch.nn
import
functional
as
F
from
mmdet3d.ops
import
DynamicScatter
from
mmdet.ops
import
build_norm_layer
from
..
import
builder
from
..registry
import
VOXEL_ENCODERS
from
.utils
import
Empty
,
VFELayer
,
get_paddings_indicator
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
VoxelFeatureExtractor
(
nn
.
Module
):
def
__init__
(
self
,
...
...
@@ -71,7 +71,7 @@ class VoxelFeatureExtractor(nn.Module):
return
voxelwise
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
VoxelFeatureExtractorV2
(
nn
.
Module
):
def
__init__
(
self
,
...
...
@@ -132,7 +132,7 @@ class VoxelFeatureExtractorV2(nn.Module):
return
voxelwise
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
VoxelFeatureExtractorV3
(
nn
.
Module
):
def
__init__
(
self
,
...
...
@@ -152,7 +152,7 @@ class VoxelFeatureExtractorV3(nn.Module):
return
points_mean
.
contiguous
()
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
DynamicVFEV3
(
nn
.
Module
):
def
__init__
(
self
,
...
...
@@ -170,7 +170,7 @@ class DynamicVFEV3(nn.Module):
return
features
,
features_coors
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
DynamicVFE
(
nn
.
Module
):
def
__init__
(
self
,
...
...
@@ -318,7 +318,7 @@ class DynamicVFE(nn.Module):
return
voxel_feats
,
voxel_coors
@
VOXEL_ENCODERS
.
register_module
@
VOXEL_ENCODERS
.
register_module
()
class
HardVFE
(
nn
.
Module
):
def
__init__
(
self
,
...
...
mmdet3d/ops/__init__.py
View file @
21599119
...
...
@@ -13,7 +13,6 @@ __all__ = [
'roi_align'
,
'get_compiler_version'
,
'get_compiling_cuda_version'
,
'build_conv_layer'
,
'NaiveSyncBatchNorm1d'
,
'NaiveSyncBatchNorm2d'
,
'batched_nms'
,
...
...
mmdet3d/ops/norm.py
View file @
21599119
import
torch
import
torch.distributed
as
dist
import
torch.nn
as
nn
from
mmcv.cnn
import
NORM_LAYERS
from
torch.autograd.function
import
Function
from
mmdet.ops.norm
import
norm_cfg
class
AllReduce
(
Function
):
...
...
@@ -24,6 +23,7 @@ class AllReduce(Function):
return
grad_output
@
NORM_LAYERS
.
register_module
(
'naiveSyncBN1d'
)
class
NaiveSyncBatchNorm1d
(
nn
.
BatchNorm1d
):
"""Syncronized Batch Normalization for 3D Tensors
...
...
@@ -68,6 +68,7 @@ class NaiveSyncBatchNorm1d(nn.BatchNorm1d):
return
input
*
scale
+
bias
@
NORM_LAYERS
.
register_module
(
'naiveSyncBN2d'
)
class
NaiveSyncBatchNorm2d
(
nn
.
BatchNorm2d
):
"""Syncronized Batch Normalization for 4D Tensors
...
...
@@ -110,10 +111,3 @@ class NaiveSyncBatchNorm2d(nn.BatchNorm2d):
scale
=
scale
.
reshape
(
1
,
-
1
,
1
,
1
)
bias
=
bias
.
reshape
(
1
,
-
1
,
1
,
1
)
return
input
*
scale
+
bias
norm_cfg
.
update
({
'BN1d'
:
(
'bn'
,
nn
.
BatchNorm1d
),
'naiveSyncBN2d'
:
(
'bn'
,
NaiveSyncBatchNorm2d
),
'naiveSyncBN1d'
:
(
'bn'
,
NaiveSyncBatchNorm1d
),
})
mmdet3d/ops/sparse_block.py
View file @
21599119
from
mmcv.cnn
import
build_norm_layer
from
torch
import
nn
import
mmdet3d.ops.spconv
as
spconv
from
mmdet.models.backbones.resnet
import
BasicBlock
,
Bottleneck
from
mmdet.ops
import
build_norm_layer
from
mmdet.ops.conv
import
conv_cfg
conv_cfg
.
update
({
'SubMConv3d'
:
spconv
.
SubMConv3d
})
def
conv3x3
(
in_planes
,
out_planes
,
stride
=
1
,
indice_key
=
None
):
...
...
mmdet3d/ops/spconv/conv.py
View file @
21599119
...
...
@@ -16,6 +16,7 @@ import math
import
numpy
as
np
import
torch
from
mmcv.cnn
import
CONV_LAYERS
from
torch.nn
import
init
from
torch.nn.parameter
import
Parameter
...
...
@@ -205,6 +206,7 @@ class SparseConvolution(SparseModule):
return
out_tensor
@
CONV_LAYERS
.
register_module
()
class
SparseConv2d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -230,6 +232,7 @@ class SparseConv2d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SparseConv3d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -255,6 +258,7 @@ class SparseConv3d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SparseConv4d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -280,6 +284,7 @@ class SparseConv4d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SparseConvTranspose2d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -306,6 +311,7 @@ class SparseConvTranspose2d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SparseConvTranspose3d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -332,6 +338,7 @@ class SparseConvTranspose3d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SparseInverseConv2d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -350,6 +357,7 @@ class SparseInverseConv2d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SparseInverseConv3d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -368,6 +376,7 @@ class SparseInverseConv3d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SubMConv2d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -394,6 +403,7 @@ class SubMConv2d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SubMConv3d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
@@ -420,6 +430,7 @@ class SubMConv3d(SparseConvolution):
indice_key
=
indice_key
)
@
CONV_LAYERS
.
register_module
()
class
SubMConv4d
(
SparseConvolution
):
def
__init__
(
self
,
...
...
Prev
1
2
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