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
13124304
Unverified
Commit
13124304
authored
Sep 18, 2020
by
Kai Chen
Committed by
GitHub
Sep 18, 2020
Browse files
Merge pull request #113 from open-mmlab/migrage-collect-env
[refactor]: migrate to use collect_env in mmcv
parents
48011e56
6fd688a8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
132 deletions
+25
-132
docs/conf.py
docs/conf.py
+11
-8
mmdet3d/models/backbones/multi_backbone.py
mmdet3d/models/backbones/multi_backbone.py
+4
-4
mmdet3d/ops/__init__.py
mmdet3d/ops/__init__.py
+2
-2
mmdet3d/ops/utils/__init__.py
mmdet3d/ops/utils/__init__.py
+0
-4
mmdet3d/ops/utils/src/compiling_info.cpp
mmdet3d/ops/utils/src/compiling_info.cpp
+0
-56
mmdet3d/utils/collect_env.py
mmdet3d/utils/collect_env.py
+7
-53
setup.cfg
setup.cfg
+1
-1
setup.py
setup.py
+0
-4
No files found.
docs/conf.py
View file @
13124304
...
@@ -23,9 +23,17 @@ project = 'MMDetection3D'
...
@@ -23,9 +23,17 @@ project = 'MMDetection3D'
copyright
=
'2020-2023, OpenMMLab'
copyright
=
'2020-2023, OpenMMLab'
author
=
'MMDetection3D Authors'
author
=
'MMDetection3D Authors'
version_file
=
'../mmdet3d/version.py'
def
get_version
():
with
open
(
version_file
,
'r'
)
as
f
:
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
return
locals
()[
'__version__'
]
# The full version, including alpha/beta/rc tags
# The full version, including alpha/beta/rc tags
with
open
(
'../mmdet3d/VERSION'
,
'r'
)
as
f
:
release
=
get_version
()
release
=
f
.
read
().
strip
()
# -- General configuration ---------------------------------------------------
# -- General configuration ---------------------------------------------------
...
@@ -43,12 +51,7 @@ extensions = [
...
@@ -43,12 +51,7 @@ extensions = [
autodoc_mock_imports
=
[
autodoc_mock_imports
=
[
'cv2'
,
'matplotlib'
,
'nuscenes'
,
'PIL'
,
'pycocotools'
,
'pyquaternion'
,
'cv2'
,
'matplotlib'
,
'nuscenes'
,
'PIL'
,
'pycocotools'
,
'pyquaternion'
,
'terminaltables'
,
'mmcv'
,
'mmdet'
,
'mmdet3d.version'
,
'terminaltables'
,
'mmcv'
,
'mmdet'
,
'mmdet3d.version'
,
'mmdet3d.ops'
'mmdet3d.ops.ball_query'
,
'mmdet3d.ops.furthest_point_sample'
,
'mmdet3d.ops.gather_points'
,
'mmdet3d.ops.group_points'
,
'mmdet3d.ops.interpolate'
,
'mmdet3d.ops.roiaware_pool3d'
,
'mmdet3d.ops.spconv'
,
'mmdet3d.ops.voxel.voxel_layer'
,
'mmdet3d.ops.iou3d'
,
'mmdet3d.ops.utils'
]
]
autosectionlabel_prefix_document
=
True
autosectionlabel_prefix_document
=
True
...
...
mmdet3d/models/backbones/multi_backbone.py
View file @
13124304
...
@@ -97,13 +97,13 @@ class MultiBackbone(nn.Module):
...
@@ -97,13 +97,13 @@ class MultiBackbone(nn.Module):
dict[str, list[torch.Tensor]]: Outputs from multiple backbones.
dict[str, list[torch.Tensor]]: Outputs from multiple backbones.
- fp_xyz[suffix] (list[torch.Tensor]): The coordinates of
- fp_xyz[suffix] (list[torch.Tensor]): The coordinates of
each fp features.
each fp features.
- fp_features[suffix] (list[torch.Tensor]): The features
- fp_features[suffix] (list[torch.Tensor]): The features
from each Feature Propagate Layers.
from each Feature Propagate Layers.
- fp_indices[suffix] (list[torch.Tensor]): Indices of the
- fp_indices[suffix] (list[torch.Tensor]): Indices of the
input points.
input points.
- hd_feature (torch.Tensor): The aggregation feature
- hd_feature (torch.Tensor): The aggregation feature
from multiple backbones.
from multiple backbones.
"""
"""
ret
=
{}
ret
=
{}
fp_features
=
[]
fp_features
=
[]
...
...
mmdet3d/ops/__init__.py
View file @
13124304
from
mmcv.ops
import
(
RoIAlign
,
SigmoidFocalLoss
,
nms
,
roi_align
,
from
mmcv.ops
import
(
RoIAlign
,
SigmoidFocalLoss
,
get_compiler_version
,
get_compiling_cuda_version
,
nms
,
roi_align
,
sigmoid_focal_loss
)
sigmoid_focal_loss
)
from
.ball_query
import
ball_query
from
.ball_query
import
ball_query
...
@@ -15,7 +16,6 @@ from .roiaware_pool3d import (RoIAwarePool3d, points_in_boxes_batch,
...
@@ -15,7 +16,6 @@ from .roiaware_pool3d import (RoIAwarePool3d, points_in_boxes_batch,
points_in_boxes_cpu
,
points_in_boxes_gpu
)
points_in_boxes_cpu
,
points_in_boxes_gpu
)
from
.sparse_block
import
(
SparseBasicBlock
,
SparseBottleneck
,
from
.sparse_block
import
(
SparseBasicBlock
,
SparseBottleneck
,
make_sparse_convmodule
)
make_sparse_convmodule
)
from
.utils
import
get_compiler_version
,
get_compiling_cuda_version
from
.voxel
import
DynamicScatter
,
Voxelization
,
dynamic_scatter
,
voxelization
from
.voxel
import
DynamicScatter
,
Voxelization
,
dynamic_scatter
,
voxelization
__all__
=
[
__all__
=
[
...
...
mmdet3d/ops/utils/__init__.py
deleted
100644 → 0
View file @
48011e56
# 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
deleted
100644 → 0
View file @
48011e56
// 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 @
13124304
import
cv2
from
mmcv.utils
import
collect_env
as
collect_base_env
import
mmcv
from
mmcv.utils
import
get_git_hash
import
subprocess
import
sys
import
torch
import
torchvision
from
collections
import
defaultdict
from
os
import
path
as
osp
import
mmdet
import
mmdet
import
mmdet3d
import
mmdet3d
def
collect_env
():
def
collect_env
():
"""Collect and print the information of running enviroments."""
"""Collect the information of the running environments."""
env_info
=
{}
env_info
=
collect_base_env
()
env_info
[
'sys.platform'
]
=
sys
.
platform
env_info
[
'Python'
]
=
sys
.
version
.
replace
(
'
\n
'
,
''
)
cuda_available
=
torch
.
cuda
.
is_available
()
env_info
[
'CUDA available'
]
=
cuda_available
if
cuda_available
:
from
torch.utils.cpp_extension
import
CUDA_HOME
env_info
[
'CUDA_HOME'
]
=
CUDA_HOME
if
CUDA_HOME
is
not
None
and
osp
.
isdir
(
CUDA_HOME
):
try
:
nvcc
=
osp
.
join
(
CUDA_HOME
,
'bin/nvcc'
)
nvcc
=
subprocess
.
check_output
(
'"{}" -V | tail -n1'
.
format
(
nvcc
),
shell
=
True
)
nvcc
=
nvcc
.
decode
(
'utf-8'
).
strip
()
except
subprocess
.
SubprocessError
:
nvcc
=
'Not Available'
env_info
[
'NVCC'
]
=
nvcc
devices
=
defaultdict
(
list
)
for
k
in
range
(
torch
.
cuda
.
device_count
()):
devices
[
torch
.
cuda
.
get_device_name
(
k
)].
append
(
str
(
k
))
for
name
,
devids
in
devices
.
items
():
env_info
[
'GPU '
+
','
.
join
(
devids
)]
=
name
gcc
=
subprocess
.
check_output
(
'gcc --version | head -n1'
,
shell
=
True
)
gcc
=
gcc
.
decode
(
'utf-8'
).
strip
()
env_info
[
'GCC'
]
=
gcc
env_info
[
'PyTorch'
]
=
torch
.
__version__
env_info
[
'PyTorch compiling details'
]
=
torch
.
__config__
.
show
()
env_info
[
'TorchVision'
]
=
torchvision
.
__version__
env_info
[
'OpenCV'
]
=
cv2
.
__version__
env_info
[
'MMCV'
]
=
mmcv
.
__version__
env_info
[
'MMDetection'
]
=
mmdet
.
__version__
env_info
[
'MMDetection'
]
=
mmdet
.
__version__
env_info
[
'MMDetection3D'
]
=
mmdet3d
.
__version__
env_info
[
'MMDetection3D'
]
=
mmdet3d
.
__version__
+
'+'
+
get_git_hash
()[:
7
]
from
mmdet3d.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
return
env_info
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
for
name
,
val
in
collect_env
().
items
():
for
name
,
val
in
collect_env
().
items
():
print
(
'{}: {
}'
.
format
(
name
,
val
)
)
print
(
f
'
{
name
}
:
{
val
}
'
)
setup.cfg
View file @
13124304
...
@@ -8,6 +8,6 @@ line_length = 79
...
@@ -8,6 +8,6 @@ line_length = 79
multi_line_output = 0
multi_line_output = 0
known_standard_library = setuptools
known_standard_library = setuptools
known_first_party = mmdet,mmdet3d
known_first_party = mmdet,mmdet3d
known_third_party =
cv2,
load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,recommonmark,scannet_utils,scipy,seaborn,shapely,skimage,terminaltables,torch,
torchvision,
trimesh
known_third_party = load_scannet_data,lyft_dataset_sdk,m2r,matplotlib,mmcv,nuimages,numba,numpy,nuscenes,pandas,plyfile,pycocotools,pyquaternion,pytest,recommonmark,scannet_utils,scipy,seaborn,shapely,skimage,terminaltables,torch,trimesh
no_lines_before = STDLIB,LOCALFOLDER
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
default_section = THIRDPARTY
setup.py
View file @
13124304
...
@@ -168,10 +168,6 @@ if __name__ == '__main__':
...
@@ -168,10 +168,6 @@ if __name__ == '__main__':
'optional'
:
parse_requirements
(
'requirements/optional.txt'
),
'optional'
:
parse_requirements
(
'requirements/optional.txt'
),
},
},
ext_modules
=
[
ext_modules
=
[
make_cuda_ext
(
name
=
'compiling_info'
,
module
=
'mmdet3d.ops.utils'
,
sources
=
[
'src/compiling_info.cpp'
]),
make_cuda_ext
(
make_cuda_ext
(
name
=
'sparse_conv_ext'
,
name
=
'sparse_conv_ext'
,
module
=
'mmdet3d.ops.spconv'
,
module
=
'mmdet3d.ops.spconv'
,
...
...
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