WangYueFt / detr3d

MIT License
745 stars 140 forks source link

how to show the result in detr3d?how to ues test.py --show --show-dir in detr3d? #20

Open Bincle-Yin opened 2 years ago

Bincle-Yin commented 2 years ago

python ./tools/test.py /media/yinwenbing/disk1/detr3d/projects/configs/detr3d/detr3d_res101_gridmask.py \ /media/yinwenbing/disk1/detr3d/ckp/detr3d_resnet101.pth \ --show --show-dir ./data/result/detr3d

I run ang get this error: Traceback (most recent call last): File "./tools/test.py", line 249, in main() File "./tools/test.py", line 219, in main outputs = single_gpu_test(model, data_loader, args.show, args.show_dir) File "/media/yinwenbing/disk1/detr3d/mmdetection3d/mmdet3d/apis/test.py", line 47, in single_gpu_test model.module.show_results(data, result, out_dir=out_dir) File "/media/yinwenbing/disk1/detr3d/mmdetection3d/mmdet3d/models/detectors/mvx_two_stage.py", line 467, in show_results if isinstance(data['points'][0], DC): KeyError: 'points'

Light-- commented 2 years ago

i also want to view the result, how can i do it?

auTwentySix commented 2 years ago

I have encountered the same problem,have you solved it? @Bincle-Yin

Bincle-Yin commented 2 years ago

I have encountered the same problem,have you solved it? @Bincle-Yin

i do not solved it, i do not know how to show

mengEthan commented 2 years ago

try to use dist_tes.py, set the number of GPU as 1

Light-- commented 2 years ago

try to use dist_tes.py, set the number of GPU as 1

is there any script file names 'dist_tes.py' ? do you mean 'dist_test.sh' ? i already set gpu to 1, not work. Did you successfully show it? if you did, can you describe how to do it? thank you

also need help @WangYueFt

Bincle-Yin commented 2 years ago

try to use dist_tes.py, set the number of GPU as 1

?

drilistbox commented 2 years ago

Anyone fixes this problem?

a1600012888 commented 2 years ago

Hi, Below I provide new code based the official implementation of NuScenesExplorer. https://drive.google.com/file/d/1rcrATkd2wgUMeaaP8tHBz0S6hKe-zkhc/view?usp=sharing

The function render_sample_pred in line 344 can render predictions from any detectors, with the similar figures from DETR3D(Lidar bev or any camera. With or without maps) A partial example is showed in _test_pred() You can use this code to perform visualization for results json file from any detectors.

drilistbox commented 2 years ago

Hi, Below I provide new code based the official implementation of NuScenesExplorer. https://drive.google.com/file/d/1rcrATkd2wgUMeaaP8tHBz0S6hKe-zkhc/view?usp=sharing

The function render_sample_pred in line 344 can render predictions from any detectors, with the similar figures from DETR3D(Lidar bev or any camera. With or without maps) A partial example is showed in _test_pred() You can use this code to perform visualization for results json file from any detectors.

It is useful, thanks a lot!

Egozjuer commented 2 years ago

@a1600012888 Hi, I encountered a problem that the results which from test.py could be saved in *.pkl,but can't be saved in the format of json,and you provided the _test_pred() function to visulize the result,but the input only support json format

a1600012888 commented 2 years ago

See the tools/test.py in mmdetection3d. https://github.com/open-mmlab/mmdetection3d/blob/60ce864ff76af4316fb9ae56a2a5b7741bfdd9ab/tools/test.py

To get the json file, you probably need to use python3 tools/test.py <config-path> <ckpt-path> --format-only

I didn't remember the exact command line, since I haven't been using this set of code or mmdetection for a few month. You can check it by look at the code of tools/test.py and the format_results function in the dataset code: https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/datasets/nuscenes_dataset.py#L431