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