uzh-rpg / DSEC

MIT License
128 stars 16 forks source link

Lidar Data for Semantic Segmentation Test Set? #63

Open liupeng3425 opened 4 months ago

liupeng3425 commented 4 months ago

Dear authors,

I would like to express my gratitude for your work. I have been using the lidar data downloaded from your source for my experiments. However, I have encountered an issue where the timestamps of the lidar data and the semantic labels do not correspond to each other. I wanted to inquire whether the lidar data includes point cloud data corresponding to the semantic segmentation test set.

Thank you for your attention to this matter.

magehrig commented 4 months ago

Hi @liupeng3425

Is this specific to LIDAR data? The timestamps between images and semantic labels are as expected?

liupeng3425 commented 4 months ago

Hi @magehrig Thanks for your prompt reply! Yes, the timestamps of images and semantic labels are matched. e.g., zurich_city_15_a/images/timestamps.txt and zurich_city_15_a/zurich_city_15_a_semantic_timestamps.txt

image

However, I failed to find the corresponding lidar data by timestamps when iter over the lidar data. My code is like below:

      from rosbags.highlevel import AnyReader
      from pathlib import Path

      # get the timestamps of test data
      path = 'test/zurich_city_15_a/zurich_city_15_a_semantic_timestamps.txt'
      timestamp_data = set()
      with open(path, "r") as f:
          data = f.read().splitlines()
          for line in data:
              timestamp_data.add(int(line))

      # read lidar data from bag file
      lidar_path = 'lidar_imu/data/zurich_city_15/lidar_imu.bag'
      with AnyReader([Path(lidar_path)]) as lidar_data:
          conn = lidar_data.connections
          conn = [i for i in conn if i.topic == '/velodyne_points']
          for connection, timestamp, rawdata in lidar_data.messages(connections=conn):
              if timestamp/1000 in timestamp_data: # !!can't  find expected lidar data
                  msg = lidar_data.deserialize(rawdata, connection.msgtype)
                  # process lidar data
magehrig commented 3 months ago

It is unlikely that there is an exact match. Are you able to retrieve a lidar pointcloud close to these timestamps?