当前位置:网站首页>mmdetection3d(2)---结果、log可视化
mmdetection3d(2)---结果、log可视化
2022-07-28 16:34:00 【张飞飞~】
1.结果可视化:
安装的docker 版本的mmdetection3d在可视化的时候存在一些问题,open3d总是难以打开窗口,但源码安装的版本是可以实现可视化的。所以采用源码安装方法。源码安装也比较简便,环境没什么问题的话,过程很顺滑。
(1)源码安装步骤
安装过程方法:https://github.com/open-mmlab/mmdetection3d/blob/master/docs/getting_started.md
安装过程中没有什么坑,按照步骤一步一步来就可以。
安装运行之后出现类似:
KeyError: 'SparseConv2d is already registered in conv layer'
的报错,大概率是MMCV版本过高,适当降低mmcv版本,重新安装即可.
python_open3d_Error: The DISPLAY environment variable is missing
https://blog.csdn.net/shyjhyp11/article/details/113250325
(2)使用源码安装的版本进行可视化
先配置好config文件中test_cfg部分的的iou_thre以及score_thr
a.在线可视化
运行之后会对每一帧都进行可视化,并且可视化后会把原始点云和预测结果的.obj文件保存到show-dir目录下。每次想切换下一帧就将open3d窗口×掉。不过这种方法只能显示预测结果,GT没有一起显示。
eg:
python tools/test.py configs/3dssd/3dssd_kitti-3d-car.py data/mmdetection/pretrain_weight/3dssd_kitti-3d-car_20210324_122002-07e9a19b.pth --show --show-dir ./data/zjh_data/mmdetection/show_result
b.离线可视化,可以和GT一起显示
想要和GT一起显示,需要生成的文件中也一起包括gt.obj。使用如下命令可以一起得到gt.obj
python tools/test.py ${
CONFIG_FILE} ${
CKPT_PATH} --eval 'mAP' --eval-options 'show=True' 'out_dir=${SHOW_DIR}'
但在实际运行的时候,我的源码安装的mmdet3d出现如下报错。
暂时没有解决该问题,先记录一下。没改过这部分源码,感觉是环境配置哪里出现了点问题。
File "/mnt/data/zjh_data/mmdet3d_install/mmdetection3d/mmdet3d/core/evaluation/kitti_utils/eval.py", line 365, in calculate_iou_partly
overlap_part = image_box_overlap(gt_boxes, dt_boxes)
TypeError: expected dtype object, got 'numpy.dtype[float64]'
曲线救国方法:
采用docker版本先生成可视化文件,然后再采用源码版本的可视化。但是docker版本的因为open3d的问题,导致没法可视化从而导致在调用open3d的时候就报错,使得无法生成可视化文件。
解决方法:打开目录mmdet3d/core/visualization/show_result.py文件,把show_result函数下的if show 调用open3d部分全都注释,就不会因为open3d不能用影响可视化文件生成。
运行如下命令生成模型.pkl文件和可视化文件000023_gt.obj ,000023_points.obj ,000023_pred.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=./data/result_output/show_result'
生成之后采用tool中的离线可视化脚本进行可视化:
python tools/misc/visualize_results.py ${
CONFIG_FILE} --result ~/zjh_data/result_output/out_dir/3dssd.pkl --show-dir ~/zjh_data/result_output/show_result/

2.log文件中误差曲线可视化
python tools/analysis_tools/analyze_logs.py plot_curve ~/zjh_data/mmdetection/work_dir623/20210624_004729.log.json --keys loss --legend loss --out loss.pdf
- test测试并提交到kitti上进行在线测评
(1)修改config文件中
ann_file=data_root + 'kitti_infos_test.pkl',
split='testing',
data = dict(
samples_per_gpu=6,
workers_per_gpu=4,
train=dict(
type='RepeatDataset',
times=2,
dataset=dict(
type=dataset_type,
data_root=data_root,
ann_file=data_root + 'kitti_infos_train.pkl',
split='training',
pts_prefix='velodyne_reduced',
pipeline=train_pipeline,
modality=input_modality,
classes=class_names,
test_mode=False,
# we use box_type_3d='LiDAR' in kitti and nuscenes dataset
# and box_type_3d='Depth' in sunrgbd and scannet dataset.
box_type_3d='LiDAR')),
val=dict(
type=dataset_type,
data_root=data_root,
ann_file=data_root + 'kitti_infos_val.pkl',
split='training',
pts_prefix='velodyne_reduced',
pipeline=test_pipeline,
modality=input_modality,
classes=class_names,
test_mode=True,
box_type_3d='LiDAR'),
test=dict(
type=dataset_type,
data_root=data_root,
# 这里改动过,训练的时候重新改为val
####下面两行修改成test数据
ann_file=data_root + 'kitti_infos_test.pkl',
split='testing',
pts_prefix='velodyne_reduced',
pipeline=test_pipeline,
modality=input_modality,
classes=class_names,
test_mode=True,
box_type_3d='LiDAR'))
(2)使用脚本文件进行测试
边栏推荐
猜你喜欢

解决Package is not available (for R ve【PACKAGE ‘XXX’ IS NOT AVAILABLE (FOR R VERSION X.Y.Z)” WARNING?】

编译原理学习笔记2(语法分析介绍)

JVM性能调优

2021 National Undergraduate data statistics and Analysis Competition

Arya-专业web自动化测试平台

【C语言进阶】——函数指针

软件测试真有网上说的那么好吗?

Some things encountered in ionic

简单易用的APP专项测试工具iTest4.7.0发布啦

The browser has no Internet, and wechat can connect to the Internet (solution)
随机推荐
pycharm连接到远程docker
Can‘t use an undefined value as an ARRAY reference at probe2symbol
零基础软件测试培训可靠吗?
Factor in R
2021 National Undergraduate data statistics and Analysis Competition
Random talk on test platform - platform construction ideas (Part 1)
三维点云处理系列----PCA
编译原理学习笔记3(自上而下语法分析)
Talk about the measurement of "post release problems"
软件测试到底有没有前景和出路?
分支与循环(for与do-while)
[阅读笔记] For Paper:R-CNN系列的三篇论文总结
Division optimization of JS decimal calculation on the Internet
mmcv安装的办法
【C语言进阶】——指针进阶[Ⅰ]
Hgu95av2. Online installation failed
地图R语言
The browser has no Internet, and wechat can connect to the Internet (solution)
Talk about what you know about publishing online (I)
简单易用的APP专项测试工具iTest4.7.0发布啦