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
bb204696
Unverified
Commit
bb204696
authored
Jun 14, 2022
by
Wenwei Zhang
Committed by
GitHub
Jun 14, 2022
Browse files
Release v1.0.0rc3
Release v1.0.0rc3
parents
14c5ded4
dea954e5
Changes
117
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
427 additions
and
286 deletions
+427
-286
docs/zh_cn/faq.md
docs/zh_cn/faq.md
+5
-5
docs/zh_cn/getting_started.md
docs/zh_cn/getting_started.md
+35
-34
docs/zh_cn/model_zoo.md
docs/zh_cn/model_zoo.md
+4
-0
docs/zh_cn/supported_tasks/vision_det3d.md
docs/zh_cn/supported_tasks/vision_det3d.md
+114
-1
docs/zh_cn/tutorials/backends_support.md
docs/zh_cn/tutorials/backends_support.md
+5
-2
docs/zh_cn/tutorials/config.md
docs/zh_cn/tutorials/config.md
+5
-5
docs/zh_cn/tutorials/coord_sys_tutorial.md
docs/zh_cn/tutorials/coord_sys_tutorial.md
+58
-58
docs/zh_cn/tutorials/customize_dataset.md
docs/zh_cn/tutorials/customize_dataset.md
+49
-49
docs/zh_cn/tutorials/customize_runtime.md
docs/zh_cn/tutorials/customize_runtime.md
+37
-37
docs/zh_cn/tutorials/data_pipeline.md
docs/zh_cn/tutorials/data_pipeline.md
+53
-40
docs/zh_cn/tutorials/model_deployment.md
docs/zh_cn/tutorials/model_deployment.md
+17
-17
docs/zh_cn/useful_tools.md
docs/zh_cn/useful_tools.md
+26
-27
mmdet3d/__init__.py
mmdet3d/__init__.py
+1
-1
mmdet3d/core/post_processing/box3d_nms.py
mmdet3d/core/post_processing/box3d_nms.py
+4
-3
mmdet3d/datasets/builder.py
mmdet3d/datasets/builder.py
+4
-2
mmdet3d/datasets/custom_3d.py
mmdet3d/datasets/custom_3d.py
+3
-1
mmdet3d/datasets/custom_3d_seg.py
mmdet3d/datasets/custom_3d_seg.py
+2
-1
mmdet3d/datasets/pipelines/compose.py
mmdet3d/datasets/pipelines/compose.py
+2
-1
mmdet3d/datasets/s3dis_dataset.py
mmdet3d/datasets/s3dis_dataset.py
+2
-1
mmdet3d/models/builder.py
mmdet3d/models/builder.py
+1
-1
No files found.
docs/zh_cn/faq.md
View file @
bb204696
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
-
如果您在
`import open3d`
时遇到下面的问题:
-
如果您在
`import open3d`
时遇到下面的问题:
`
`OSError: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.27' not found`
`
`OSError: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.27' not found`
请将 open3d 的版本降级至 0.9.0.0,因为最新版 open3d 需要 'GLIBC_2.27' 文件的支持, Ubuntu 16.04 系统中缺失该文件,且该文件仅存在于 Ubuntu 18.04 及之后的系统中。
请将 open3d 的版本降级至 0.9.0.0,因为最新版 open3d 需要 'GLIBC_2.27' 文件的支持, Ubuntu 16.04 系统中缺失该文件,且该文件仅存在于 Ubuntu 18.04 及之后的系统中。
...
@@ -21,15 +21,15 @@
...
@@ -21,15 +21,15 @@
-
如果您在导入 pycocotools 相关包时遇到下面的问题:
-
如果您在导入 pycocotools 相关包时遇到下面的问题:
`
`ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject`
`
`ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject`
请将 pycocotools 的版本降级至 2.0.1,这是由于最新版本的 pycocotools 与 numpy < 1.20.0 不兼容。或者通过下面的方式从源码进行编译来安装最新版本的 pycocotools :
请将 pycocotools 的版本降级至 2.0.1,这是由于最新版本的 pycocotools 与 numpy
\
<
1.20.0 不兼容。或者通过下面的方式从源码进行编译来安装最新版本的 pycocotools :
`
`pip install -e "git+https://github.com/cocodataset/cocoapi#egg=pycocotools&subdirectory=PythonAPI"`
`
`pip install -e "git+https://github.com/cocodataset/cocoapi#egg=pycocotools&subdirectory=PythonAPI"`
或者
或者
`
`pip install -e "git+https://github.com/ppwwyyxx/cocoapi#egg=pycocotools&subdirectory=PythonAPI"`
`
`pip install -e "git+https://github.com/ppwwyyxx/cocoapi#egg=pycocotools&subdirectory=PythonAPI"`
## 如何标注点云?
## 如何标注点云?
...
...
docs/zh_cn/getting_started.md
View file @
bb204696
...
@@ -8,29 +8,30 @@
...
@@ -8,29 +8,30 @@
-
[
MMCV
](
https://mmcv.readthedocs.io/en/latest/#installation
)
-
[
MMCV
](
https://mmcv.readthedocs.io/en/latest/#installation
)
| MMDetection3D 版本 | MMDetection 版本 | MMSegmentation 版本 | MMCV 版本 |
| MMDetection3D 版本 | MMDetection 版本 | MMSegmentation 版本 | MMCV 版本 |
|:-------------------:|:-------------------:|:-------------------:|:-------------------:|
| :--------------: | :----------------------: | :---------------------: | :-------------------------: |
| master | mmdet>=2.19.0,
<
=3.0.0|
mmseg
>
=0.20.0,
<
=1.0.0
|
mmcv-full
>
=1.4.8, <=1.7.0|
| master | mmdet>=2.24.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.4.8,
\<
=1.6.0 |
| v1.0.0rc2 | mmdet>=2.19.0,
<
=3.0.0|
mmseg
>
=0.20.0,
<
=1.0.0
|
mmcv-full
>
=1.4.8, <=1.7.0|
| v1.0.0rc3 | mmdet>=2.24.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.4.8,
\<
=1.6.0 |
| v1.0.0rc1 | mmdet>=2.19.0,
<
=3.0.0|
mmseg
>
=0.20.0,
<
=1.0.0
|
mmcv-full
>
=1.4.8, <=1.5.0|
| v1.0.0rc2 | mmdet>=2.24.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.4.8,
\<
=1.6.0 |
| v1.0.0rc0 | mmdet>=2.19.0,
<
=3.0.0|
mmseg
>
=0.20.0,
<
=1.0.0
|
mmcv-full
>
=1.3.17, <=1.5.0|
| v1.0.0rc1 | mmdet>=2.19.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.4.8,
\<
=1.5.0 |
| 0.18.1 | mmdet>=2.19.0,
<
=3.0.0|
mmseg
>
=0.20.0,
<
=1.0.0
|
mmcv-full
>
=1.3.17, <=1.5.0|
| v1.0.0rc0 | mmdet>=2.19.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.3.17,
\<
=1.5.0 |
| 0.18.0 | mmdet>=2.19.0,
<
=3.0.0|
mmseg
>
=0.20.0,
<
=1.0.0
|
mmcv-full
>
=1.3.17, <=1.5.0|
| 0.18.1 | mmdet>=2.19.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.3.17,
\<
=1.5.0 |
| 0.17.3 | mmdet>=2.14.0,
<
=3.0.0|
mmseg
>
=0.14.1,
<
=1.0.0
|
mmcv-full
>
=1.3.8, <=1.4.0|
| 0.18.0 | mmdet>=2.19.0,
\<
=3.0.0 | mmseg>=0.20.0,
\<
=1.0.0 | mmcv-full>=1.3.17,
\<
=1.5.0 |
| 0.17.2 | mmdet>=2.14.0,
<
=3.0.0|
mmseg
>
=0.14.1,
<
=1.0.0
|
mmcv-full
>
=1.3.8, <=1.4.0|
| 0.17.3 | mmdet>=2.14.0,
\<
=3.0.0 | mmseg>=0.14.1,
\<
=1.0.0 | mmcv-full>=1.3.8,
\<
=1.4.0 |
| 0.17.1 | mmdet>=2.14.0,
<
=3.0.0|
mmseg
>
=0.14.1,
<
=1.0.0
|
mmcv-full
>
=1.3.8, <=1.4.0|
| 0.17.2 | mmdet>=2.14.0,
\<
=3.0.0 | mmseg>=0.14.1,
\<
=1.0.0 | mmcv-full>=1.3.8,
\<
=1.4.0 |
| 0.17.0 | mmdet>=2.14.0,
<
=3.0.0|
mmseg
>
=0.14.1,
<
=1.0.0
|
mmcv-full
>
=1.3.8, <=1.4.0|
| 0.17.1 | mmdet>=2.14.0,
\<
=3.0.0 | mmseg>=0.14.1,
\<
=1.0.0 | mmcv-full>=1.3.8,
\<
=1.4.0 |
| 0.16.0 | mmdet>=2.14.0,
<
=3.0.0|
mmseg
>
=0.14.1,
<
=1.0.0
|
mmcv-full
>
=1.3.8, <=1.4.0|
| 0.17.0 | mmdet>=2.14.0,
\<
=3.0.0 | mmseg>=0.14.1,
\<
=1.0.0 | mmcv-full>=1.3.8,
\<
=1.4.0 |
| 0.15.0 | mmdet>=2.14.0,
<
=3.0.0|
mmseg
>
=0.14.1,
<
=1.0.0
|
mmcv-full
>
=1.3.8, <=1.4.0|
| 0.16.0 | mmdet>=2.14.0,
\<
=3.0.0 | mmseg>=0.14.1,
\<
=1.0.0 | mmcv-full>=1.3.8,
\<
=1.4.0 |
| 0.14.0 | mmdet>=2.10.0,
<
=2.11.0|
mmseg=
=0.14.0
|
mmcv-full
>
=1.3.1, <=1.4.0|
| 0.15.0 | mmdet>=2.14.0,
\<
=3.0.0 | mmseg>=0.14.1,
\<
=1.0.0 | mmcv-full>=1.3.8,
\<
=1.4.0 |
| 0.13.0 | mmdet>=2.10.0,
<
=2.11.0|
Not
required
|
mmcv-full
>
=1.2.4, <=1.4.0|
| 0.14.0 | mmdet>=2.10.0,
\<
=2.11.0 | mmseg==0.14.0 | mmcv-full>=1.3.1,
\<
=1.4.0 |
| 0.12.0 | mmdet>=2.5.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.2.4, <=1.4.0|
| 0.13.0 | mmdet>=2.10.0,
\<
=2.11.0 | Not required | mmcv-full>=1.2.4,
\<
=1.4.0 |
| 0.11.0 | mmdet>=2.5.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.2.4, <=1.3.0|
| 0.12.0 | mmdet>=2.5.0,
\<
=2.11.0 | Not required | mmcv-full>=1.2.4,
\<
=1.4.0 |
| 0.10.0 | mmdet>=2.5.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.2.4, <=1.3.0|
| 0.11.0 | mmdet>=2.5.0,
\<
=2.11.0 | Not required | mmcv-full>=1.2.4,
\<
=1.3.0 |
| 0.9.0 | mmdet>=2.5.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.2.4, <=1.3.0|
| 0.10.0 | mmdet>=2.5.0,
\<
=2.11.0 | Not required | mmcv-full>=1.2.4,
\<
=1.3.0 |
| 0.8.0 | mmdet>=2.5.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.1.5, <=1.3.0|
| 0.9.0 | mmdet>=2.5.0,
\<
=2.11.0 | Not required | mmcv-full>=1.2.4,
\<
=1.3.0 |
| 0.7.0 | mmdet>=2.5.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.1.5, <=1.3.0|
| 0.8.0 | mmdet>=2.5.0,
\<
=2.11.0 | Not required | mmcv-full>=1.1.5,
\<
=1.3.0 |
| 0.6.0 | mmdet>=2.4.0,
<
=2.11.0
|
Not
required
|
mmcv-full
>
=1.1.3, <=1.2.0|
| 0.7.0 | mmdet>=2.5.0,
\<
=2.11.0 | Not required | mmcv-full>=1.1.5,
\<
=1.3.0 |
| 0.5.0 | 2.3.0 | Not required | mmcv-full==1.0.5|
| 0.6.0 | mmdet>=2.4.0,
\<
=2.11.0 | Not required | mmcv-full>=1.1.3,
\<
=1.2.0 |
| 0.5.0 | 2.3.0 | Not required | mmcv-full==1.0.5 |
# 安装
# 安装
...
@@ -91,6 +92,7 @@ conda install pytorch=1.3.1 cudatoolkit=9.2 torchvision=0.4.2 -c pytorch
...
@@ -91,6 +92,7 @@ conda install pytorch=1.3.1 cudatoolkit=9.2 torchvision=0.4.2 -c pytorch
```
shell
```
shell
pip
install
mmcv-full
-f
https://download.openmmlab.com/mmcv/dist/
{
cu_version
}
/
{
torch_version
}
/index.html
pip
install
mmcv-full
-f
https://download.openmmlab.com/mmcv/dist/
{
cu_version
}
/
{
torch_version
}
/index.html
```
```
需要把命令行中的
`{cu_version}`
和
`{torch_version}`
替换成对应的版本。例如:在 CUDA 11 和 PyTorch 1.7.0 的环境下,可以使用下面命令安装最新版本的 MMCV:
需要把命令行中的
`{cu_version}`
和
`{torch_version}`
替换成对应的版本。例如:在 CUDA 11 和 PyTorch 1.7.0 的环境下,可以使用下面命令安装最新版本的 MMCV:
```
shell
```
shell
...
@@ -140,6 +142,7 @@ pip install -v -e . # or "python setup.py develop"
...
@@ -140,6 +142,7 @@ pip install -v -e . # or "python setup.py develop"
```
shell
```
shell
pip
install
mmsegmentation
pip
install
mmsegmentation
```
```
同时,如果你想修改这部分的代码,也可以通过以下命令从源码编译 MMSegmentation:
同时,如果你想修改这部分的代码,也可以通过以下命令从源码编译 MMSegmentation:
```
shell
```
shell
...
@@ -156,8 +159,6 @@ git clone https://github.com/open-mmlab/mmdetection3d.git
...
@@ -156,8 +159,6 @@ git clone https://github.com/open-mmlab/mmdetection3d.git
cd
mmdetection3d
cd
mmdetection3d
```
```
**g. 安装依赖包和 MMDetection3D.**
**g. 安装依赖包和 MMDetection3D.**
```
shell
```
shell
...
@@ -253,7 +254,7 @@ python demo/pcd_demo.py demo/data/kitti/kitti_000008.bin configs/second/hv_secon
...
@@ -253,7 +254,7 @@ python demo/pcd_demo.py demo/data/kitti/kitti_000008.bin configs/second/hv_secon
如果你想输入一个
`ply`
格式的文件,你可以使用如下函数将它转换为
`bin`
的文件格式。然后就可以使用转化成
`bin`
格式的文件去运行样例程序。
如果你想输入一个
`ply`
格式的文件,你可以使用如下函数将它转换为
`bin`
的文件格式。然后就可以使用转化成
`bin`
格式的文件去运行样例程序。
请注意在使用此脚本前,你需要先安装
`pandas`
和
`plyfile`
。 这个函数也可使用在数据预处理当中,为了能够直接训练
``
`ply data`
``
。
请注意在使用此脚本前,你需要先安装
`pandas`
和
`plyfile`
。 这个函数也可使用在数据预处理当中,为了能够直接训练
`ply data`
。
```
python
```
python
import
numpy
as
np
import
numpy
as
np
...
...
docs/zh_cn/model_zoo.md
View file @
bb204696
...
@@ -100,6 +100,10 @@
...
@@ -100,6 +100,10 @@
请参考
[
MonoFlex
](
https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0.dev0/configs/monoflex
)
获取更多细节,我们在 KITTI 数据集上给出了相应的结果.
请参考
[
MonoFlex
](
https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0.dev0/configs/monoflex
)
获取更多细节,我们在 KITTI 数据集上给出了相应的结果.
### SA-SSD
请参考
[
SA-SSD
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/sassd
)
获取更多的细节,我们在 KITTI 数据集上给出了相应的基准结果。
### Mixed Precision (FP16) Training
### Mixed Precision (FP16) Training
细节请参考
[
Mixed Precision (FP16) Training 在 PointPillars 训练的样例
](
https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0.dev0/configs/pointpillars/hv_pointpillars_fpn_sbn-all_fp16_2x8_2x_nus-3d.py
)
.
细节请参考
[
Mixed Precision (FP16) Training 在 PointPillars 训练的样例
](
https://github.com/open-mmlab/mmdetection3d/tree/v1.0.0.dev0/configs/pointpillars/hv_pointpillars_fpn_sbn-all_fp16_2x8_2x_nus-3d.py
)
.
docs/zh_cn/supported_tasks/vision_det3d.md
View file @
bb204696
# 基于视觉的3D检测
# 基于视觉的 3D 检测
基于视觉的 3D 检测是指基于纯视觉输入的 3D 检测方法,例如基于单目、双目和多视图图像的 3D 检测。目前,我们只支持单目和多视图的 3D 检测方法。其他方法也应该与我们的框架兼容,并在将来得到支持。
它期望给定的模型以任意数量的图像作为输入,并为每一个感兴趣的目标预测 3D 框及类别标签。以 nuScenes 数据集 FCOS3D 为例,我们将展示如何准备数据,在标准的 3D 检测基准上训练并测试模型,以及可视化并验证结果。
## 数据准备
首先,我们需要下载原始数据并按照
[
数据准备文档
](
https://mmdetection3d.readthedocs.io/zh_CN/latest/data_preparation.html
)
中提供的标准方式重新组织数据。
由于不同数据集的原始数据有不同的组织方式,我们通常需要用 pkl 或 json 文件收集有用的数据信息。因此,在准备好所有的原始数据之后,我们需要运行
`create_data.py`
中提供的脚本来为不同的数据集生成数据信息。例如,对于 nuScenes,我们需要运行如下命令:
```
python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes
```
随后,相关的目录结构将如下所示:
```
mmdetection3d
├── mmdet3d
├── tools
├── configs
├── data
│ ├── nuscenes
│ │ ├── maps
│ │ ├── samples
│ │ ├── sweeps
│ │ ├── v1.0-test
| | ├── v1.0-trainval
│ │ ├── nuscenes_database
│ │ ├── nuscenes_infos_train.pkl
│ │ ├── nuscenes_infos_trainval.pkl
│ │ ├── nuscenes_infos_val.pkl
│ │ ├── nuscenes_infos_test.pkl
│ │ ├── nuscenes_dbinfos_train.pkl
│ │ ├── nuscenes_infos_train_mono3d.coco.json
│ │ ├── nuscenes_infos_trainval_mono3d.coco.json
│ │ ├── nuscenes_infos_val_mono3d.coco.json
│ │ ├── nuscenes_infos_test_mono3d.coco.json
```
注意,此处的 pkl 文件主要用于使用 LiDAR 数据的方法,json 文件用于 2D 检测/纯视觉的 3D 检测。在 v0.13.0 支持单目 3D 检测之前,json 文件只包含 2D 检测的信息,因此如果你需要最新的信息,请切换到 v0.13.0 之后的分支。
## 训练
接着,我们将使用提供的配置文件训练 FCOS3D。基本的脚本与其他模型一样。当你使用不同的 GPU 设置进行训练时,你基本上可以按照这个
[
教程
](
https://mmdetection3d.readthedocs.io/zh_CN/latest/1_exist_data_model.html#inference-with-existing-models
)
的示例。假设我们在一台具有 8 块 GPU 的机器上使用分布式训练:
```
./tools/dist_train.sh configs/fcos3d/fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d.py 8
```
注意,配置文件名中的
`2x8`
是指训练时用了 8 块 GPU,每块 GPU 上有 2 个数据样本。如果你的自定义设置不同于此,那么有时候你需要相应的调整学习率。基本规则可以参考
[
此处
](
https://arxiv.org/abs/1706.02677
)
。
我们也可以通过运行以下命令微调 FCOS3D,从而达到更好的性能:
```
./tools/dist_train.sh fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d_finetune.py 8
```
通过先前的脚本训练好一个基准模型后,请记得相应的修改
[
此处
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/fcos3d/fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d_finetune.py#L8
)
的路径。
## 定量评估
在训练期间,模型权重文件将会根据配置文件中的
`evaluation = dict(interval=xxx)`
设置被周期性地评估。
我们支持不同数据集的官方评估方案。由于输出格式与基于其他模态的 3D 检测相同,因此评估方法也是一样的。
对于 nuScenes,将使用基于距离的平均精度(mAP)以及 nuScenes 检测分数(NDS)分别对 10 个类别进行评估。评估结果将会被打印到终端中,如下所示:
```
mAP: 0.3197
mATE: 0.7595
mASE: 0.2700
mAOE: 0.4918
mAVE: 1.3307
mAAE: 0.1724
NDS: 0.3905
Eval time: 170.8s
Per-class results:
Object Class AP ATE ASE AOE AVE AAE
car 0.503 0.577 0.152 0.111 2.096 0.136
truck 0.223 0.857 0.224 0.220 1.389 0.179
bus 0.294 0.855 0.204 0.190 2.689 0.283
trailer 0.081 1.094 0.243 0.553 0.742 0.167
construction_vehicle 0.058 1.017 0.450 1.019 0.137 0.341
pedestrian 0.392 0.687 0.284 0.694 0.876 0.158
motorcycle 0.317 0.737 0.265 0.580 2.033 0.104
bicycle 0.308 0.704 0.299 0.892 0.683 0.010
traffic_cone 0.555 0.486 0.309 nan nan nan
barrier 0.466 0.581 0.269 0.169 nan nan
```
此外,在训练完成后你也可以评估特定的模型权重文件。你可以简单地执行以下脚本:
```
./tools/dist_test.sh configs/fcos3d/fcos3d_r101_caffe_fpn_gn-head_dcn_2x8_1x_nus-mono3d.py \
work_dirs/fcos3d/latest.pth --eval mAP
```
## 测试与提交
如果你只想在在线基准上进行推理或测试模型性能,你需要将之前评估脚本中的
`--eval mAP`
替换成
`--format-only`
,并在需要的情况下指定
`jsonfile_prefix`
,例如,添加选项
`--eval-options jsonfile_prefix=work_dirs/fcos3d/test_submission`
。请确保配置文件中的
[
测试信息
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/_base_/datasets/nus-mono3d.py#L93
)
由验证集相应地改为测试集。
在生成结果后,你可以压缩文件夹并上传至 nuScenes 3D 检测挑战的 evalAI 评估服务器上。
## 定性评估
MMDetection3D 还提供了通用的可视化工具,以便于我们可以对训练好的模型预测的检测结果有一个直观的感受。你也可以在评估阶段通过设置
`--eval-options 'show=True' 'out_dir=${SHOW_DIR}'`
来在线可视化检测结果,或者使用
`tools/misc/visualize_results.py`
来离线地进行可视化。
此外,我们还提供了脚本
`tools/misc/browse_dataset.py`
用于可视化数据集而不做推理。更多的细节请参考
[
可视化文档
](
https://mmdetection3d.readthedocs.io/zh_CN/latest/useful_tools.html#visualization
)
。
注意,目前我们仅支持纯视觉方法在图像上的可视化。将来我们将集成在前景图以及鸟瞰图(BEV)中的可视化。
docs/zh_cn/tutorials/backends_support.md
View file @
bb204696
# 教程 7: 后端支持
# 教程 7: 后端支持
我们支持不同的文件客户端后端:磁盘、Ceph 和 LMDB 等。下面是修改配置使之从 Ceph 加载和保存数据的示例。
我们支持不同的文件客户端后端:磁盘、Ceph 和 LMDB 等。下面是修改配置使之从 Ceph 加载和保存数据的示例。
## 从 Ceph 读取数据和标注文件
## 从 Ceph 读取数据和标注文件
...
@@ -93,9 +94,8 @@ data = dict(
...
@@ -93,9 +94,8 @@ data = dict(
test
=
dict
(
pipeline
=
test_pipeline
,
classes
=
class_names
,
file_client_args
=
file_client_args
))
test
=
dict
(
pipeline
=
test_pipeline
,
classes
=
class_names
,
file_client_args
=
file_client_args
))
```
```
## 从 Ceph 读取预训练模型
## 从 Ceph 读取预训练模型
```
python
```
python
model
=
dict
(
model
=
dict
(
pts_backbone
=
dict
(
pts_backbone
=
dict
(
...
@@ -108,6 +108,7 @@ model = dict(
...
@@ -108,6 +108,7 @@ model = dict(
```
```
## 从 Ceph 读取模型权重文件
## 从 Ceph 读取模型权重文件
```
python
```
python
# replace the path with your checkpoint path on Ceph
# replace the path with your checkpoint path on Ceph
load_from
=
's3://openmmlab/checkpoints/mmdetection3d/v0.1.0_models/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20200620_230614-77663cd6.pth.pth'
load_from
=
's3://openmmlab/checkpoints/mmdetection3d/v0.1.0_models/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20200620_230614-77663cd6.pth.pth'
...
@@ -131,6 +132,7 @@ evaluation = dict(interval=1, save_best='bbox', out_dir='s3://openmmlab/mmdetect
...
@@ -131,6 +132,7 @@ evaluation = dict(interval=1, save_best='bbox', out_dir='s3://openmmlab/mmdetect
```
```
## 训练日志保存至 Ceph
## 训练日志保存至 Ceph
训练后的训练日志会备份到指定的 Ceph 路径。
训练后的训练日志会备份到指定的 Ceph 路径。
```
python
```
python
...
@@ -140,6 +142,7 @@ log_config = dict(
...
@@ -140,6 +142,7 @@ log_config = dict(
dict
(
type
=
'TextLoggerHook'
,
out_dir
=
's3://openmmlab/mmdetection3d'
),
dict
(
type
=
'TextLoggerHook'
,
out_dir
=
's3://openmmlab/mmdetection3d'
),
])
])
```
```
您还可以通过设置
`keep_local = False`
备份到指定的 Ceph 路径后删除本地训练日志。
您还可以通过设置
`keep_local = False`
备份到指定的 Ceph 路径后删除本地训练日志。
```
python
```
python
...
...
docs/zh_cn/tutorials/config.md
View file @
bb204696
docs/zh_cn/tutorials/coord_sys_tutorial.md
View file @
bb204696
...
@@ -43,7 +43,7 @@ MMDetection3D 使用 3 种不同的坐标系。3D 目标检测领域中不同坐
...
@@ -43,7 +43,7 @@ MMDetection3D 使用 3 种不同的坐标系。3D 目标检测领域中不同坐
左 ------ 0 ------> x 右
左 ------ 0 ------> x 右
```
```
该教程中的坐标系定义实际上
**不仅仅是定义三个轴**
。对于形如
``$$`(x, y, z, dx, dy, dz, r)`$$``
的框来说,我们的坐标系也定义了如何解释框的尺寸
``$$`(dx, dy, dz)`$$``
和转向角 (yaw) 角度
``$$`r`$$``
。
该教程中的坐标系定义实际上
**不仅仅是定义三个轴**
。对于形如
``
$$`(x, y, z, dx, dy, dz, r)`$$
``
的框来说,我们的坐标系也定义了如何解释框的尺寸
``
$$`(dx, dy, dz)`$$
``
和转向角 (yaw) 角度
``
$$`r`$$
``
。
三个坐标系的图示如下:
三个坐标系的图示如下:
...
@@ -55,13 +55,13 @@ MMDetection3D 使用 3 种不同的坐标系。3D 目标检测领域中不同坐
...
@@ -55,13 +55,13 @@ MMDetection3D 使用 3 种不同的坐标系。3D 目标检测领域中不同坐
## 转向角 (yaw) 的定义
## 转向角 (yaw) 的定义
请参考
[
维基百科
](
https://en.wikipedia.org/wiki/Euler_angles#Tait%E2%80%93Bryan_angles
)
了解转向角的标准定义。在目标检测中,我们选择一个轴作为重力轴,并在垂直于重力轴的平面
``$$`\Pi`$$``
上选取一个参考方向,那么参考方向的转向角为 0,在
``$$`\Pi`$$``
上的其他方向有非零的转向角,其角度取决于其与参考方向的角度。
请参考
[
维基百科
](
https://en.wikipedia.org/wiki/Euler_angles#Tait%E2%80%93Bryan_angles
)
了解转向角的标准定义。在目标检测中,我们选择一个轴作为重力轴,并在垂直于重力轴的平面
``
$$`\Pi`$$
``
上选取一个参考方向,那么参考方向的转向角为 0,在
``
$$`\Pi`$$
``
上的其他方向有非零的转向角,其角度取决于其与参考方向的角度。
目前,对于所有支持的数据集,标注不包括俯仰角 (pitch) 和滚动角 (roll),这意味着我们在预测框和计算框之间的重叠时只需考虑转向角 (yaw)。
目前,对于所有支持的数据集,标注不包括俯仰角 (pitch) 和滚动角 (roll),这意味着我们在预测框和计算框之间的重叠时只需考虑转向角 (yaw)。
在 MMDetection3D 中,所有坐标系都是右手坐标系,这意味着如果从重力轴的负方向(轴的正方向指向人眼)看,转向角 (yaw) 沿着逆时针方向增加。
在 MMDetection3D 中,所有坐标系都是右手坐标系,这意味着如果从重力轴的负方向(轴的正方向指向人眼)看,转向角 (yaw) 沿着逆时针方向增加。
下图显示,在右手坐标系中,如果我们设定 x 轴正方向为参考方向,那么 y 轴正方向的转向角 (yaw) 为
``$$`\frac{\pi}{2}`$$``
。
下图显示,在右手坐标系中,如果我们设定 x 轴正方向为参考方向,那么 y 轴正方向的转向角 (yaw) 为
``
$$`\frac{\pi}{2}`$$
``
。
```
```
z 上 y 前 (yaw=0.5*pi)
z 上 y 前 (yaw=0.5*pi)
...
@@ -92,9 +92,9 @@ __|____|____|____|______\ x 右
...
@@ -92,9 +92,9 @@ __|____|____|____|______\ x 右
## 框尺寸的定义
## 框尺寸的定义
框尺寸的定义与转向角 (yaw) 的定义是分不开的。在上一节中,我们提到如果一个框的转向角 (yaw) 为 0,它的方向就被定义为与 x 轴平行。那么自然地,一个框对应于 x 轴的尺寸应该是
``$$`dx`$$``
。但是,这在某些数据集中并非总是如此(我们稍后会解决这个问题)。
框尺寸的定义与转向角 (yaw) 的定义是分不开的。在上一节中,我们提到如果一个框的转向角 (yaw) 为 0,它的方向就被定义为与 x 轴平行。那么自然地,一个框对应于 x 轴的尺寸应该是
``
$$`dx`$$
``
。但是,这在某些数据集中并非总是如此(我们稍后会解决这个问题)。
下图展示了 x 轴和
``$$`dx`$$``
,y 轴和
``$$`dy`$$``
对应的含义。
下图展示了 x 轴和
``
$$`dx`$$
``
,y 轴和
``
$$`dy`$$
``
对应的含义。
```
```
y 前
y 前
...
@@ -111,7 +111,7 @@ __|____|____|____|______\ x 右
...
@@ -111,7 +111,7 @@ __|____|____|____|______\ x 右
| dy
| dy
```
```
注意框的方向总是和
``$$`dx`$$``
边平行。
注意框的方向总是和
``
$$`dx`$$
``
边平行。
```
```
y 前
y 前
...
@@ -138,12 +138,12 @@ KITTI 数据集的原始标注是在相机坐标系下的,详见 [get_label_an
...
@@ -138,12 +138,12 @@ KITTI 数据集的原始标注是在相机坐标系下的,详见 [get_label_an


对于每个框来说,尺寸为
``$$`(w, l, h)`$$``
,转向角 (yaw) 的参考方向为 y 轴正方向。更多细节请参考
[
代码库
](
https://github.com/traveller59/second.pytorch#concepts
)
。
对于每个框来说,尺寸为
``
$$`(w, l, h)`$$
``
,转向角 (yaw) 的参考方向为 y 轴正方向。更多细节请参考
[
代码库
](
https://github.com/traveller59/second.pytorch#concepts
)
。
我们的激光雷达坐标系有两处改变:
我们的激光雷达坐标系有两处改变:
-
转向角 (yaw) 被定义为右手而非左手,从而保持一致性;
-
转向角 (yaw) 被定义为右手而非左手,从而保持一致性;
-
框的尺寸为
``$$`(l, w, h)`$$``
而非
``$$`(w, l, h)`$$``
,由于在 KITTI 数据集中
``$$`w`$$``
对应
``$$`dy`$$``
,
``$$`l`$$``
对应
``$$`dx`$$``
。
-
框的尺寸为
``
$$`(l, w, h)`$$
``
而非
``
$$`(w, l, h)`$$
``
,由于在 KITTI 数据集中
``
$$`w`$$
``
对应
``
$$`dy`$$
``
,
``
$$`l`$$
``
对应
``
$$`dx`$$
``
。
### Waymo
### Waymo
...
@@ -151,7 +151,7 @@ KITTI 数据集的原始标注是在相机坐标系下的,详见 [get_label_an
...
@@ -151,7 +151,7 @@ KITTI 数据集的原始标注是在相机坐标系下的,详见 [get_label_an
### NuScenes
### NuScenes
NuScenes 提供了一个评估工具包,其中每个框都被包装成一个
`Box`
实例。
`Box`
的坐标系不同于我们的激光雷达坐标系,在
`Box`
坐标系中,前两个表示框尺寸的元素分别对应
``$$`(dy, dx)`$$``
或者
``$$`(w, l)`$$``
,和我们的表示方法相反。更多细节请参考 NuScenes
[
教程
](
https://github.com/open-mmlab/mmdetection3d/blob/master/docs/zh_cn/datasets/nuscenes_det.md#notes
)
。
NuScenes 提供了一个评估工具包,其中每个框都被包装成一个
`Box`
实例。
`Box`
的坐标系不同于我们的激光雷达坐标系,在
`Box`
坐标系中,前两个表示框尺寸的元素分别对应
``
$$`(dy, dx)`$$
``
或者
``
$$`(w, l)`$$
``
,和我们的表示方法相反。更多细节请参考 NuScenes
[
教程
](
https://github.com/open-mmlab/mmdetection3d/blob/master/docs/zh_cn/datasets/nuscenes_det.md#notes
)
。
读者可以参考
[
NuScenes 开发工具
](
https://github.com/nutonomy/nuscenes-devkit/tree/master/python-sdk/nuscenes/eval/detection
)
,了解
[
NuScenes 框
](
https://github.com/nutonomy/nuscenes-devkit/blob/2c6a752319f23910d5f55cc995abc547a9e54142/python-sdk/nuscenes/utils/data_classes.py#L457
)
的定义和
[
NuScenes 评估
](
https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/eval/detection/evaluate.py
)
的过程。
读者可以参考
[
NuScenes 开发工具
](
https://github.com/nutonomy/nuscenes-devkit/tree/master/python-sdk/nuscenes/eval/detection
)
,了解
[
NuScenes 框
](
https://github.com/nutonomy/nuscenes-devkit/blob/2c6a752319f23910d5f55cc995abc547a9e54142/python-sdk/nuscenes/utils/data_classes.py#L457
)
的定义和
[
NuScenes 评估
](
https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes/eval/detection/evaluate.py
)
的过程。
...
@@ -183,25 +183,25 @@ SUN RGB-D 的原始数据不是点云而是 RGB-D 图像。我们通过反投影
...
@@ -183,25 +183,25 @@ SUN RGB-D 的原始数据不是点云而是 RGB-D 图像。我们通过反投影
首先,对于点和框的中心点,坐标转换前后满足下列关系:
首先,对于点和框的中心点,坐标转换前后满足下列关系:
-
``$$`x_{LiDAR}=z_{camera}`$$``
-
``
$$`x_{LiDAR}=z_{camera}`$$
``
-
``$$`y_{LiDAR}=-x_{camera}`$$``
-
``
$$`y_{LiDAR}=-x_{camera}`$$
``
-
``$$`z_{LiDAR}=-y_{camera}`$$``
-
``
$$`z_{LiDAR}=-y_{camera}`$$
``
然后,框的尺寸转换前后满足下列关系:
然后,框的尺寸转换前后满足下列关系:
-
``$$`dx_{LiDAR}=dx_{camera}`$$``
-
``
$$`dx_{LiDAR}=dx_{camera}`$$
``
-
``$$`dy_{LiDAR}=dz_{camera}`$$``
-
``
$$`dy_{LiDAR}=dz_{camera}`$$
``
-
``$$`dz_{LiDAR}=dy_{camera}`$$``
-
``
$$`dz_{LiDAR}=dy_{camera}`$$
``
最后,转向角 (yaw) 也应该被转换:
最后,转向角 (yaw) 也应该被转换:
-
``$$`r_{LiDAR}=-\frac{\pi}{2}-r_{camera}`$$``
-
``
$$`r_{LiDAR}=-\frac{\pi}{2}-r_{camera}`$$
``
详见
[
此处
](
https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/box_3d_mode.py
)
代码了解更多细节。
详见
[
此处
](
https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/box_3d_mode.py
)
代码了解更多细节。
### 鸟瞰图
### 鸟瞰图
如果 3D 框是
``$$`(x, y, z, dx, dy, dz, r)`$$``
,相机坐标系下框的鸟瞰图是
``$$`(x, z, dx, dz, -r)`$$``
。转向角 (yaw) 符号取反是因为相机坐标系重力轴的正方向指向地面。
如果 3D 框是
``
$$`(x, y, z, dx, dy, dz, r)`$$
``
,相机坐标系下框的鸟瞰图是
``
$$`(x, z, dx, dz, -r)`$$
``
。转向角 (yaw) 符号取反是因为相机坐标系重力轴的正方向指向地面。
详见
[
此处
](
https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/cam_box3d.py
)
代码了解更多细节。
详见
[
此处
](
https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/core/bbox/structures/cam_box3d.py
)
代码了解更多细节。
...
@@ -223,18 +223,18 @@ SUN RGB-D 的原始数据不是点云而是 RGB-D 图像。我们通过反投影
...
@@ -223,18 +223,18 @@ SUN RGB-D 的原始数据不是点云而是 RGB-D 图像。我们通过反投影
否。例如在 KITTI 中,从相机坐标系转换为激光雷达坐标系时,我们需要一个校准矩阵。
否。例如在 KITTI 中,从相机坐标系转换为激光雷达坐标系时,我们需要一个校准矩阵。
#### Q3: 框中转向角 (yaw) ``$$`2\pi`$$`` 的相位差如何影响评估?
#### Q3: 框中转向角 (yaw) ``
$$`2\pi`$$
`` 的相位差如何影响评估?
对于交并比 (IoU) 计算,转向角 (yaw) 有
``$$`2\pi`$$``
的相位差的两个框是相同的,所以不会影响评估。
对于交并比 (IoU) 计算,转向角 (yaw) 有
``
$$`2\pi`$$
``
的相位差的两个框是相同的,所以不会影响评估。
对于角度预测评估,例如 NuScenes 中的 NDS 指标和 KITTI 中的 AOS 指标,会先对预测框的角度进行标准化,因此
``$$`2\pi`$$``
的相位差不会改变结果。
对于角度预测评估,例如 NuScenes 中的 NDS 指标和 KITTI 中的 AOS 指标,会先对预测框的角度进行标准化,因此
``
$$`2\pi`$$
``
的相位差不会改变结果。
#### Q4: 框中转向角 (yaw) ``$$`\pi`$$`` 的相位差如何影响评估?
#### Q4: 框中转向角 (yaw) ``
$$`\pi`$$
`` 的相位差如何影响评估?
对于交并比 (IoU) 计算,转向角 (yaw) 有
``$$`\pi`$$``
的相位差的两个框是相同的,所以不会影响评估。
对于交并比 (IoU) 计算,转向角 (yaw) 有
``
$$`\pi`$$
``
的相位差的两个框是相同的,所以不会影响评估。
然而,对于角度预测评估,这会导致完全相反的方向。
然而,对于角度预测评估,这会导致完全相反的方向。
考虑一辆汽车,转向角 (yaw) 是汽车前部方向与 x 轴正方向之间的夹角。如果我们将该角度增加
``$$`\pi`$$``
,车前部将变成车后部。
考虑一辆汽车,转向角 (yaw) 是汽车前部方向与 x 轴正方向之间的夹角。如果我们将该角度增加
``
$$`\pi`$$
``
,车前部将变成车后部。
对于某些类别,例如障碍物,前后没有区别,因此
``$$`\pi`$$``
的相位差不会对角度预测分数产生影响。
对于某些类别,例如障碍物,前后没有区别,因此
``
$$`\pi`$$
``
的相位差不会对角度预测分数产生影响。
docs/zh_cn/tutorials/customize_dataset.md
View file @
bb204696
docs/zh_cn/tutorials/customize_runtime.md
View file @
bb204696
docs/zh_cn/tutorials/data_pipeline.md
View file @
bb204696
...
@@ -78,51 +78,64 @@ test_pipeline = [
...
@@ -78,51 +78,64 @@ test_pipeline = [
### 数据加载
### 数据加载
`LoadPointsFromFile`
`LoadPointsFromFile`
-
添加:points
-
添加:points
`LoadPointsFromMultiSweeps`
`LoadPointsFromMultiSweeps`
-
更新:points
-
更新:points
`LoadAnnotations3D`
`LoadAnnotations3D`
-
添加:gt_bboxes_3d, gt_labels_3d, gt_bboxes, gt_labels, pts_instance_mask, pts_semantic_mask, bbox3d_fields, pts_mask_fields, pts_seg_fields
-
添加:gt_bboxes_3d, gt_labels_3d, gt_bboxes, gt_labels, pts_instance_mask, pts_semantic_mask, bbox3d_fields, pts_mask_fields, pts_seg_fields
### 预处理
### 预处理
`GlobalRotScaleTrans`
`GlobalRotScaleTrans`
-
添加:pcd_trans, pcd_rotation, pcd_scale_factor
-
添加:pcd_trans, pcd_rotation, pcd_scale_factor
-
更新:points,
*
bbox3d_fields
-
更新:points,
\
*
bbox3d_fields
`RandomFlip3D`
`RandomFlip3D`
-
添加:flip, pcd_horizontal_flip, pcd_vertical_flip
-
添加:flip, pcd_horizontal_flip, pcd_vertical_flip
-
更新:points,
*
bbox3d_fields
-
更新:points,
\
*
bbox3d_fields
`PointsRangeFilter`
`PointsRangeFilter`
-
更新:points
-
更新:points
`ObjectRangeFilter`
`ObjectRangeFilter`
-
更新:gt_bboxes_3d, gt_labels_3d
-
更新:gt_bboxes_3d, gt_labels_3d
`ObjectNameFilter`
`ObjectNameFilter`
-
更新:gt_bboxes_3d, gt_labels_3d
-
更新:gt_bboxes_3d, gt_labels_3d
`PointShuffle`
`PointShuffle`
-
更新:points
-
更新:points
`PointsRangeFilter`
`PointsRangeFilter`
-
更新:points
-
更新:points
### 格式化
### 格式化
`DefaultFormatBundle3D`
`DefaultFormatBundle3D`
-
更新:points, gt_bboxes_3d, gt_labels_3d, gt_bboxes, gt_labels
-
更新:points, gt_bboxes_3d, gt_labels_3d, gt_bboxes, gt_labels
`Collect3D`
`Collect3D`
-
添加:img_meta (由
`meta_keys`
指定的键值构成的 img_meta)
-
添加:img_meta (由
`meta_keys`
指定的键值构成的 img_meta)
-
移除:所有除
`keys`
指定的键值以外的其他键值
-
移除:所有除
`keys`
指定的键值以外的其他键值
### 测试时的数据增强
### 测试时的数据增强
`MultiScaleFlipAug`
`MultiScaleFlipAug`
-
更新: scale, pcd_scale_factor, flip, flip_direction, pcd_horizontal_flip, pcd_vertical_flip (与这些指定的参数对应的增强后的数据列表)
-
更新: scale, pcd_scale_factor, flip, flip_direction, pcd_horizontal_flip, pcd_vertical_flip (与这些指定的参数对应的增强后的数据列表)
## 扩展并使用自定义数据集预处理方法
## 扩展并使用自定义数据集预处理方法
...
...
docs/zh_cn/tutorials/model_deployment.md
View file @
bb204696
...
@@ -37,17 +37,17 @@ python ./tools/deploy.py \
...
@@ -37,17 +37,17 @@ python ./tools/deploy.py \
### 参数描述
### 参数描述
*
`deploy_cfg`
: MMDeploy 代码库中用于部署的配置文件路径。
-
`deploy_cfg`
: MMDeploy 代码库中用于部署的配置文件路径。
*
`model_cfg`
: OpenMMLab 系列代码库中使用的模型配置文件路径。
-
`model_cfg`
: OpenMMLab 系列代码库中使用的模型配置文件路径。
*
`checkpoint`
: OpenMMLab 系列代码库的模型文件路径。
-
`checkpoint`
: OpenMMLab 系列代码库的模型文件路径。
*
`img`
: 用于模型转换时使用的点云文件或图像文件路径。
-
`img`
: 用于模型转换时使用的点云文件或图像文件路径。
*
`--test-img`
: 用于测试模型的图像文件路径。如果没有指定,将设置成
`None`
。
-
`--test-img`
: 用于测试模型的图像文件路径。如果没有指定,将设置成
`None`
。
*
`--work-dir`
: 工作目录,用来保存日志和模型文件。
-
`--work-dir`
: 工作目录,用来保存日志和模型文件。
*
`--calib-dataset-cfg`
: 此参数只在 int8 模式下生效,用于校准数据集配置文件。如果没有指定,将被设置成
`None`
,并使用模型配置文件中的 'val' 数据集进行校准。
-
`--calib-dataset-cfg`
: 此参数只在 int8 模式下生效,用于校准数据集配置文件。如果没有指定,将被设置成
`None`
,并使用模型配置文件中的 'val' 数据集进行校准。
*
`--device`
: 用于模型转换的设备。如果没有指定,将被设置成 cpu。
-
`--device`
: 用于模型转换的设备。如果没有指定,将被设置成 cpu。
*
`--log-level`
: 设置日记的等级,选项包括
`'CRITICAL','FATAL','ERROR','WARN','WARNING','INFO','DEBUG','NOTSET'`
。如果没有指定,将被设置成 INFO。
-
`--log-level`
: 设置日记的等级,选项包括
`'CRITICAL','FATAL','ERROR','WARN','WARNING','INFO','DEBUG','NOTSET'`
。如果没有指定,将被设置成 INFO。
*
`--show`
: 是否显示检测的结果。
-
`--show`
: 是否显示检测的结果。
*
`--dump-info`
: 是否输出 SDK 信息。
-
`--dump-info`
: 是否输出 SDK 信息。
### 示例
### 示例
...
@@ -111,11 +111,11 @@ python tools/test.py \
...
@@ -111,11 +111,11 @@ python tools/test.py \
## 支持模型列表
## 支持模型列表
| Model | TorchScript | OnnxRuntime | TensorRT | NCNN | PPLNN | OpenVINO | Model config |
| Model | TorchScript | OnnxRuntime | TensorRT | NCNN | PPLNN | OpenVINO | Model config |
| -------------------- | :---------: | :---------: | :------: | :--
-
: | :---: | :------: | -------------------------------------------------------------------------------------- |
| -------------------- | :---------: | :---------: | :------: | :--: | :---: | :------: | -------------------------------------------------------------------------------------- |
| PointPillars | ? | Y | Y | N | N | Y |
[
config
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/pointpillars
)
|
| PointPillars | ? | Y | Y | N | N | Y |
[
config
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/pointpillars
)
|
| CenterPoint (pillar) | ? | Y | Y | N | N | Y |
[
config
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/centerpoint
)
|
| CenterPoint (pillar) | ? | Y | Y | N | N | Y |
[
config
](
https://github.com/open-mmlab/mmdetection3d/blob/master/configs/centerpoint
)
|
## 注意
## 注意
*
MMDeploy 的版本需要 >= 0.4.0。
-
MMDeploy 的版本需要 >= 0.4.0。
*
目前 CenterPoint 仅支持了 pillar 版本的。
-
目前 CenterPoint 仅支持了 pillar 版本的。
docs/zh_cn/useful_tools.md
View file @
bb204696
...
@@ -51,7 +51,7 @@ time std over epochs is 0.0028
...
@@ -51,7 +51,7 @@ time std over epochs is 0.0028
average iter time: 1.1959 s/iter
average iter time: 1.1959 s/iter
```
```
&
emsp
;
&
#8195
;
# 可视化
# 可视化
...
@@ -80,7 +80,6 @@ python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'sh
...
@@ -80,7 +80,6 @@ python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --eval 'mAP' --eval-options 'sh
python tools/misc/visualize_results.py
${
CONFIG_FILE
}
--result
${
RESULTS_PATH
}
--show-dir
${
SHOW_DIR
}
python tools/misc/visualize_results.py
${
CONFIG_FILE
}
--result
${
RESULTS_PATH
}
--show-dir
${
SHOW_DIR
}
```
```


或者您可以使用 3D 可视化软件,例如
[
MeshLab
](
http://www.meshlab.net/
)
来打开这些在
`${SHOW_DIR}`
目录下的文件,从而查看 3D 检测输出。具体来说,打开
`***_points.obj`
查看输入点云,打开
`***_pred.obj`
查看预测的 3D 边界框。这允许推理和结果生成在远程服务器中完成,用户可以使用 GUI 在他们的主机上打开它们。
或者您可以使用 3D 可视化软件,例如
[
MeshLab
](
http://www.meshlab.net/
)
来打开这些在
`${SHOW_DIR}`
目录下的文件,从而查看 3D 检测输出。具体来说,打开
`***_points.obj`
查看输入点云,打开
`***_pred.obj`
查看预测的 3D 边界框。这允许推理和结果生成在远程服务器中完成,用户可以使用 GUI 在他们的主机上打开它们。
...
@@ -127,7 +126,7 @@ python tools/misc/browse_dataset.py configs/_base_/datasets/nus-mono3d.py --task
...
@@ -127,7 +126,7 @@ python tools/misc/browse_dataset.py configs/_base_/datasets/nus-mono3d.py --task


&
emsp
;
&
#8195
;
# 模型部署
# 模型部署
...
@@ -185,7 +184,7 @@ python tools/deployment/test_torchserver.py ${IMAGE_FILE} ${CONFIG_FILE} ${CHECK
...
@@ -185,7 +184,7 @@ python tools/deployment/test_torchserver.py ${IMAGE_FILE} ${CONFIG_FILE} ${CHECK
python tools/deployment/test_torchserver.py demo/data/kitti/kitti_000008.bin configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py checkpoints/hv_second_secfpn_6x8_80e_kitti-3d-car_20200620_230238-393f000c.pth second
python tools/deployment/test_torchserver.py demo/data/kitti/kitti_000008.bin configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py checkpoints/hv_second_secfpn_6x8_80e_kitti-3d-car_20200620_230238-393f000c.pth second
```
```
&
emsp
;
&
#8195
;
# 模型复杂度
# 模型复杂度
...
@@ -211,7 +210,7 @@ Params: 953.83 k
...
@@ -211,7 +210,7 @@ Params: 953.83 k
2. 一些运算操作不计入计算量 (FLOPs),比如说像GN和定制的运算操作,详细细节请参考 [`mmcv.cnn.get_model_complexity_info()`](https://github.com/open-mmlab/mmcv/blob/master/mmcv/cnn/utils/flops_counter.py)。
2. 一些运算操作不计入计算量 (FLOPs),比如说像GN和定制的运算操作,详细细节请参考 [`mmcv.cnn.get_model_complexity_info()`](https://github.com/open-mmlab/mmcv/blob/master/mmcv/cnn/utils/flops_counter.py)。
3. 我们现在仅仅支持单模态输入(点云或者图片)的单阶段模型的计算量 (FLOPs) 计算,我们将会在未来支持两阶段和多模态模型的计算。
3. 我们现在仅仅支持单模态输入(点云或者图片)的单阶段模型的计算量 (FLOPs) 计算,我们将会在未来支持两阶段和多模态模型的计算。
&
emsp
;
&
#8195
;
# 模型转换
# 模型转换
...
@@ -253,7 +252,7 @@ python tools/model_converters/publish_model.py work_dirs/faster_rcnn/latest.pth
...
@@ -253,7 +252,7 @@ python tools/model_converters/publish_model.py work_dirs/faster_rcnn/latest.pth
最终的输出文件名将会是 `faster_rcnn_r50_fpn_1x_20190801-{hash id}.pth`。
最终的输出文件名将会是 `faster_rcnn_r50_fpn_1x_20190801-{hash id}.pth`。
&
emsp
;
&
#8195
;
# 数据集转换
# 数据集转换
...
@@ -274,7 +273,7 @@ python -u tools/data_converter/nuimage_converter.py --data-root ${DATA_ROOT} --v
...
@@ -274,7 +273,7 @@ python -u tools/data_converter/nuimage_converter.py --data-root ${DATA_ROOT} --v
更多的数据准备细节参考 [doc](https://mmdetection3d.readthedocs.io/zh_CN/latest/data_preparation.html),nuImages 数据集的细节参考 [README](https://github.com/open-mmlab/mmdetection3d/blob/master/configs/nuimages/README.md/)。
更多的数据准备细节参考 [doc](https://mmdetection3d.readthedocs.io/zh_CN/latest/data_preparation.html),nuImages 数据集的细节参考 [README](https://github.com/open-mmlab/mmdetection3d/blob/master/configs/nuimages/README.md/)。
&
emsp
;
&
#8195
;
# 其他内容
# 其他内容
...
...
mmdet3d/__init__.py
View file @
bb204696
...
@@ -28,7 +28,7 @@ assert (mmcv_version >= digit_version(mmcv_minimum_version)
...
@@ -28,7 +28,7 @@ assert (mmcv_version >= digit_version(mmcv_minimum_version)
f
'MMCV==
{
mmcv
.
__version__
}
is used but incompatible. '
\
f
'MMCV==
{
mmcv
.
__version__
}
is used but incompatible. '
\
f
'Please install mmcv>=
{
mmcv_minimum_version
}
, <=
{
mmcv_maximum_version
}
.'
f
'Please install mmcv>=
{
mmcv_minimum_version
}
, <=
{
mmcv_maximum_version
}
.'
mmdet_minimum_version
=
'2.
19
.0'
mmdet_minimum_version
=
'2.
24
.0'
mmdet_maximum_version
=
'3.0.0'
mmdet_maximum_version
=
'3.0.0'
mmdet_version
=
digit_version
(
mmdet
.
__version__
)
mmdet_version
=
digit_version
(
mmdet
.
__version__
)
assert
(
mmdet_version
>=
digit_version
(
mmdet_minimum_version
)
assert
(
mmdet_version
>=
digit_version
(
mmdet_minimum_version
)
...
...
mmdet3d/core/post_processing/box3d_nms.py
View file @
bb204696
...
@@ -4,8 +4,6 @@ import numpy as np
...
@@ -4,8 +4,6 @@ import numpy as np
import
torch
import
torch
from
mmcv.ops
import
nms
,
nms_rotated
from
mmcv.ops
import
nms
,
nms_rotated
from
..bbox
import
xywhr2xyxyr
def
box3d_multiclass_nms
(
mlvl_bboxes
,
def
box3d_multiclass_nms
(
mlvl_bboxes
,
mlvl_bboxes_for_nms
,
mlvl_bboxes_for_nms
,
...
@@ -254,6 +252,8 @@ def nms_bev(boxes, scores, thresh, pre_max_size=None, post_max_size=None):
...
@@ -254,6 +252,8 @@ def nms_bev(boxes, scores, thresh, pre_max_size=None, post_max_size=None):
if
pre_max_size
is
not
None
:
if
pre_max_size
is
not
None
:
order
=
order
[:
pre_max_size
]
order
=
order
[:
pre_max_size
]
boxes
=
boxes
[
order
].
contiguous
()
boxes
=
boxes
[
order
].
contiguous
()
scores
=
scores
[
order
]
# xyxyr -> back to xywhr
# xyxyr -> back to xywhr
# note: better skip this step before nms_bev call in the future
# note: better skip this step before nms_bev call in the future
boxes
=
torch
.
stack
(
boxes
=
torch
.
stack
(
...
@@ -262,6 +262,7 @@ def nms_bev(boxes, scores, thresh, pre_max_size=None, post_max_size=None):
...
@@ -262,6 +262,7 @@ def nms_bev(boxes, scores, thresh, pre_max_size=None, post_max_size=None):
dim
=-
1
)
dim
=-
1
)
keep
=
nms_rotated
(
boxes
,
scores
,
thresh
)[
1
]
keep
=
nms_rotated
(
boxes
,
scores
,
thresh
)[
1
]
keep
=
order
[
keep
]
if
post_max_size
is
not
None
:
if
post_max_size
is
not
None
:
keep
=
keep
[:
post_max_size
]
keep
=
keep
[:
post_max_size
]
return
keep
return
keep
...
@@ -284,4 +285,4 @@ def nms_normal_bev(boxes, scores, thresh):
...
@@ -284,4 +285,4 @@ def nms_normal_bev(boxes, scores, thresh):
torch.Tensor: Remaining indices with scores in descending order.
torch.Tensor: Remaining indices with scores in descending order.
"""
"""
assert
boxes
.
shape
[
1
]
==
5
,
'Input boxes shape should be [N, 5]'
assert
boxes
.
shape
[
1
]
==
5
,
'Input boxes shape should be [N, 5]'
return
nms
(
xywhr2xyxyr
(
boxes
)
[:,
:
-
1
],
scores
,
thresh
)[
1
]
return
nms
(
boxes
[:,
:
-
1
],
scores
,
thresh
)[
1
]
mmdet3d/datasets/builder.py
View file @
bb204696
...
@@ -3,6 +3,7 @@ import platform
...
@@ -3,6 +3,7 @@ import platform
from
mmcv.utils
import
Registry
,
build_from_cfg
from
mmcv.utils
import
Registry
,
build_from_cfg
from
mmdet.datasets
import
DATASETS
as
MMDET_DATASETS
from
mmdet.datasets.builder
import
_concat_dataset
from
mmdet.datasets.builder
import
_concat_dataset
if
platform
.
system
()
!=
'Windows'
:
if
platform
.
system
()
!=
'Windows'
:
...
@@ -39,7 +40,8 @@ def build_dataset(cfg, default_args=None):
...
@@ -39,7 +40,8 @@ def build_dataset(cfg, default_args=None):
dataset
=
CBGSDataset
(
build_dataset
(
cfg
[
'dataset'
],
default_args
))
dataset
=
CBGSDataset
(
build_dataset
(
cfg
[
'dataset'
],
default_args
))
elif
isinstance
(
cfg
.
get
(
'ann_file'
),
(
list
,
tuple
)):
elif
isinstance
(
cfg
.
get
(
'ann_file'
),
(
list
,
tuple
)):
dataset
=
_concat_dataset
(
cfg
,
default_args
)
dataset
=
_concat_dataset
(
cfg
,
default_args
)
el
se
:
el
if
cfg
[
'type'
]
in
DATASETS
.
_module_dict
.
keys
()
:
dataset
=
build_from_cfg
(
cfg
,
DATASETS
,
default_args
)
dataset
=
build_from_cfg
(
cfg
,
DATASETS
,
default_args
)
else
:
dataset
=
build_from_cfg
(
cfg
,
MMDET_DATASETS
,
default_args
)
return
dataset
return
dataset
mmdet3d/datasets/custom_3d.py
View file @
bb204696
...
@@ -182,7 +182,9 @@ class Custom3DDataset(Dataset):
...
@@ -182,7 +182,9 @@ class Custom3DDataset(Dataset):
origin
=
(
0.5
,
0.5
,
0.5
)).
convert_to
(
self
.
box_mode_3d
)
origin
=
(
0.5
,
0.5
,
0.5
)).
convert_to
(
self
.
box_mode_3d
)
anns_results
=
dict
(
anns_results
=
dict
(
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_labels_3d
=
gt_labels_3d
)
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_labels_3d
=
gt_labels_3d
,
gt_names
=
gt_names_3d
)
return
anns_results
return
anns_results
def
pre_pipeline
(
self
,
results
):
def
pre_pipeline
(
self
,
results
):
...
...
mmdet3d/datasets/custom_3d_seg.py
View file @
bb204696
...
@@ -276,7 +276,8 @@ class Custom3DSegDataset(Dataset):
...
@@ -276,7 +276,8 @@ class Custom3DSegDataset(Dataset):
if
scene_idxs
is
None
:
if
scene_idxs
is
None
:
scene_idxs
=
np
.
arange
(
len
(
self
.
data_infos
))
scene_idxs
=
np
.
arange
(
len
(
self
.
data_infos
))
if
isinstance
(
scene_idxs
,
str
):
if
isinstance
(
scene_idxs
,
str
):
scene_idxs
=
np
.
load
(
scene_idxs
)
with
self
.
file_client
.
get_local_path
(
scene_idxs
)
as
local_path
:
scene_idxs
=
np
.
load
(
local_path
)
else
:
else
:
scene_idxs
=
np
.
array
(
scene_idxs
)
scene_idxs
=
np
.
array
(
scene_idxs
)
...
...
mmdet3d/datasets/pipelines/compose.py
View file @
bb204696
...
@@ -24,7 +24,8 @@ class Compose:
...
@@ -24,7 +24,8 @@ class Compose:
self
.
transforms
=
[]
self
.
transforms
=
[]
for
transform
in
transforms
:
for
transform
in
transforms
:
if
isinstance
(
transform
,
dict
):
if
isinstance
(
transform
,
dict
):
if
transform
[
'type'
]
in
PIPELINES
.
_module_dict
.
keys
():
_
,
key
=
PIPELINES
.
split_scope_key
(
transform
[
'type'
])
if
key
in
PIPELINES
.
_module_dict
.
keys
():
transform
=
build_from_cfg
(
transform
,
PIPELINES
)
transform
=
build_from_cfg
(
transform
,
PIPELINES
)
else
:
else
:
transform
=
build_from_cfg
(
transform
,
MMDET_PIPELINES
)
transform
=
build_from_cfg
(
transform
,
MMDET_PIPELINES
)
...
...
mmdet3d/datasets/s3dis_dataset.py
View file @
bb204696
...
@@ -381,7 +381,8 @@ class S3DISSegDataset(_S3DISSegDataset):
...
@@ -381,7 +381,8 @@ class S3DISSegDataset(_S3DISSegDataset):
modality
=
modality
,
modality
=
modality
,
test_mode
=
test_mode
,
test_mode
=
test_mode
,
ignore_index
=
ignore_index
,
ignore_index
=
ignore_index
,
scene_idxs
=
scene_idxs
[
i
])
for
i
in
range
(
len
(
ann_files
))
scene_idxs
=
scene_idxs
[
i
],
**
kwargs
)
for
i
in
range
(
len
(
ann_files
))
]
]
# data_infos and scene_idxs need to be concat
# data_infos and scene_idxs need to be concat
...
...
mmdet3d/models/builder.py
View file @
bb204696
...
@@ -46,7 +46,7 @@ def build_neck(cfg):
...
@@ -46,7 +46,7 @@ def build_neck(cfg):
def
build_roi_extractor
(
cfg
):
def
build_roi_extractor
(
cfg
):
"""Build RoI feature extractor."""
"""Build RoI feature extractor."""
if
cfg
[
'type'
]
in
NECK
S
.
_module_dict
.
keys
():
if
cfg
[
'type'
]
in
ROI_EXTRACTOR
S
.
_module_dict
.
keys
():
return
ROI_EXTRACTORS
.
build
(
cfg
)
return
ROI_EXTRACTORS
.
build
(
cfg
)
else
:
else
:
return
MMDET_ROI_EXTRACTORS
.
build
(
cfg
)
return
MMDET_ROI_EXTRACTORS
.
build
(
cfg
)
...
...
Prev
1
2
3
4
5
6
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