-
Notifications
You must be signed in to change notification settings - Fork 7
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
infer_dit result in V100 #3
Comments
Hi, you may try the following method for visualization: def get_mesh_open3d(voxel_map, shape, ignore, color_map, voxel_size, ignores=None):
x, y, z = np.meshgrid(np.arange(shape[0]), np.arange(shape[1]), np.arange(shape[2]))
positions = np.stack([y, x, z], axis=-1).reshape(-1, 3)
mask = voxel_map.reshape(-1) != ignore
if ignores is not None:
for val in ignores:
mask &= voxel_map.reshape(-1) != val
positions = positions[mask]
colors = np.array([color_map[voxel_map.reshape(-1)[i]] for i in np.where(mask)[0]]) / 255.0
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(positions * voxel_size)
pcd.colors = o3d.utility.Vector3dVector(colors[:, ::-1]) # RGB to BGR
voxel_grid = o3d.geometry.VoxelGrid.create_from_point_cloud(pcd, voxel_size=voxel_size)
mesh = o3d.geometry.TriangleMesh()
voxels = voxel_grid.get_voxels()
for voxel in voxels:
cube = o3d.geometry.TriangleMesh.create_box(width=voxel_size, height=voxel_size, depth=voxel_size)
cube.paint_uniform_color(voxel.color)
cube.translate(voxel.grid_index * voxel_size)
mesh += cube
vertices = np.asarray(mesh.vertices)
faces = np.asarray(mesh.triangles)
colors = np.asarray(mesh.vertex_colors)
trimesh_mesh = trimesh.Trimesh(vertices=vertices, faces=faces, vertex_colors=colors)
return trimesh_mesh, pyrender.Mesh.from_trimesh(trimesh_mesh, smooth=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran the infer_dit.py script with the arguments -d DIT_CARLA and --best_vae, which generated many .npy files. When I attempted to visualize these .npy files, the resulting images were not as expected. It looks like BEV not occ. Could you help me understand what might have gone wrong or how I can improve the visualization?
` # 1.load 16 .npy files and get voxel size (16,128, 128, 8)===========
for file_name in npy_files:
file_path = os.path.join(folder_path, file_name)
data = np.fromfile(file_path, dtype=np.int8).reshape((128, 128, 8))
data_list.append(data)
The text was updated successfully, but these errors were encountered: