MMDetection3D 实践

MMDetection3D 实践

MMDetection3D 实践

参考视频:https://www.bilibili.com/video/BV1aG4y197is/?spm_id_from=333.788&vd_source=89cd1bd958a3eea212de763dc113559e

参考文档:https://mmdetection3d.readthedocs.io/en/latest/

MMDetection3D 安装配置

在已经配置好torch 和openmim情况下

激活配置环境

安装open3d

pip install open3d

git clone https://github.com/open-mmlab/mmdetection3d.git

cd mmdetection3d

mim install -e .

一小段报错信息。。。。

1
2
3
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.`
`mmsegmentation 0.30.0 requires mmcv-full<1.7.0,>=1.4.4, but you have mmcv-full 1.7.1 which is incompatible.`
`Successfully installed Flask-2.2.5 Jinja2-3.1.2 MarkupSafe-2.1.3 PyWavelets-1.4.1 Send2Trash-1.8.2 absl-py-1.4.0 anyio-3.7.0 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 arrow-1.2.3 attrs-23.1.0 beautifulsoup4-4.12.2 black-23.3.0 bleach-6.0.0 cachetools-5.3.1 cffi-1.15.1 configargparse-1.5.3 dash-2.10.2 dash-core-components-2.0.0 dash-html-components-2.0.0 dash-table-5.0.0 defusedxml-0.7.1 descartes-1.1.0 exceptiongroup-1.1.1 fastjsonschema-2.17.1 fire-0.5.0 flake8-6.0.0 fqdn-1.5.1 google-auth-2.20.0 google-auth-oauthlib-1.0.0 grpcio-1.54.2 imageio-2.31.1 iniconfig-2.0.0 ipython-genutils-0.2.0 isoduration-20.11.0 itsdangerous-2.1.2 joblib-1.2.0 jsonpointer-2.4 jsonschema-4.17.3 jupyter-1.0.0 jupyter-console-6.6.3 jupyter-events-0.6.3 jupyter-server-2.6.0 jupyter-server-terminals-0.4.4 jupyterlab-pygments-0.2.2 lazy_loader-0.2 llvmlite-0.40.1rc1 lyft_dataset_sdk-0.0.8 matplotlib-3.5.2 mccabe-0.7.0 mistune-3.0.1 mmcv-2.0.0 mmdet-3.0.0 mmdet3d-1.1.1 mmengine-0.7.4 mypy-extensions-1.0.0 nbclassic-1.0.0 nbclient-0.8.0 nbconvert-7.6.0 nbformat-5.7.0 networkx-3.1 notebook-6.5.4 notebook-shim-0.2.3 numba-0.57.0 nuscenes-devkit-1.1.10 oauthlib-3.2.2 open3d-0.17.0 overrides-7.3.1 pandocfilters-1.5.0 pathspec-0.11.1 plotly-5.15.0 pluggy-1.0.0 plyfile-0.9 prometheus-client-0.17.0 protobuf-4.23.3 pyasn1-0.5.0 pyasn1-modules-0.3.0 pycodestyle-2.10.0 pycparser-2.21 pyflakes-3.0.1 pyquaternion-0.9.9 pyrsistent-0.19.3 pytest-7.3.2 python-json-logger-2.0.7 pywinpty-2.0.10 qtconsole-5.4.3 qtpy-2.3.1 requests-oauthlib-1.3.1 rfc3339-validator-0.1.4 rfc3986-validator-0.1.1 rsa-4.9 scikit-image-0.21.0 scikit-learn-1.2.2 shapely-1.8.5 sniffio-1.3.0 soupsieve-2.4.1 tenacity-8.2.2 tensorboard-2.13.0 tensorboard-data-server-0.7.1 terminado-0.17.1 threadpoolctl-3.1.0 tifffile-2023.4.12 tinycss2-1.2.1 tomli-2.0.1 trimesh-3.22.1 uri-template-1.2.0 webcolors-1.13 webencodings-0.5.1 websocket-client-1.6.0 werkzeug-2.2.3

import mmdet3d

mmdet3d.__version__
'1.1.1'

使用预训练模型推理

点云数据清理

1
pip install open3d 

ImportError: cannot import name 'show_result_meshlab' from 'mmdet3d.apis'

在使用’show_result’处改为’model.show_result()’。

1
2
model.show_result(
img,result,model.CLASSES, score_thr=args.score_thr, wait_time=1)

!mim download mmdet3d --config pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car --dest checkpoints

!python demo/pcd_demo.py demo/data/kitti/000008.bin checkpoints/pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py checkpoints/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth --show

1687337312236