Code Monkey home page Code Monkey logo

Comments (4)

whyekit-motional avatar whyekit-motional commented on August 17, 2024

@magical1998 pls provide a working code snippet to reproduce your issue

from nuscenes-devkit.

magical1998 avatar magical1998 commented on August 17, 2024

import numpy as np

调用函数,替换'your_file.bin'为你的文件路径

file_path='I:/data/sets/nuscenes/samples/LIDAR_TOP/'
label_path='I:/data/sets/nuscenes/lidarseg/v1.0-trainval/'
points=np.fromfile(file_path+'n015-2018-07-24-10-42-41+0800__LIDAR_TOP__1532400339698223.pcd.bin',dtype=np.float32)
labels=np.fromfile(label_path+'8b31aa5cac3846a6a197c507523926f9_lidarseg.bin',dtype=np.float32)
print(labels)
point-labels

from nuscenes-devkit.

magical1998 avatar magical1998 commented on August 17, 2024

Hello, the point cloud file and the label file are the corresponding files found through the .json file. If the point cloud file has one point for every four digits, the final number of point clouds will still be four times the number of labels. I am not sure. The reasons, I hope to receive your answer

from nuscenes-devkit.

whyekit-motional avatar whyekit-motional commented on August 17, 2024

@magical1998 I'm afraid I cannot reproduce your error:

import os.path as osp

import numpy as np
from nuscenes.utils.data_classes import LidarPointCloud


nusc_data_root = '/data/sets/nuscenes'

# Load pointcloud.
pcl_path = osp.join(nusc_data_root, 'samples/LIDAR_TOP/n015-2018-07-24-10-42-41+0800__LIDAR_TOP__1532400339698223.pcd.bin')
pc = LidarPointCloud.from_file(pcl_path)
points = pc.points.T
print(points.shape)  # (34752, 4)

# Load labels.
lidarseg_labels_filename = osp.join(nusc_data_root, 'lidarseg/v1.0-trainval/8b31aa5cac3846a6a197c507523926f9_lidarseg.bin')
points_label = np.fromfile(lidarseg_labels_filename, dtype=np.uint8)
print(points_label.shape)  # (34752,)

assert len(points) == len(points_label)

from nuscenes-devkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.