"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "56fd4e4ef2bd1b7b4fe4f1bcc834a7bdcff73153"
Commit 62d7210f authored by wuyuefeng's avatar wuyuefeng
Browse files

little changes

parent 6aa820ee
...@@ -224,8 +224,7 @@ class SparseUNet(nn.Module): ...@@ -224,8 +224,7 @@ class SparseUNet(nn.Module):
kernel_size, kernel_size,
padding=padding, padding=padding,
bias=False, bias=False,
indice_key=indice_key), indice_key=indice_key))
)
elif conv_type == 'spconv': elif conv_type == 'spconv':
m = spconv.SparseSequential( m = spconv.SparseSequential(
build_norm_layer(norm_cfg, in_channels)[1], build_norm_layer(norm_cfg, in_channels)[1],
...@@ -237,8 +236,7 @@ class SparseUNet(nn.Module): ...@@ -237,8 +236,7 @@ class SparseUNet(nn.Module):
stride=stride, stride=stride,
padding=padding, padding=padding,
bias=False, bias=False,
indice_key=indice_key), indice_key=indice_key))
)
elif conv_type == 'inverseconv': elif conv_type == 'inverseconv':
m = spconv.SparseSequential( m = spconv.SparseSequential(
build_norm_layer(norm_cfg, in_channels)[1], build_norm_layer(norm_cfg, in_channels)[1],
...@@ -248,8 +246,7 @@ class SparseUNet(nn.Module): ...@@ -248,8 +246,7 @@ class SparseUNet(nn.Module):
out_channels, out_channels,
kernel_size, kernel_size,
bias=False, bias=False,
indice_key=indice_key), indice_key=indice_key))
)
else: else:
raise NotImplementedError raise NotImplementedError
return m return m
...@@ -290,8 +287,7 @@ class SparseUNet(nn.Module): ...@@ -290,8 +287,7 @@ class SparseUNet(nn.Module):
bias=False, bias=False,
indice_key=indice_key), indice_key=indice_key),
build_norm_layer(norm_cfg, out_channels)[1], build_norm_layer(norm_cfg, out_channels)[1],
nn.ReLU(inplace=True), nn.ReLU(inplace=True))
)
elif conv_type == 'spconv': elif conv_type == 'spconv':
m = spconv.SparseSequential( m = spconv.SparseSequential(
spconv.SparseConv3d( spconv.SparseConv3d(
...@@ -303,8 +299,7 @@ class SparseUNet(nn.Module): ...@@ -303,8 +299,7 @@ class SparseUNet(nn.Module):
bias=False, bias=False,
indice_key=indice_key), indice_key=indice_key),
build_norm_layer(norm_cfg, out_channels)[1], build_norm_layer(norm_cfg, out_channels)[1],
nn.ReLU(inplace=True), nn.ReLU(inplace=True))
)
elif conv_type == 'inverseconv': elif conv_type == 'inverseconv':
m = spconv.SparseSequential( m = spconv.SparseSequential(
spconv.SparseInverseConv3d( spconv.SparseInverseConv3d(
......
...@@ -5,9 +5,7 @@ from mmdet.models.backbones.resnet import BasicBlock, Bottleneck ...@@ -5,9 +5,7 @@ from mmdet.models.backbones.resnet import BasicBlock, Bottleneck
from mmdet.ops import build_norm_layer from mmdet.ops import build_norm_layer
from mmdet.ops.conv import conv_cfg from mmdet.ops.conv import conv_cfg
conv_cfg.update({ conv_cfg.update({'SubMConv3d': spconv.SubMConv3d})
'SubMConv3d': spconv.SubMConv3d,
})
def conv3x3(in_planes, out_planes, stride=1, indice_key=None): def conv3x3(in_planes, out_planes, stride=1, indice_key=None):
......
...@@ -19,23 +19,10 @@ def test_RoIAwarePool3d(): ...@@ -19,23 +19,10 @@ def test_RoIAwarePool3d():
dtype=torch.float32).cuda( dtype=torch.float32).cuda(
) # boxes (m, 7) with bottom center in lidar coordinate ) # boxes (m, 7) with bottom center in lidar coordinate
pts = torch.tensor( pts = torch.tensor(
[ [[1, 2, 3.3], [1.2, 2.5, 3.0], [0.8, 2.1, 3.5], [1.6, 2.6, 3.6],
[1, 2, 3.3], [0.8, 1.2, 3.9], [-9.2, 21.0, 18.2], [3.8, 7.9, 6.3],
[1.2, 2.5, 3.0], [4.7, 3.5, -12.2], [3.8, 7.6, -2], [-10.6, -12.9, -20], [-16, -18, 9],
[0.8, 2.1, 3.5], [-21.3, -52, -5], [0, 0, 0], [6, 7, 8], [-2, -3, -4]],
[1.6, 2.6, 3.6],
[0.8, 1.2, 3.9],
[-9.2, 21.0, 18.2],
[3.8, 7.9, 6.3],
[4.7, 3.5, -12.2],
[3.8, 7.6, -2],
[-10.6, -12.9, -20],
[-16, -18, 9],
[-21.3, -52, -5],
[0, 0, 0],
[6, 7, 8],
[-2, -3, -4],
],
dtype=torch.float32).cuda() # points (n, 3) in lidar coordinate dtype=torch.float32).cuda() # points (n, 3) in lidar coordinate
pts_feature = pts.clone() pts_feature = pts.clone()
...@@ -83,23 +70,10 @@ def test_points_in_boxes_cpu(): ...@@ -83,23 +70,10 @@ def test_points_in_boxes_cpu():
dtype=torch.float32 dtype=torch.float32
) # boxes (m, 7) with bottom center in lidar coordinate ) # boxes (m, 7) with bottom center in lidar coordinate
pts = torch.tensor( pts = torch.tensor(
[ [[1, 2, 3.3], [1.2, 2.5, 3.0], [0.8, 2.1, 3.5], [1.6, 2.6, 3.6],
[1, 2, 3.3], [0.8, 1.2, 3.9], [-9.2, 21.0, 18.2], [3.8, 7.9, 6.3],
[1.2, 2.5, 3.0], [4.7, 3.5, -12.2], [3.8, 7.6, -2], [-10.6, -12.9, -20], [-16, -18, 9],
[0.8, 2.1, 3.5], [-21.3, -52, -5], [0, 0, 0], [6, 7, 8], [-2, -3, -4]],
[1.6, 2.6, 3.6],
[0.8, 1.2, 3.9],
[-9.2, 21.0, 18.2],
[3.8, 7.9, 6.3],
[4.7, 3.5, -12.2],
[3.8, 7.6, -2],
[-10.6, -12.9, -20],
[-16, -18, 9],
[-21.3, -52, -5],
[0, 0, 0],
[6, 7, 8],
[-2, -3, -4],
],
dtype=torch.float32) # points (n, 3) in lidar coordinate dtype=torch.float32) # points (n, 3) in lidar coordinate
point_indices = points_in_boxes_cpu(points=pts, boxes=boxes) point_indices = points_in_boxes_cpu(points=pts, boxes=boxes)
...@@ -109,9 +83,3 @@ def test_points_in_boxes_cpu(): ...@@ -109,9 +83,3 @@ def test_points_in_boxes_cpu():
dtype=torch.int32) dtype=torch.int32)
assert point_indices.shape == torch.Size([2, 15]) assert point_indices.shape == torch.Size([2, 15])
assert (point_indices == expected_point_indices).all() assert (point_indices == expected_point_indices).all()
if __name__ == '__main__':
test_points_in_boxes_cpu()
test_points_in_boxes_gpu()
test_RoIAwarePool3d()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment