添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

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

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()

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?

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,就是颜色有点奇怪

调用时传入了设置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,就是颜色有点奇怪