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

[Docs] 可视化文档draw_bboxes_3d测试报错 #2828

Open
xuyuxiang7 opened this issue Nov 30, 2023 · 11 comments
Open

[Docs] 可视化文档draw_bboxes_3d测试报错 #2828

xuyuxiang7 opened this issue Nov 30, 2023 · 11 comments

Comments

@xuyuxiang7
Copy link

Branch

main branch https://mmdetection3d.readthedocs.io/en/latest/

📚 The doc issue

可视化文档draw_bboxes_3d测试报错。下面是报错
Traceback (most recent call last):
File "/home/xyx/project/mmdetection3d/results/可视化demo.py", line 16, in
visualizer.draw_bboxes_3d(bboxes_3d)
File "/home/xyx/project/mmdetection3d/mmdet3d/visualization/local_visualizer.py", line 317, in draw_bboxes_3d
line_set.paint_uniform_color(np.array(bbox_color[i]) / 255.)
TypeError: paint_uniform_color(): incompatible function arguments. The following argument types are supported:
1. (self: open3d.cuda.pybind.geometry.LineSet, color: numpy.ndarray[numpy.float64[3, 1]]) -> open3d.cuda.pybind.geometry.LineSet

Invoked with: LineSet with 12 lines., 0.0

Suggest a potential alternative/fix

No response

@guhuajun
Copy link

guhuajun commented Dec 4, 2023

加油吧,我也是摸索了好多天

  1. 用项目里 docker 文件夹下的Dockerfile制作镜像,避免包之间的版本冲突
  2. Windows下配置好 vcXsrv, 启动时取消勾选 Native opengl

image

@thelandord
Copy link

请问有解决吗,没有用docker配置环境。

@GODBENGAY
Copy link

同问

@18722013889
Copy link

windows平台 一样的错误,解决了吗?大佬

@btn6364
Copy link

btn6364 commented Mar 13, 2024

I got the same issue when running the code in the documentation. Any hint to solve this problem?

import torch
import numpy as np

from mmdet3d.visualization import Det3DLocalVisualizer
from mmdet3d.structures import LiDARInstance3DBoxes

points = np.fromfile('demo/data/kitti/000008.bin', dtype=np.float32)
points = points.reshape(-1, 4)
visualizer = Det3DLocalVisualizer()
# set point cloud in visualizer
visualizer.set_points(points)
bboxes_3d = LiDARInstance3DBoxes(
    torch.tensor([[8.7314, -1.8559, -1.5997, 4.2000, 3.4800, 1.8900,
                   -1.5808]]))
# Draw 3D bboxes
visualizer.draw_bboxes_3d(bboxes_3d)
visualizer.show()

@Wang0203
Copy link

I got the same issue when running the code in the documentation. Any hint to solve this problem?

import torch
import numpy as np

from mmdet3d.visualization import Det3DLocalVisualizer
from mmdet3d.structures import LiDARInstance3DBoxes

points = np.fromfile('demo/data/kitti/000008.bin', dtype=np.float32)
points = points.reshape(-1, 4)
visualizer = Det3DLocalVisualizer()
# set point cloud in visualizer
visualizer.set_points(points)
bboxes_3d = LiDARInstance3DBoxes(
    torch.tensor([[8.7314, -1.8559, -1.5997, 4.2000, 3.4800, 1.8900,
                   -1.5808]]))
# Draw 3D bboxes
visualizer.draw_bboxes_3d(bboxes_3d)
visualizer.show()

Hello, did you solve the problem?

@WZWAsuna
Copy link

TypeError: paint_uniform_color(): incompatible function arguments.
The following argument types are supported:
1. (self: open3d.cuda.pybind.geometry.LineSet, color: numpy.ndarray[numpy.float64[3, 1]]) -> open3d.cuda.pybind.geometry.LineSet

按照上面的描述,报错的代码应该是这个函数调用时传递的参数问题
line_set.paint_uniform_color(np.array(bbox_color[i]) / 255.)

传入的color应该是float64的numpy数组,形状是[3,1],而draw_bboxes_3d的bbox_color参数默认值是一个Tuple[float] = (0, 1, 0),但是这里bbox_color[i]经过索引后形状不再是[3,1]了,我把两处bbox_color[i]改成bbox_color后可以显示点云和bounding box,就是颜色有点奇怪

@WZWAsuna
Copy link

WZWAsuna commented Mar 29, 2024

visualizer.draw_bboxes_3d(bboxes_3d,(255,0,0))
调用时传入了设置bbox颜色的元组修改了颜色

TypeError: paint_uniform_color(): incompatible function arguments. The following argument types are supported: 1. (self: open3d.cuda.pybind.geometry.LineSet, color: numpy.ndarray[numpy.float64[3, 1]]) -> open3d.cuda.pybind.geometry.LineSet

按照上面的描述,报错的代码应该是这个函数调用时传递的参数问题 line_set.paint_uniform_color(np.array(bbox_color[i]) / 255.)

传入的color应该是float64的numpy数组,形状是[3,1],而draw_bboxes_3d的bbox_color参数默认值是一个Tuple[float] = (0, 1, 0),但是这里bbox_color[i]经过索引后形状不再是[3,1]了,我把两处bbox_color[i]改成bbox_color后可以显示点云和bounding box,就是颜色有点奇怪

2024-03-29 10-10-24 的屏幕截图

@hitbuyi
Copy link

hitbuyi commented Mar 31, 2024

I have the same problem, It is bug

@zkailinzhang
Copy link

AttributeError: 'Det3DLocalVisualizer' object has no attribute 'view_control'

@zkailinzhang
Copy link

import os
os.environ['DISPLAY'] = '1' 可以解决

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

10 participants