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
4d437609
Commit
4d437609
authored
Jul 10, 2020
by
zhangwenwei
Browse files
Switch ops from mmdet to mmcv
parent
ce4f66b6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
7 deletions
+73
-7
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
mmdet3d/ops/__init__.py
mmdet3d/ops/__init__.py
+6
-4
mmdet3d/ops/utils/__init__.py
mmdet3d/ops/utils/__init__.py
+4
-0
mmdet3d/ops/utils/src/compiling_info.cpp
mmdet3d/ops/utils/src/compiling_info.cpp
+56
-0
mmdet3d/utils/collect_env.py
mmdet3d/utils/collect_env.py
+1
-1
setup.py
setup.py
+4
-0
tools/data_converter/create_gt_database.py
tools/data_converter/create_gt_database.py
+1
-1
No files found.
.gitlab-ci.yml
View file @
4d437609
...
...
@@ -28,7 +28,7 @@ linting:
script
:
-
echo "Start building..."
-
pip install -q "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"
-
pip install -q
git+https://github.com
/open
-
mmlab
/mmcv.git@v0.6.2
-
pip install -q
pip install mmcv==1.0rc0+torch1.3.0+cu101 -f https:/
/openmmlab
.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
-
pip install -q git+https://github.com/open-mmlab/mmdetection.git
-
python -c "import mmdet; print(mmdet.__version__)"
-
pip install -e .[all]
...
...
mmdet3d/ops/__init__.py
View file @
4d437609
from
mm
det
.ops
import
(
RoIAlign
,
SigmoidFocalLoss
,
get_compiler_versio
n
,
get_compiling_cuda_version
,
nms
,
roi_align
,
sigmoid_focal_loss
)
from
mm
cv
.ops
import
(
RoIAlign
,
SigmoidFocalLoss
,
nms
,
roi_alig
n
,
sigmoid_focal_loss
)
from
.ball_query
import
ball_query
from
.furthest_point_sample
import
furthest_point_sample
from
.gather_points
import
gather_points
...
...
@@ -13,6 +13,7 @@ from .roiaware_pool3d import (RoIAwarePool3d, points_in_boxes_batch,
points_in_boxes_cpu
,
points_in_boxes_gpu
)
from
.sparse_block
import
(
SparseBasicBlock
,
SparseBottleneck
,
make_sparse_convmodule
)
from
.utils
import
get_compiler_version
,
get_compiling_cuda_version
from
.voxel
import
DynamicScatter
,
Voxelization
,
dynamic_scatter
,
voxelization
__all__
=
[
...
...
@@ -25,5 +26,6 @@ __all__ = [
'make_sparse_convmodule'
,
'ball_query'
,
'furthest_point_sample'
,
'three_interpolate'
,
'three_nn'
,
'gather_points'
,
'grouping_operation'
,
'group_points'
,
'GroupAll'
,
'QueryAndGroup'
,
'PointSAModule'
,
'PointSAModuleMSG'
,
'PointFPModule'
,
'points_in_boxes_batch'
'PointSAModuleMSG'
,
'PointFPModule'
,
'points_in_boxes_batch'
,
'get_compiler_version'
,
'get_compiling_cuda_version'
]
mmdet3d/ops/utils/__init__.py
0 → 100644
View file @
4d437609
# from . import compiling_info
from
.compiling_info
import
get_compiler_version
,
get_compiling_cuda_version
__all__
=
[
'get_compiler_version'
,
'get_compiling_cuda_version'
]
mmdet3d/ops/utils/src/compiling_info.cpp
0 → 100644
View file @
4d437609
// modified from
// https://github.com/facebookresearch/detectron2/blob/master/detectron2/layers/csrc/vision.cpp
#include <torch/extension.h>
#ifdef WITH_CUDA
#include <cuda_runtime_api.h>
int
get_cudart_version
()
{
return
CUDART_VERSION
;
}
#endif
std
::
string
get_compiling_cuda_version
()
{
#ifdef WITH_CUDA
std
::
ostringstream
oss
;
// copied from
// https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/cuda/detail/CUDAHooks.cpp#L231
auto
printCudaStyleVersion
=
[
&
](
int
v
)
{
oss
<<
(
v
/
1000
)
<<
"."
<<
(
v
/
10
%
100
);
if
(
v
%
10
!=
0
)
{
oss
<<
"."
<<
(
v
%
10
);
}
};
printCudaStyleVersion
(
get_cudart_version
());
return
oss
.
str
();
#else
return
std
::
string
(
"not available"
);
#endif
}
// similar to
// https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/Version.cpp
std
::
string
get_compiler_version
()
{
std
::
ostringstream
ss
;
#if defined(__GNUC__)
#ifndef __clang__
{
ss
<<
"GCC "
<<
__GNUC__
<<
"."
<<
__GNUC_MINOR__
;
}
#endif
#endif
#if defined(__clang_major__)
{
ss
<<
"clang "
<<
__clang_major__
<<
"."
<<
__clang_minor__
<<
"."
<<
__clang_patchlevel__
;
}
#endif
#if defined(_MSC_VER)
{
ss
<<
"MSVC "
<<
_MSC_FULL_VER
;
}
#endif
return
ss
.
str
();
}
PYBIND11_MODULE
(
TORCH_EXTENSION_NAME
,
m
)
{
m
.
def
(
"get_compiler_version"
,
&
get_compiler_version
,
"get_compiler_version"
);
m
.
def
(
"get_compiling_cuda_version"
,
&
get_compiling_cuda_version
,
"get_compiling_cuda_version"
);
}
mmdet3d/utils/collect_env.py
View file @
4d437609
...
...
@@ -54,7 +54,7 @@ def collect_env():
env_info
[
'MMCV'
]
=
mmcv
.
__version__
env_info
[
'MMDetection'
]
=
mmdet
.
__version__
env_info
[
'MMDetection3D'
]
=
mmdet3d
.
__version__
from
mmdet.ops
import
get_compiler_version
,
get_compiling_cuda_version
from
mmdet
3d
.ops
import
get_compiler_version
,
get_compiling_cuda_version
env_info
[
'MMDetection3D Compiler'
]
=
get_compiler_version
()
env_info
[
'MMDetection3D CUDA Compiler'
]
=
get_compiling_cuda_version
()
return
env_info
...
...
setup.py
View file @
4d437609
...
...
@@ -225,6 +225,10 @@ if __name__ == '__main__':
'optional'
:
parse_requirements
(
'requirements/optional.txt'
),
},
ext_modules
=
[
make_cuda_ext
(
name
=
'compiling_info'
,
module
=
'mmdet.ops.utils'
,
sources
=
[
'src/compiling_info.cpp'
]),
make_cuda_ext
(
name
=
'sparse_conv_ext'
,
module
=
'mmdet3d.ops.spconv'
,
...
...
tools/data_converter/create_gt_database.py
View file @
4d437609
...
...
@@ -2,6 +2,7 @@ import mmcv
import
numpy
as
np
import
pickle
from
mmcv
import
track_iter_progress
from
mmcv.ops
import
roi_align
from
os
import
path
as
osp
from
pycocotools
import
mask
as
maskUtils
from
pycocotools.coco
import
COCO
...
...
@@ -9,7 +10,6 @@ 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
mmdet.ops
import
roi_align
def
_poly2mask
(
mask_ann
,
img_h
,
img_w
):
...
...
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