Unverified Commit ac289b35 authored by Tai-Wang's avatar Tai-Wang Committed by GitHub
Browse files

Bump version to v1.3.0

Bump version to v1.3.0
parents b0e8ece9 12b595ca
...@@ -54,9 +54,7 @@ jobs: ...@@ -54,9 +54,7 @@ jobs:
pip install wheel pip install wheel
- run: - run:
name: Install PyTorch name: Install PyTorch
command: | command: pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -V
python -m pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
- when: - when:
condition: condition:
equal: ["3.9.0", << parameters.python >>] equal: ["3.9.0", << parameters.python >>]
...@@ -65,11 +63,11 @@ jobs: ...@@ -65,11 +63,11 @@ jobs:
- run: - run:
name: Install mmdet3d dependencies name: Install mmdet3d dependencies
command: | command: |
python -m pip install git+ssh://git@github.com/open-mmlab/mmengine.git@main pip install git+ssh://git@github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
mim install 'mmdet >= 3.0.0' pip install git+ssh://git@github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements.txt pip install -r requirements/tests.txt
- run: - run:
name: Build and install name: Build and install
command: | command: |
...@@ -77,9 +75,9 @@ jobs: ...@@ -77,9 +75,9 @@ jobs:
- run: - run:
name: Run unittests name: Run unittests
command: | command: |
python -m coverage run --branch --source mmdet3d -m pytest tests/ coverage run --branch --source mmdet3d -m pytest tests/
python -m coverage xml coverage xml
python -m coverage report -m coverage report -m
build_cuda: build_cuda:
parameters: parameters:
...@@ -87,10 +85,10 @@ jobs: ...@@ -87,10 +85,10 @@ jobs:
type: string type: string
cuda: cuda:
type: enum type: enum
enum: ["10.1", "10.2", "11.1"] enum: ["11.1", "11.7"]
cudnn: cudnn:
type: integer type: integer
default: 7 default: 8
machine: machine:
image: ubuntu-2004-cuda-11.4:202110-01 image: ubuntu-2004-cuda-11.4:202110-01
# docker_layer_caching: true # docker_layer_caching: true
...@@ -116,7 +114,7 @@ jobs: ...@@ -116,7 +114,7 @@ jobs:
docker exec mmdet3d pip install -U openmim docker exec mmdet3d pip install -U openmim
docker exec mmdet3d mim install 'mmcv >= 2.0.0rc4' docker exec mmdet3d mim install 'mmcv >= 2.0.0rc4'
docker exec mmdet3d pip install -e /mmdetection docker exec mmdet3d pip install -e /mmdetection
docker exec mmdet3d pip install -r requirements.txt docker exec mmdet3d pip install -r requirements/tests.txt
- run: - run:
name: Build and install name: Build and install
command: | command: |
...@@ -124,7 +122,7 @@ jobs: ...@@ -124,7 +122,7 @@ jobs:
- run: - run:
name: Run unittests name: Run unittests
command: | command: |
docker exec mmdet3d python -m pytest tests/ docker exec mmdet3d pytest tests/
workflows: workflows:
pr_stage_lint: pr_stage_lint:
...@@ -148,15 +146,15 @@ workflows: ...@@ -148,15 +146,15 @@ workflows:
- dev-1.x - dev-1.x
- build_cpu: - build_cpu:
name: minimum_version_cpu name: minimum_version_cpu
torch: 1.6.0 torch: 1.8.1
torchvision: 0.7.0 torchvision: 0.9.1
python: 3.7.4 # The lowest python 3.7.x version available on CircleCI images python: 3.7.4 # The lowest python 3.7.x version available on CircleCI images
requires: requires:
- lint - lint
- build_cpu: - build_cpu:
name: maximum_version_cpu name: maximum_version_cpu
torch: 1.13.0 torch: 2.0.0
torchvision: 0.14.0 torchvision: 0.15.1
python: 3.9.0 python: 3.9.0
requires: requires:
- minimum_version_cpu - minimum_version_cpu
...@@ -169,7 +167,14 @@ workflows: ...@@ -169,7 +167,14 @@ workflows:
torch: 1.8.1 torch: 1.8.1
# Use double quotation mark to explicitly specify its type # Use double quotation mark to explicitly specify its type
# as string instead of number # as string instead of number
cuda: "10.2" cuda: "11.1"
requires:
- hold
- build_cuda:
name: maximum_version_gpu
torch: 2.0.0
cuda: "11.7"
cudnn: 8
requires: requires:
- hold - hold
merge_stage_test: merge_stage_test:
...@@ -178,8 +183,8 @@ workflows: ...@@ -178,8 +183,8 @@ workflows:
jobs: jobs:
- build_cuda: - build_cuda:
name: minimum_version_gpu name: minimum_version_gpu
torch: 1.6.0 torch: 1.8.1
cuda: "10.1" cuda: "11.1"
filters: filters:
branches: branches:
only: only:
......
...@@ -21,7 +21,7 @@ jobs: ...@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
python-version: [3.7, 3.8, 3.9] python-version: [3.8, 3.9]
torch: [1.8.1] torch: [1.8.1]
include: include:
- torch: 1.8.1 - torch: 1.8.1
...@@ -43,7 +43,7 @@ jobs: ...@@ -43,7 +43,7 @@ jobs:
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
- name: Install MMDet - name: Install MMDet
run: mim install 'mmdet>=3.0.0' run: pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
- name: Install other dependencies - name: Install other dependencies
run: pip install -r requirements/tests.txt run: pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
...@@ -59,12 +59,8 @@ jobs: ...@@ -59,12 +59,8 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: [3.7] python-version: [3.7]
torch: [1.6.0, 1.7.1, 1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.12.1, 1.13.0] torch: [1.8.1, 1.9.1, 1.10.1, 1.11.0, 1.12.0, 1.13.0]
include: include:
- torch: 1.6.0
torchvision: 0.7.0
- torch: 1.7.1
torchvision: 0.8.2
- torch: 1.8.1 - torch: 1.8.1
torchvision: 0.9.1 torchvision: 0.9.1
- torch: 1.9.1 - torch: 1.9.1
...@@ -73,13 +69,13 @@ jobs: ...@@ -73,13 +69,13 @@ jobs:
torchvision: 0.11.2 torchvision: 0.11.2
- torch: 1.11.0 - torch: 1.11.0
torchvision: 0.12.0 torchvision: 0.12.0
- torch: 1.12.1 - torch: 1.12.0
torchvision: 0.13.1 torchvision: 0.13.0
- torch: 1.13.0 - torch: 1.13.0
torchvision: 0.14.0 torchvision: 0.14.0
- torch: 2.0.0 - python-version: 3.8
torch: 2.0.0
torchvision: 0.15.1 torchvision: 0.15.1
python-version: 3.8
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -97,7 +93,7 @@ jobs: ...@@ -97,7 +93,7 @@ jobs:
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
- name: Install MMDet - name: Install MMDet
run: mim install 'mmdet>=3.0.0' run: pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
- name: Install other dependencies - name: Install other dependencies
run: pip install -r requirements/tests.txt run: pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
...@@ -147,7 +143,7 @@ jobs: ...@@ -147,7 +143,7 @@ jobs:
pip install git+https://github.com/open-mmlab/mmengine.git@main pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
mim install 'mmdet>=3.0.0' pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
run: pip install -e . run: pip install -e .
...@@ -183,7 +179,43 @@ jobs: ...@@ -183,7 +179,43 @@ jobs:
pip install git+https://github.com/open-mmlab/mmengine.git@main pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
mim install 'mmdet>=3.0.0' pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt
- name: Build and install
run: pip install -e .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmcv -m pytest tests
coverage xml
coverage report -m
build_cu117:
runs-on: ubuntu-22.04
container:
image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: pip install pip --upgrade && pip install wheel
- name: Fetch GPG keys
run: |
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
- name: Install system dependencies
run: apt-get update && apt-get install -y git ffmpeg libturbojpeg
- name: Install mmdet3d dependencies
run: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv >= 2.0.0rc4'
pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
run: pip install -e . run: pip install -e .
...@@ -201,12 +233,17 @@ jobs: ...@@ -201,12 +233,17 @@ jobs:
platform: [cpu, cu111] platform: [cpu, cu111]
torch: [1.8.1] torch: [1.8.1]
torchvision: [0.9.1] torchvision: [0.9.1]
include:
- python-version: 3.8
platform: cu117
torch: 2.0.0
torchvision: 0.15.1
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python-version }}
- name: Upgrade pip - name: Upgrade pip
run: python -m pip install pip --upgrade && pip install wheel run: python -m pip install pip --upgrade && pip install wheel
- name: Install lmdb - name: Install lmdb
...@@ -218,7 +255,7 @@ jobs: ...@@ -218,7 +255,7 @@ jobs:
pip install git+https://github.com/open-mmlab/mmengine.git@main pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
mim install 'mmdet>=3.0.0' pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
run: pip install -e . run: pip install -e .
......
...@@ -40,7 +40,7 @@ jobs: ...@@ -40,7 +40,7 @@ jobs:
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
- name: Install MMDet - name: Install MMDet
run: mim install 'mmdet>=3.0.0' run: pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
- name: Install other dependencies - name: Install other dependencies
run: pip install -r requirements/tests.txt run: pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
...@@ -86,7 +86,43 @@ jobs: ...@@ -86,7 +86,43 @@ jobs:
pip install git+https://github.com/open-mmlab/mmengine.git@main pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
mim install 'mmdet>=3.0.0' pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt
- name: Build and install
run: pip install -e .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmdet3d -m pytest tests/
coverage xml
coverage report -m
build_cu117:
runs-on: ubuntu-22.04
container:
image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: pip install pip --upgrade && pip install wheel
- name: Fetch GPG keys
run: |
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
- name: Install system dependencies
run: apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6
- name: Install mmdet3d dependencies
run: |
pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim
mim install 'mmcv >= 2.0.0rc4'
pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
run: pip install -e . run: pip install -e .
...@@ -104,6 +140,11 @@ jobs: ...@@ -104,6 +140,11 @@ jobs:
platform: [cpu, cu111] platform: [cpu, cu111]
torch: [1.8.1] torch: [1.8.1]
torchvision: [0.9.1] torchvision: [0.9.1]
include:
- python-version: 3.8
platform: cu117
torch: 2.0.0
torchvision: 0.15.1
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
...@@ -121,7 +162,7 @@ jobs: ...@@ -121,7 +162,7 @@ jobs:
pip install git+https://github.com/open-mmlab/mmengine.git@main pip install git+https://github.com/open-mmlab/mmengine.git@main
pip install -U openmim pip install -U openmim
mim install 'mmcv >= 2.0.0rc4' mim install 'mmcv >= 2.0.0rc4'
mim install 'mmdet>=3.0.0' pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
pip install -r requirements/tests.txt pip install -r requirements/tests.txt
- name: Build and install - name: Build and install
run: pip install -e . run: pip install -e .
......
...@@ -21,11 +21,11 @@ jobs: ...@@ -21,11 +21,11 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: [3.7] python-version: [3.7]
torch: [1.8.0] torch: [1.8.1]
include: include:
- torch: 1.8.0 - torch: 1.8.1
torch_version: torch1.8 torch_version: torch1.8
torchvision: 0.9.0 torchvision: 0.9.1
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
......
version: 2 version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
formats: formats:
- epub - epub
python: python:
version: 3.7
install: install:
- requirements: requirements/docs.txt - requirements: requirements/docs.txt
- requirements: requirements/readthedocs.txt - requirements: requirements/readthedocs.txt
...@@ -108,9 +108,14 @@ Like [MMDetection](https://github.com/open-mmlab/mmdetection) and [MMCV](https:/ ...@@ -108,9 +108,14 @@ Like [MMDetection](https://github.com/open-mmlab/mmdetection) and [MMCV](https:/
We have constructed a comprehensive LiDAR semantic segmentation benchmark on SemanticKITTI, including Cylinder3D, MinkUNet and SPVCNN methods. Noteworthy, the improved MinkUNetv2 can achieve 70.3 mIoU on the validation set of SemanticKITTI. We have also supported the training of BEVFusion and an occupancy prediction method, TPVFomrer, in our `projects`. More new features about 3D perception are on the way. Please stay tuned! We have constructed a comprehensive LiDAR semantic segmentation benchmark on SemanticKITTI, including Cylinder3D, MinkUNet and SPVCNN methods. Noteworthy, the improved MinkUNetv2 can achieve 70.3 mIoU on the validation set of SemanticKITTI. We have also supported the training of BEVFusion and an occupancy prediction method, TPVFomrer, in our `projects`. More new features about 3D perception are on the way. Please stay tuned!
**v1.3.0** was released in 18/10/2023:
- Support [CENet](https://arxiv.org/abs/2207.12691) in `projects`
- Enhance demos with new 3D inferencers
**v1.2.0** was released in 4/7/2023 **v1.2.0** was released in 4/7/2023
- Support [New Config Type](https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta) in `mmdet3d/config` - Support [New Config Type](https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta) in `mmdet3d/configs`
- Support the inference of [DSVT](<(https://arxiv.org/abs/2301.06051)>) in `projects` - Support the inference of [DSVT](<(https://arxiv.org/abs/2301.06051)>) in `projects`
- Support downloading datasets from [OpenDataLab](https://opendatalab.com/) using `mim` - Support downloading datasets from [OpenDataLab](https://opendatalab.com/) using `mim`
......
...@@ -108,9 +108,14 @@ MMDetection3D 是一个基于 PyTorch 的目标检测开源工具箱,下一代 ...@@ -108,9 +108,14 @@ MMDetection3D 是一个基于 PyTorch 的目标检测开源工具箱,下一代
我们在 SemanticKITTI 上构建了一个全面的点云语义分割基准,包括 Cylinder3D 、MinkUNet 和 SPVCNN 方法。其中,改进后的 MinkUNetv2 在验证集上可以达到 70.3 mIoU。我们还在 `projects` 中支持了 BEVFusion 的训练和全新的 3D 占有网格预测网络 TPVFormer。更多关于 3D 感知的新功能正在进行中。请继续关注! 我们在 SemanticKITTI 上构建了一个全面的点云语义分割基准,包括 Cylinder3D 、MinkUNet 和 SPVCNN 方法。其中,改进后的 MinkUNetv2 在验证集上可以达到 70.3 mIoU。我们还在 `projects` 中支持了 BEVFusion 的训练和全新的 3D 占有网格预测网络 TPVFormer。更多关于 3D 感知的新功能正在进行中。请继续关注!
**v1.3.0** 版本已经在 2023.10.18 发布:
-`projects` 中支持 [CENet](https://arxiv.org/abs/2207.12691)
- 使用新的 3D inferencers 增强演示代码效果
**v1.2.0** 版本已经在 2023.7.4 发布: **v1.2.0** 版本已经在 2023.7.4 发布:
-`mmdet3d/config`中支持 [新Config样式](https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta) -`mmdet3d/configs`中支持 [新Config样式](https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta)
-`projects` 中支持 [DSVT](<(https://arxiv.org/abs/2301.06051)>) 的推理 -`projects` 中支持 [DSVT](<(https://arxiv.org/abs/2301.06051)>) 的推理
- 支持通过 `mim`[OpenDataLab](https://opendatalab.com/) 下载数据集 - 支持通过 `mim`[OpenDataLab](https://opendatalab.com/) 下载数据集
...@@ -400,10 +405,10 @@ MMDetection3D 是一款由来自不同高校和企业的研发人员共同参与 ...@@ -400,10 +405,10 @@ MMDetection3D 是一款由来自不同高校和企业的研发人员共同参与
## 欢迎加入 OpenMMLab 社区 ## 欢迎加入 OpenMMLab 社区
扫描下方的二维码可关注 OpenMMLab 团队的[知乎官方账号](https://www.zhihu.com/people/openmmlab)加入 OpenMMLab 团队的[官方交流 QQ 群](https://jq.qq.com/?_wv=1027&k=K0QI8ByU),或通过添加微信“Open小喵Lab”加入官方交流微信群。 扫描下方的二维码可关注 OpenMMLab 团队的 [知乎官方账号](https://www.zhihu.com/people/openmmlab)扫描下方微信二维码添加喵喵好友,进入 MMDetection3D 微信交流社群。【加好友申请格式:研究方向+地区+学校/公司+姓名】
<div align="center"> <div align="center">
<img src="https://user-images.githubusercontent.com/58739961/187154320-f3312cdf-31f2-4316-9dbb-8d7b0e1b7e08.jpg" height="400" /> <img src="https://user-images.githubusercontent.com/25839884/203904835-62392033-02d4-4c73-a68c-c9e4c1e2b07f.jpg" height="400" /> <img src="https://user-images.githubusercontent.com/58739961/187151778-d17c1368-125f-4fde-adbe-38cc6eb3be98.jpg" height="400" /> <img src="https://user-images.githubusercontent.com/58739961/187154320-f3312cdf-31f2-4316-9dbb-8d7b0e1b7e08.jpg" height="400" /> <img src="https://github.com/open-mmlab/mmdetection3d/assets/62195058/dfb3f6a9-25c6-47a5-936b-3f1d7347a42b" height="400" />
</div> </div>
我们会在 OpenMMLab 社区为大家 我们会在 OpenMMLab 社区为大家
......
...@@ -2,117 +2,83 @@ ...@@ -2,117 +2,83 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 25,
"source": [
"from mmdet3d.apis import inference_detector, init_model\n",
"from mmdet3d.registry import VISUALIZERS\n",
"from mmdet3d.utils import register_all_modules"
],
"outputs": [],
"metadata": { "metadata": {
"pycharm": { "pycharm": {
"is_executing": false "is_executing": false
} }
}
}, },
{
"cell_type": "code",
"execution_count": null,
"source": [
"# register all modules in mmdet3d into the registries\n",
"register_all_modules()"
],
"outputs": [], "outputs": [],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 8,
"source": [ "source": [
"config_file = '../configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py'\n", "from mmdet3d.apis import LidarDet3DInferencer"
"# download the checkpoint from model zoo and put it in `checkpoints/`\n", ]
"checkpoint_file = '../work_dirs/second/epoch_40.pth'"
],
"outputs": [],
"metadata": {
"pycharm": {
"is_executing": false
}
}
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"source": [ "metadata": {},
"# build the model from a config file and a checkpoint file\n",
"model = init_model(config_file, checkpoint_file, device='cuda:0')"
],
"outputs": [], "outputs": [],
"metadata": {} "source": [
"# initialize inferencer\n",
"inferencer = LidarDet3DInferencer('pointpillars_kitti-3class')"
]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"source": [
"# init visualizer\n",
"visualizer = VISUALIZERS.build(model.cfg.visualizer)\n",
"visualizer.dataset_meta = {\n",
" 'CLASSES': model.CLASSES,\n",
" 'PALETTE': model.PALETTE\n",
"}"
],
"outputs": [],
"metadata": { "metadata": {
"pycharm": { "pycharm": {
"is_executing": false "is_executing": false
} }
} },
"outputs": [],
"source": [
"# inference\n",
"inputs = dict(points='./data/kitti/000008.bin')\n",
"inferencer(inputs)"
]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": null,
"source": [ "metadata": {},
"# test a single sample\n",
"pcd = './data/kitti/000008.bin'\n",
"result, data = inference_detector(model, pcd)\n",
"points = data['inputs']['points']\n",
"data_input = dict(points=points)"
],
"outputs": [], "outputs": [],
"metadata": { "source": [
"pycharm": { "# inference and visualize\n",
"is_executing": false "# NOTE: use the `Esc` key to exit Open3D window in Jupyter Notebook Environment\n",
} "inferencer(inputs, show=True)"
} ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"source": [ "metadata": {},
"# show the results\n",
"out_dir = './'\n",
"visualizer.add_datasample(\n",
" 'result',\n",
" data_input,\n",
" data_sample=result,\n",
" draw_gt=False,\n",
" show=True,\n",
" wait_time=0,\n",
" out_file=out_dir,\n",
" vis_task='det')"
],
"outputs": [], "outputs": [],
"metadata": { "source": [
"pycharm": { "# If your operating environment does not have a display device,\n",
"is_executing": false "# (e.g. a remote server), you can save the predictions and visualize\n",
} "# them in local devices.\n",
} "inferencer(inputs, show=False, out_dir='./remote_outputs')\n",
"\n",
"# Simulate the migration process\n",
"%mv ./remote_outputs ./local_outputs\n",
"\n",
"# Visualize the predictions from the saved files\n",
"# NOTE: use the `Esc` key to exit Open3D window in Jupyter Notebook Environment\n",
"local_inferencer = LidarDet3DInferencer('pointpillars_kitti-3class')\n",
"inputs = local_inferencer._inputs_to_list(inputs)\n",
"local_inferencer.visualize_preds_fromfile(inputs, ['local_outputs/preds/000008.json'], show=True)"
]
} }
], ],
"metadata": { "metadata": {
"interpreter": {
"hash": "a0c343fece975dd89087e8c2194dd4d3db28d7000f1b32ed9ed9d584dd54dbbe"
},
"kernelspec": { "kernelspec": {
"name": "python3", "display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.7.6 64-bit ('torch1.7-cu10.1': conda)" "language": "python",
"name": "python3"
}, },
"language_info": { "language_info": {
"codemirror_mode": { "codemirror_mode": {
...@@ -124,19 +90,16 @@ ...@@ -124,19 +90,16 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.7.6" "version": "3.9.16"
}, },
"pycharm": { "pycharm": {
"stem_cell": { "stem_cell": {
"cell_type": "raw", "cell_type": "raw",
"source": [],
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}
}
}, },
"interpreter": { "source": []
"hash": "a0c343fece975dd89087e8c2194dd4d3db28d7000f1b32ed9ed9d584dd54dbbe" }
} }
}, },
"nbformat": 4, "nbformat": 4,
......
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import logging
import os
from argparse import ArgumentParser from argparse import ArgumentParser
import mmcv from mmengine.logging import print_log
from mmdet3d.apis import inference_mono_3d_detector, init_model from mmdet3d.apis import MonoDet3DInferencer
from mmdet3d.registry import VISUALIZERS
def parse_args(): def parse_args():
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument('img', help='image file') parser.add_argument('img', help='Image file')
parser.add_argument('ann', help='ann file') parser.add_argument('infos', help='Infos file with annotations')
parser.add_argument('config', help='Config file') parser.add_argument('model', help='Config file')
parser.add_argument('checkpoint', help='Checkpoint file') parser.add_argument('weights', help='Checkpoint file')
parser.add_argument( parser.add_argument(
'--device', default='cuda:0', help='Device used for inference') '--device', default='cuda:0', help='Device used for inference')
parser.add_argument( parser.add_argument(
...@@ -21,50 +22,77 @@ def parse_args(): ...@@ -21,50 +22,77 @@ def parse_args():
default='CAM_BACK', default='CAM_BACK',
help='choose camera type to inference') help='choose camera type to inference')
parser.add_argument( parser.add_argument(
'--score-thr', type=float, default=0.30, help='bbox score threshold') '--pred-score-thr',
type=float,
default=0.3,
help='bbox score threshold')
parser.add_argument( parser.add_argument(
'--out-dir', type=str, default='demo', help='dir to save results') '--out-dir',
type=str,
default='outputs',
help='Output directory of prediction and visualization results.')
parser.add_argument( parser.add_argument(
'--show', '--show',
action='store_true', action='store_true',
help='show online visualization results') help='Show online visualization results')
parser.add_argument(
'--wait-time',
type=float,
default=-1,
help='The interval of show (s). Demo will be blocked in showing'
'results, if wait_time is -1. Defaults to -1.')
parser.add_argument( parser.add_argument(
'--snapshot', '--no-save-vis',
action='store_true', action='store_true',
help='whether to save online visualization results') help='Do not save detection visualization results')
args = parser.parse_args() parser.add_argument(
return args '--no-save-pred',
action='store_true',
help='Do not save detection prediction results')
parser.add_argument(
'--print-result',
action='store_true',
help='Whether to print the results.')
call_args = vars(parser.parse_args())
call_args['inputs'] = dict(
img=call_args.pop('img'), infos=call_args.pop('infos'))
call_args.pop('cam_type')
if call_args['no_save_vis'] and call_args['no_save_pred']:
call_args['out_dir'] = ''
init_kws = ['model', 'weights', 'device']
init_args = {}
for init_kw in init_kws:
init_args[init_kw] = call_args.pop(init_kw)
# NOTE: If your operating environment does not have a display device,
# (e.g. a remote server), you can save the predictions and visualize
# them in local devices.
if os.environ.get('DISPLAY') is None and call_args['show']:
print_log(
'Display device not found. `--show` is forced to False',
logger='current',
level=logging.WARNING)
call_args['show'] = False
def main(args): return init_args, call_args
# build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device)
# init visualizer
visualizer = VISUALIZERS.build(model.cfg.visualizer)
visualizer.dataset_meta = model.dataset_meta
# test a single image def main():
result = inference_mono_3d_detector(model, args.img, args.ann, # TODO: Support inference of point cloud numpy file.
args.cam_type) init_args, call_args = parse_args()
img = mmcv.imread(args.img) inferencer = MonoDet3DInferencer(**init_args)
img = mmcv.imconvert(img, 'bgr', 'rgb') inferencer(**call_args)
data_input = dict(img=img) if call_args['out_dir'] != '' and not (call_args['no_save_vis']
# show the results and call_args['no_save_pred']):
visualizer.add_datasample( print_log(
'result', f'results have been saved at {call_args["out_dir"]}',
data_input, logger='current')
data_sample=result,
draw_gt=False,
show=args.show,
wait_time=-1,
out_file=args.out_dir,
pred_score_thr=args.score_thr,
vis_task='mono_det')
if __name__ == '__main__': if __name__ == '__main__':
args = parse_args() main()
main(args)
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import logging
import os
from argparse import ArgumentParser from argparse import ArgumentParser
import mmcv from mmengine.logging import print_log
from mmdet3d.apis import inference_multi_modality_detector, init_model from mmdet3d.apis import MultiModalityDet3DInferencer
from mmdet3d.registry import VISUALIZERS
def parse_args(): def parse_args():
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument('pcd', help='Point cloud file') parser.add_argument('pcd', help='Point cloud file')
parser.add_argument('img', help='image file') parser.add_argument('img', help='Image file')
parser.add_argument('ann', help='ann file') parser.add_argument('infos', help='Infos file with annotations')
parser.add_argument('config', help='Config file') parser.add_argument('model', help='Config file')
parser.add_argument('checkpoint', help='Checkpoint file') parser.add_argument('weights', help='Checkpoint file')
parser.add_argument( parser.add_argument(
'--device', default='cuda:0', help='Device used for inference') '--device', default='cuda:0', help='Device used for inference')
parser.add_argument( parser.add_argument(
...@@ -22,57 +23,79 @@ def parse_args(): ...@@ -22,57 +23,79 @@ def parse_args():
default='CAM_FRONT', default='CAM_FRONT',
help='choose camera type to inference') help='choose camera type to inference')
parser.add_argument( parser.add_argument(
'--score-thr', type=float, default=0.0, help='bbox score threshold') '--pred-score-thr',
type=float,
default=0.3,
help='bbox score threshold')
parser.add_argument( parser.add_argument(
'--out-dir', type=str, default='demo', help='dir to save results') '--out-dir',
type=str,
default='outputs',
help='Output directory of prediction and visualization results.')
parser.add_argument( parser.add_argument(
'--show', '--show',
action='store_true', action='store_true',
help='show online visualization results') help='Show online visualization results')
parser.add_argument(
'--wait-time',
type=float,
default=-1,
help='The interval of show (s). Demo will be blocked in showing'
'results, if wait_time is -1. Defaults to -1.')
parser.add_argument(
'--no-save-vis',
action='store_true',
help='Do not save detection visualization results')
parser.add_argument(
'--no-save-pred',
action='store_true',
help='Do not save detection prediction results')
parser.add_argument( parser.add_argument(
'--snapshot', '--print-result',
action='store_true', action='store_true',
help='whether to save online visualization results') help='Whether to print the results.')
args = parser.parse_args() call_args = vars(parser.parse_args())
return args
call_args['inputs'] = dict(
points=call_args.pop('pcd'),
img=call_args.pop('img'),
infos=call_args.pop('infos'))
call_args.pop('cam_type')
if call_args['no_save_vis'] and call_args['no_save_pred']:
call_args['out_dir'] = ''
init_kws = ['model', 'weights', 'device']
init_args = {}
for init_kw in init_kws:
init_args[init_kw] = call_args.pop(init_kw)
# NOTE: If your operating environment does not have a display device,
# (e.g. a remote server), you can save the predictions and visualize
# them in local devices.
if os.environ.get('DISPLAY') is None and call_args['show']:
print_log(
'Display device not found. `--show` is forced to False',
logger='current',
level=logging.WARNING)
call_args['show'] = False
return init_args, call_args
def main(args):
# build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device)
# init visualizer def main():
visualizer = VISUALIZERS.build(model.cfg.visualizer) # TODO: Support inference of point cloud numpy file.
visualizer.dataset_meta = model.dataset_meta init_args, call_args = parse_args()
# test a single image and point cloud sample inferencer = MultiModalityDet3DInferencer(**init_args)
result, data = inference_multi_modality_detector(model, args.pcd, args.img, inferencer(**call_args)
args.ann, args.cam_type)
points = data['inputs']['points']
if isinstance(result.img_path, list):
img = []
for img_path in result.img_path:
single_img = mmcv.imread(img_path)
single_img = mmcv.imconvert(single_img, 'bgr', 'rgb')
img.append(single_img)
else:
img = mmcv.imread(result.img_path)
img = mmcv.imconvert(img, 'bgr', 'rgb')
data_input = dict(points=points, img=img)
# show the results if call_args['out_dir'] != '' and not (call_args['no_save_vis']
visualizer.add_datasample( and call_args['no_save_pred']):
'result', print_log(
data_input, f'results have been saved at {call_args["out_dir"]}',
data_sample=result, logger='current')
draw_gt=False,
show=args.show,
wait_time=-1,
out_file=args.out_dir,
pred_score_thr=args.score_thr,
vis_task='multi-modality_det')
if __name__ == '__main__': if __name__ == '__main__':
args = parse_args() main()
main(args)
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import logging
import os
from argparse import ArgumentParser from argparse import ArgumentParser
from mmdet3d.apis import inference_detector, init_model from mmengine.logging import print_log
from mmdet3d.registry import VISUALIZERS
from mmdet3d.apis import LidarDet3DInferencer
def parse_args(): def parse_args():
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument('pcd', help='Point cloud file') parser.add_argument('pcd', help='Point cloud file')
parser.add_argument('config', help='Config file') parser.add_argument('model', help='Config file')
parser.add_argument('checkpoint', help='Checkpoint file') parser.add_argument('weights', help='Checkpoint file')
parser.add_argument( parser.add_argument(
'--device', default='cuda:0', help='Device used for inference') '--device', default='cuda:0', help='Device used for inference')
parser.add_argument( parser.add_argument(
'--score-thr', type=float, default=0.0, help='bbox score threshold') '--pred-score-thr',
type=float,
default=0.3,
help='bbox score threshold')
parser.add_argument( parser.add_argument(
'--out-dir', type=str, default='demo', help='dir to save results') '--out-dir',
type=str,
default='outputs',
help='Output directory of prediction and visualization results.')
parser.add_argument( parser.add_argument(
'--show', '--show',
action='store_true', action='store_true',
help='show online visualization results') help='Show online visualization results')
parser.add_argument(
'--wait-time',
type=float,
default=-1,
help='The interval of show (s). Demo will be blocked in showing'
'results, if wait_time is -1. Defaults to -1.')
parser.add_argument(
'--no-save-vis',
action='store_true',
help='Do not save detection visualization results')
parser.add_argument( parser.add_argument(
'--snapshot', '--no-save-pred',
action='store_true', action='store_true',
help='whether to save online visualization results') help='Do not save detection prediction results')
args = parser.parse_args() parser.add_argument(
return args '--print-result',
action='store_true',
help='Whether to print the results.')
call_args = vars(parser.parse_args())
call_args['inputs'] = dict(points=call_args.pop('pcd'))
if call_args['no_save_vis'] and call_args['no_save_pred']:
call_args['out_dir'] = ''
def main(args): init_kws = ['model', 'weights', 'device']
init_args = {}
for init_kw in init_kws:
init_args[init_kw] = call_args.pop(init_kw)
# NOTE: If your operating environment does not have a display device,
# (e.g. a remote server), you can save the predictions and visualize
# them in local devices.
if os.environ.get('DISPLAY') is None and call_args['show']:
print_log(
'Display device not found. `--show` is forced to False',
logger='current',
level=logging.WARNING)
call_args['show'] = False
return init_args, call_args
def main():
# TODO: Support inference of point cloud numpy file. # TODO: Support inference of point cloud numpy file.
# build the model from a config file and a checkpoint file init_args, call_args = parse_args()
model = init_model(args.config, args.checkpoint, device=args.device)
inferencer = LidarDet3DInferencer(**init_args)
# init visualizer inferencer(**call_args)
visualizer = VISUALIZERS.build(model.cfg.visualizer)
visualizer.dataset_meta = model.dataset_meta if call_args['out_dir'] != '' and not (call_args['no_save_vis']
and call_args['no_save_pred']):
# test a single point cloud sample print_log(
result, data = inference_detector(model, args.pcd) f'results have been saved at {call_args["out_dir"]}',
points = data['inputs']['points'] logger='current')
data_input = dict(points=points)
# show the results
visualizer.add_datasample(
'result',
data_input,
data_sample=result,
draw_gt=False,
show=args.show,
wait_time=-1,
out_file=args.out_dir,
pred_score_thr=args.score_thr,
vis_task='lidar_det')
if __name__ == '__main__': if __name__ == '__main__':
args = parse_args() main()
main(args)
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) OpenMMLab. All rights reserved.
import logging
import os
from argparse import ArgumentParser from argparse import ArgumentParser
from mmdet3d.apis import inference_segmentor, init_model from mmengine.logging import print_log
from mmdet3d.registry import VISUALIZERS
from mmdet3d.apis import LidarSeg3DInferencer
def parse_args(): def parse_args():
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument('pcd', help='Point cloud file') parser.add_argument('pcd', help='Point cloud file')
parser.add_argument('config', help='Config file') parser.add_argument('model', help='Config file')
parser.add_argument('checkpoint', help='Checkpoint file') parser.add_argument('weights', help='Checkpoint file')
parser.add_argument( parser.add_argument(
'--device', default='cuda:0', help='Device used for inference') '--device', default='cuda:0', help='Device used for inference')
parser.add_argument( parser.add_argument(
'--out-dir', type=str, default='demo', help='dir to save results') '--out-dir',
type=str,
default='outputs',
help='Output directory of prediction and visualization results.')
parser.add_argument( parser.add_argument(
'--show', '--show',
action='store_true', action='store_true',
help='show online visualization results') help='Show online visualization results')
parser.add_argument(
'--wait-time',
type=float,
default=-1,
help='The interval of show (s). Demo will be blocked in showing'
'results, if wait_time is -1. Defaults to -1.')
parser.add_argument(
'--no-save-vis',
action='store_true',
help='Do not save detection visualization results')
parser.add_argument( parser.add_argument(
'--snapshot', '--no-save-pred',
action='store_true', action='store_true',
help='whether to save online visualization results') help='Do not save detection prediction results')
args = parser.parse_args() parser.add_argument(
return args '--print-result',
action='store_true',
help='Whether to print the results.')
def main(args): call_args = vars(parser.parse_args())
# build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device) call_args['inputs'] = dict(points=call_args.pop('pcd'))
# init visualizer if call_args['no_save_vis'] and call_args['no_save_pred']:
visualizer = VISUALIZERS.build(model.cfg.visualizer) call_args['out_dir'] = ''
visualizer.dataset_meta = model.dataset_meta
init_kws = ['model', 'weights', 'device']
# test a single point cloud sample init_args = {}
result, data = inference_segmentor(model, args.pcd) for init_kw in init_kws:
points = data['inputs']['points'] init_args[init_kw] = call_args.pop(init_kw)
data_input = dict(points=points)
# show the results # NOTE: If your operating environment does not have a display device,
visualizer.add_datasample( # (e.g. a remote server), you can save the predictions and visualize
'result', # them in local devices.
data_input, if os.environ.get('DISPLAY') is None and call_args['show']:
data_sample=result, print_log(
draw_gt=False, 'Display device not found. `--show` is forced to False',
show=args.show, logger='current',
wait_time=-1, level=logging.WARNING)
out_file=args.out_dir, call_args['show'] = False
vis_task='lidar_seg')
return init_args, call_args
def main():
# TODO: Support inference of point cloud numpy file.
init_args, call_args = parse_args()
inferencer = LidarSeg3DInferencer(**init_args)
inferencer(**call_args)
if call_args['out_dir'] != '' and not (call_args['no_save_vis']
and call_args['no_save_pred']):
print_log(
f'results have been saved at {call_args["out_dir"]}',
logger='current')
if __name__ == '__main__': if __name__ == '__main__':
args = parse_args() main()
main(args)
...@@ -4,8 +4,8 @@ ARG CUDNN="8" ...@@ -4,8 +4,8 @@ ARG CUDNN="8"
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
ARG MMCV="2.0.0rc4" ARG MMCV="2.0.0rc4"
ARG MMDET="3.0.0" ARG MMDET="3.1.0"
ARG MMDET3D="1.1.0" ARG MMDET3D="1.3.0"
ENV PYTHONUNBUFFERED TRUE ENV PYTHONUNBUFFERED TRUE
......
...@@ -153,7 +153,9 @@ Intensity is not used by default due to its yielded noise when concatenating the ...@@ -153,7 +153,9 @@ Intensity is not used by default due to its yielded noise when concatenating the
### Vision-Based Methods ### Vision-Based Methods
A typical training pipeline of image-based 3D detection on nuScenes is as below. #### Monocular-based
In the NuScenes dataset, for multi-view images, this paradigm usually involves detecting and outputting 3D object detection results separately for each image, and then obtaining the final detection results through post-processing (such as NMS). Essentially, it directly extends monocular 3D detection to multi-view settings. A typical training pipeline of image-based monocular 3D detection on nuScenes is as below.
```python ```python
train_pipeline = [ train_pipeline = [
...@@ -184,6 +186,68 @@ It follows the general pipeline of 2D detection while differs in some details: ...@@ -184,6 +186,68 @@ It follows the general pipeline of 2D detection while differs in some details:
- Some data augmentation techniques need to be adjusted, such as `RandomFlip3D`. - Some data augmentation techniques need to be adjusted, such as `RandomFlip3D`.
Currently we do not support more augmentation methods, because how to transfer and apply other techniques is still under explored. Currently we do not support more augmentation methods, because how to transfer and apply other techniques is still under explored.
#### BEV-based
BEV, Bird's-Eye-View, is another popular 3D detection paradigm. It directly takes multi-view images to perform 3D detection, for nuScenes, they are `CAM_FRONT`, `CAM_FRONT_LEFT`, `CAM_FRONT_RIGHT`, `CAM_BACK`, `CAM_BACK_LEFT` and `CAM_BACK_RIGHT`. A basic training pipeline of bev-based 3D detection on nuScenes is as below.
```python
class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
point_cloud_range = [-51.2, -51.2, -5.0, 51.2, 51.2, 3.0]
train_transforms = [
dict(type='PhotoMetricDistortion3D'),
dict(
type='RandomResize3D',
scale=(1600, 900),
ratio_range=(1., 1.),
keep_ratio=True)
]
train_pipeline = [
dict(type='LoadMultiViewImageFromFiles',
to_float32=True,
num_views=6, ),
dict(type='LoadAnnotations3D',
with_bbox_3d=True,
with_label_3d=True,
with_attr_label=False),
# optional, data augmentation
dict(type='MultiViewWrapper', transforms=train_transforms),
# optional, filter object within specific point cloud range
dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range),
# optional, filter object of specific classes
dict(type='ObjectNameFilter', classes=class_names),
dict(type='Pack3DDetInputs', keys=['img', 'gt_bboxes_3d', 'gt_labels_3d'])
]
```
To load multiple view of images, a little modification should be made to the dataset.
```python
data_prefix = dict(
CAM_FRONT='samples/CAM_FRONT',
CAM_FRONT_LEFT='samples/CAM_FRONT_LEFT',
CAM_FRONT_RIGHT='samples/CAM_FRONT_RIGHT',
CAM_BACK='samples/CAM_BACK',
CAM_BACK_RIGHT='samples/CAM_BACK_RIGHT',
CAM_BACK_LEFT='samples/CAM_BACK_LEFT',
)
train_dataloader = dict(
batch_size=4,
persistent_workers=True,
sampler=dict(type='DefaultSampler', shuffle=True),
dataset=dict(
type="NuScenesDataset",
data_root="./data/nuScenes",
ann_file="nuscenes_infos_train.pkl",
data_prefix=data_prefix,
modality=dict(use_camera=True, use_lidar=False, ),
pipeline=train_pipeline,
test_mode=False, )
)
```
## Evaluation ## Evaluation
An example to evaluate PointPillars with 8 GPUs with nuScenes metrics is as follows. An example to evaluate PointPillars with 8 GPUs with nuScenes metrics is as follows.
......
...@@ -141,6 +141,10 @@ You will see a visualizer interface with point cloud, where bounding boxes are p ...@@ -141,6 +141,10 @@ You will see a visualizer interface with point cloud, where bounding boxes are p
**Note**: **Note**:
If you install MMDetection3D on a remote server without display device, you can leave out the `--show` argument. Demo will still save the predictions to `outputs/pred/000008.json` file.
**Note**:
If you want to input a `.ply` file, you can use the following function and convert it to `.bin` format. Then you can use the converted `.bin` file to run demo. If you want to input a `.ply` file, you can use the following function and convert it to `.bin` format. Then you can use the converted `.bin` file to run demo.
Note that you need to install `pandas` and `plyfile` before using this script. This function can also be used for data preprocessing for training `ply data`. Note that you need to install `pandas` and `plyfile` before using this script. This function can also be used for data preprocessing for training `ply data`.
......
# Changelog of v1.1 # Changelog of v1.1
### v1.3.0 (18/10/2023)
#### Highlights
- Support [CENet](https://arxiv.org/abs/2207.12691) in `projects` (#2619)
- Enhance demos with new 3D inferencers (#2763)
#### New Features
- Support [CENet](https://arxiv.org/abs/2207.12691) in `projects` (#2619)
#### Improvements
- Enhance demos with new 3D inferencers (#2763)
- Add BEV-based detection pipeline in nuScenes dataset tutorial (#2672)
- Add the new config type of Cylinder3D in `mmdet3d/configs` (#2681)
- Update [New Config Type](https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#a-pure-python-style-configuration-file-beta) (#2655)
- Update the QR code in README.md (#2703)
#### Bug Fixes
- Fix the download script of nuScenes dataset (#2660)
- Fix circleCI and GitHub workflow configuration (#2652)
- Fix the version of Open3D in requirements (#2633)
- Fix unused files in `mmdet3d/configs` (#2773)
- Fix support devices in FreeAnchor3DHead (#2769)
- Fix readthedocs building and link (#2739, #2650)
- Fix the pitch angle bug in LaserMix (#2710)
#### Contributors
A total of 6 developers contributed to this release.
@sunjiahao1999, @Xiangxu-0103, @ZhaoCake, @LRJKD, @crazysteeaam, @wep21, @zhiqwang
### v1.2.0 (4/7/2023) ### v1.2.0 (4/7/2023)
#### Highlights #### Highlights
......
...@@ -108,7 +108,7 @@ Since definitions of box representation have changed, the annotation data of mos ...@@ -108,7 +108,7 @@ Since definitions of box representation have changed, the annotation data of mos
Please regenerate the data annotation/GT database files or use [`update_data_coords.py`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/tools/update_data_coords.py) to update the data. Please regenerate the data annotation/GT database files or use [`update_data_coords.py`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/tools/update_data_coords.py) to update the data.
To use boxes under Depth and LiDAR coordinate systems, or to convert boxes between different coordinate systems, users should be aware of the difference between the old and new definitions. For example, the rotation, flipping, and bev functions of [`DepthInstance3DBoxes`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/core/bbox/structures/depth_box3d.py) and [`LiDARInstance3DBoxes`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mdet3d/core/bbox/structures/lidar_box3d.py) and box conversion [functions](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/core/bbox/structures/box_3d_mode.py) have all been reimplemented in the refactoring. To use boxes under Depth and LiDAR coordinate systems, or to convert boxes between different coordinate systems, users should be aware of the difference between the old and new definitions. For example, the rotation, flipping, and bev functions of [`DepthInstance3DBoxes`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/core/bbox/structures/depth_box3d.py) and [`LiDARInstance3DBoxes`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/core/bbox/structures/lidar_box3d.py) and box conversion [functions](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/core/bbox/structures/box_3d_mode.py) have all been reimplemented in the refactoring.
Consequently, functions like [`output_to_lyft_box`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/datasets/lyft_dataset.py) undergo small modification to adapt to the new LiDAR/Depth box. Consequently, functions like [`output_to_lyft_box`](https://github.com/open-mmlab/mmdetection3d/blob/v1.0.0rc0/mmdet3d/datasets/lyft_dataset.py) undergo small modification to adapt to the new LiDAR/Depth box.
......
...@@ -9,9 +9,10 @@ We list some potential troubles encountered by users and developers, along with ...@@ -9,9 +9,10 @@ We list some potential troubles encountered by users and developers, along with
- The required versions of MMEngine, MMCV and MMDetection for different versions of MMDetection3D are as below. Please install the correct version of MMEngine, MMCV and MMDetection to avoid installation issues. - The required versions of MMEngine, MMCV and MMDetection for different versions of MMDetection3D are as below. Please install the correct version of MMEngine, MMCV and MMDetection to avoid installation issues.
| MMDetection3D version | MMEngine version | MMCV version | MMDetection version | | MMDetection3D version | MMEngine version | MMCV version | MMDetection version |
| --------------------- | :----------------------: | :---------------------: | :-------------------: | | --------------------- | :----------------------: | :---------------------: | :----------------------: |
| dev-1.x | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0, \<3.2.0 | | dev-1.x | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.2.0 | mmdet>=3.0.0rc5, \<3.3.0 |
| main | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0, \<3.2.0 | | main | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.2.0 | mmdet>=3.0.0rc5, \<3.3.0 |
| v1.3.0 | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.2.0 | mmdet>=3.0.0rc5, \<3.3.0 |
| v1.2.0 | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0, \<3.2.0 | | v1.2.0 | mmengine>=0.8.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0, \<3.2.0 |
| v1.1.1 | mmengine>=0.7.1, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0, \<3.1.0 | | v1.1.1 | mmengine>=0.7.1, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0, \<3.1.0 |
......
...@@ -146,7 +146,9 @@ train_pipeline = [ ...@@ -146,7 +146,9 @@ train_pipeline = [
### 基于视觉的方法 ### 基于视觉的方法
nuScenes 上基于图像的 3D 检测的典型训练流水线如下。 #### 基于单目方法
在NuScenes数据集中,对于多视角图像,单目检测范式通常由针对每张图像检测和输出 3D 检测结果以及通过后处理(例如 NMS )得到最终检测结果两步组成。从本质上来说,这种范式直接将单目 3D 检测扩展到多视角任务。NuScenes 上基于图像的 3D 检测的典型训练流水线如下。
```python ```python
train_pipeline = [ train_pipeline = [
...@@ -159,7 +161,7 @@ train_pipeline = [ ...@@ -159,7 +161,7 @@ train_pipeline = [
with_bbox_3d=True, with_bbox_3d=True,
with_label_3d=True, with_label_3d=True,
with_bbox_depth=True), with_bbox_depth=True),
dict(type='mmdet.Resize', img_scale=(1600, 900), keep_ratio=True), dict(type='mmdet.Resize', scale=(1600, 900), keep_ratio=True),
dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5),
dict( dict(
type='Pack3DDetInputs', type='Pack3DDetInputs',
...@@ -176,6 +178,68 @@ train_pipeline = [ ...@@ -176,6 +178,68 @@ train_pipeline = [
- 它需要加载 3D 标注。 - 它需要加载 3D 标注。
- 一些数据增强技术需要调整,例如`RandomFlip3D`。目前我们不支持更多的增强方法,因为如何迁移和应用其他技术仍在探索中。 - 一些数据增强技术需要调整,例如`RandomFlip3D`。目前我们不支持更多的增强方法,因为如何迁移和应用其他技术仍在探索中。
#### 基于BEV方法
鸟瞰图,BEV(Bird's-Eye-View),是另一种常用的 3D 检测范式。它直接利用多个视角图像进行 3D 检测。对于 NuScenes 数据集而言,这些视角包括前方`CAM_FRONT`、左前方`CAM_FRONT_LEFT`、右前方`CAM_FRONT_RIGHT`、后方`CAM_BACK`、左后方`CAM_BACK_LEFT`、右后方`CAM_BACK_RIGHT`。一个基本的用于 BEV 方法的流水线如下。
```python
class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
point_cloud_range = [-51.2, -51.2, -5.0, 51.2, 51.2, 3.0]
train_transforms = [
dict(type='PhotoMetricDistortion3D'),
dict(
type='RandomResize3D',
scale=(1600, 900),
ratio_range=(1., 1.),
keep_ratio=True)
]
train_pipeline = [
dict(type='LoadMultiViewImageFromFiles',
to_float32=True,
num_views=6, ),
dict(type='LoadAnnotations3D',
with_bbox_3d=True,
with_label_3d=True,
with_attr_label=False),
# 可选,数据增强
dict(type='MultiViewWrapper', transforms=train_transforms),
# 可选, 筛选特定点云范围内物体
dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range),
# 可选, 筛选特定类别物体
dict(type='ObjectNameFilter', classes=class_names),
dict(type='Pack3DDetInputs', keys=['img', 'gt_bboxes_3d', 'gt_labels_3d'])
]
```
为了读取多个视角的图像,数据集也应进行相应微调。
```python
data_prefix = dict(
CAM_FRONT='samples/CAM_FRONT',
CAM_FRONT_LEFT='samples/CAM_FRONT_LEFT',
CAM_FRONT_RIGHT='samples/CAM_FRONT_RIGHT',
CAM_BACK='samples/CAM_BACK',
CAM_BACK_RIGHT='samples/CAM_BACK_RIGHT',
CAM_BACK_LEFT='samples/CAM_BACK_LEFT',
)
train_dataloader = dict(
batch_size=4,
persistent_workers=True,
sampler=dict(type='DefaultSampler', shuffle=True),
dataset=dict(
type="NuScenesDataset",
data_root="./data/nuScenes",
ann_file="nuscenes_infos_train.pkl",
data_prefix=data_prefix,
modality=dict(use_camera=True, use_lidar=False, ),
pipeline=train_pipeline,
test_mode=False, )
)
```
## 评估 ## 评估
使用 8 个 GPU 以及 nuScenes 指标评估的 PointPillars 的示例如下 使用 8 个 GPU 以及 nuScenes 指标评估的 PointPillars 的示例如下
......
...@@ -139,6 +139,10 @@ python demo/pcd_demo.py demo/data/kitti/000008.bin pointpillars_hv_secfpn_8xb6-1 ...@@ -139,6 +139,10 @@ python demo/pcd_demo.py demo/data/kitti/000008.bin pointpillars_hv_secfpn_8xb6-1
**注意** **注意**
如果你在没有显示设备的服务器上安装 MMDetection3D ,你可以忽略 `--show` 参数。Demo 仍会将预测结果保存到 `outputs/pred/000008.json` 文件中。
**注意**
如果您想输入一个 `.ply` 文件,您可以使用如下函数将它转换成 `.bin` 格式。然后您可以使用转化的 `.bin` 文件来运行样例。请注意在使用此脚本之前,您需要安装 `pandas``plyfile`。这个函数也可以用于训练 `ply 数据`时作为数据预处理来使用。 如果您想输入一个 `.ply` 文件,您可以使用如下函数将它转换成 `.bin` 格式。然后您可以使用转化的 `.bin` 文件来运行样例。请注意在使用此脚本之前,您需要安装 `pandas``plyfile`。这个函数也可以用于训练 `ply 数据`时作为数据预处理来使用。
```python ```python
......
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