Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'img' for visualization #3

Open
hc20 opened this issue Jul 4, 2023 · 3 comments
Open

KeyError: 'img' for visualization #3

hc20 opened this issue Jul 4, 2023 · 3 comments

Comments

@hc20
Copy link

hc20 commented Jul 4, 2023

Hello,

Thanks for your work. I want to visualize the results with the following code:

python tools/test.py configs/dspdet3d/dspdet3d_toscene-3d-70class.py \
    /home/ubuntu/DSPDet3D-data/dspdet3d_toscene.pth --eval mAP --show \
    --show-dir /home/ubuntu/DSPDet3D/output

But I get the following errors:

load checkpoint from local path: /home/ubuntu/DSPDet3D-data/dspdet3d_toscene.pth
[                                                  ] 0/800, elapsed: 0s, ETA:

Traceback (most recent call last):
  File "/home/ubuntu/DSPDet3D/tools/test.py", line 168, in <module>
    main()
  File "/home/ubuntu/DSPDet3D/tools/test.py", line 138, in main
    outputs = single_gpu_test(model, data_loader, args.show, args.show_dir)
  File "/home/ubuntu/anaconda3/envs/mmdet3d/lib/python3.8/site-packages/mmdet3d/apis/test.py", line 58, in single_gpu_test
    if batch_size == 1 and isinstance(data['img'][0],
KeyError: 'img'

Process finished with exit code 1

Could you please tell me how to solve this problem? Thank you very much for your help.

@Cherryreg
Copy link
Collaborator

I think you can confirm if it's possible to run through just testing without visualization.
python tools/test.py configs/dspdet3d/dspdet3d_toscene-3d-70class.py /home/ubuntu/DSPDet3D-data/dspdet3d_toscene.pth --eval mAP
If the instruction does not report an error, the problem should be with the visualization code. The visualization code can refer to the visualization code in TR3D.
Feel free to exchange relevant questions at any time!

@hc20
Copy link
Author

hc20 commented Jul 9, 2023

Thank you very much for your reply! I modify the visualization code and use model.module.show_results() to visualize the detection results in Open3D. But I find that the point cloud has no color information, as shown in this figure:
Image
How to visualize the detection boxes with colorful point cloud like the figures in your paper? Thank you for your help.

@GlaucoAntonio
Copy link

... I modify the visualization code and use model.module.show_results() to visualize the detection results in Open3D.

Please, could you share your modifications to solve this error? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants