MMDetection3D&可视化kitti数据集&bin点云

参考官方的框架:https://github.com/open-mmlab/mmdetection3d/blob/master/docs/getting_started.md

运行如下命令生成模型.pkl文件和可视化文件000000_gt.obj ,000000_points.obj

python tools/test.py ${CONFIG_FILE} ${CKPT_PATH} --out ./data/result_output/out_dir/3dssd.pkl --eval 'mAP' --eval-options 'show=True' 'out_dir=./show_result'

结果图:

 

可视化kitti数据集:

python tools/misc/browse_dataset.py configs/mvxnet/dv_mvx-fpn_second_secfpn_adamw_2x8_80e_kitti-3d-3class.py --task multi_modality-det --output-dir work_dirs1 --online

效果图:

 

 

 

Velodyne Point Cloud-激光雷达点云bin文件读取和显示-mayavi

 

import mayavi.mlab
import torch
import numpy as np

mypointcloud=np.fromfile("/home/zzn/Documents/test/lidar/000002.bin",dtype=np.float32,count=-1).reshape([-1,4])
mypointcloud=torch.from_numpy(mypointcloud)
print(mypointcloud.size())
print(mypointcloud.type())

def viz_mayavi(points,vals="distance"):
    x=points[:,0]
    y=points[:,1]
    z=points[:,2]
    r=points[:,3]
    d=torch.sqrt(x**2+y**2)

    if vals=="height":
        col=z
    else:
        col=d

    fig=mayavi.mlab.figure(bgcolor=(0,0,0),size=(1280,720))
    mayavi.mlab.points3d(x,y,z,
                         col,
                         mode="point",
                         colormap='spectral',
                         figure=fig,
                         )

    mayavi.mlab.show()

if __name__=="__main__":
    viz_mayavi(mypointcloud,vals="height")

保存:

 

你可以按照以下步骤将KITTI数据集转换为MMDetection3D格式: 1. 首先,确保你已经下载了KITTI数据集,并且文件结构如下所示: ``` KITTI ├── training │ ├── calib │ ├── image_2 │ ├── label_2 │ ├── velodyne │ └── ... └── testing ├── calib ├── image_2 ├── velodyne └── ... ``` 2. 然后,你需要安装MMDetection3D库。你可以按照官方文档中的指示进行安装:https://mmdetection3d.readthedocs.io/en/latest/getting_started.html#installation 3. 接下来,你需要创建一个配置文件,指定数据集的相关信息。在MMDetection3D中,配置文件通常是一个Python脚本。你可以在`configs/dataset`目录下找到示例配置文件,比如`kitti_dataset.py`。 4. 打开配置文件,并根据你的数据集路径进行相应的修改。主要需要修改的变量有: - `root_path`:指定KITTI数据集的根路径。 - `train_pipeline`和`test_pipeline`:指定数据预处理和增强的操作。 5. 保存并关闭配置文件。 6. 现在,你可以使用MMDetection3D提供的工具将KITTI数据集转换为MMDetection3D格式。在命令行中执行以下命令: ``` python tools/data_converter/kitti_converter.py <path_to_config_file> ``` 其中,`<path_to_config_file>`是你刚刚创建的配置文件的路径。 7. 执行上述命令后,MMDetection3D将会将KITTI数据集转换为MMDetection3D格式,并保存在指定的输出路径中。 完成上述步骤后,你就成功将KITTI数据集转换为MMDetection3D格式了。你可以使用转换后的数据集进行目标检测3D物体检测任务。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值