open-mmlab / OpenPCDet

OpenPCDet Toolbox for LiDAR-based 3D Object Detection.
Apache License 2.0
4.66k stars 1.3k forks source link

How to load pandaset with dataloader? #787

Closed Leozyc-waseda closed 2 years ago

Leozyc-waseda commented 2 years ago

I try python -m pcdet.datasets.pandaset.pandaset_dataset create_pandaset_infos tools/cfgs/dataset_configs/pandaset_dataset.yaml its not work.

My folder structure:

data
  ├──kitti 
  ├── pandaset
    ├── 001                     # The sequence number
    │   ├── annotations         # Bounding boxes and semseg annotations
    |   |   ├──cuboids
    |   |   |  ├──00.pkl.gz
    |   |   |  └──  ...
    |   |   ├──semseg
    |   |      ├──00.pkl.gz
    |   |      └── ...
    │   ├── camera             # cameras images
    |   |  ├──back_camera
    |   |  |  ├──00.jpg
    |   |  |  └── ..
    |   |  ├──front_camera
    |   |  └── ...
    │   ├── lidar             # lidar data
    │   |    ├── 00.pkl.gz
    │   |    └── ... 
    |   ├── meta
    |   |   ├── gps.json
    |   |   ├── timestamps.json
    ├── 002
    └── ...

error message

---------------- Start to generate train data infos ---------------
Traceback (most recent call last):
  File "/home/4/anaconda3/envs/openpcdet-new/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/4/anaconda3/envs/openpcdet-new/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/4/work/OpenPCDet/pcdet/datasets/pandaset/pandaset_dataset.py", line 476, in <module>
    save_path=ROOT_DIR / 'data' / 'pandaset'
  File "/home/4/work/OpenPCDet/pcdet/datasets/pandaset/pandaset_dataset.py", line 448, in create_pandaset_infos
    infos = dataset.get_infos()
  File "/home/4/work/OpenPCDet/pcdet/datasets/pandaset/pandaset_dataset.py", line 361, in get_infos
    s = self.dataset[seq]
  File "/home/4/anaconda3/envs/openpcdet-new/lib/python3.7/site-packages/pandaset/dataset.py", line 28, in __getitem__
    return self._sequences[item]
KeyError: '014'
Leozyc-waseda commented 2 years ago

fixed it.

My folder structure:

data
  ├──kitti 
  ├── pandaset
    ├── 001                     # The sequence number
    │   ├── annotations         # Bounding boxes and semseg annotations
    |   |   ├──cuboids
    |   |   |  ├──00.pkl.gz
    |   |   |  └──  ...
    |   |   ├──semseg
    |   |      ├──00.pkl.gz
    |   |      └── ...
    │   ├── camera             # cameras images
    |   |  ├──back_camera
    |   |  |  ├──00.jpg
    |   |  |  └── ..
    |   |  ├──front_camera
    |   |  └── ...
    │   ├── lidar             # lidar data
    │   |    ├── 00.pkl.gz
    │   |    └── ... 
    |   ├── meta
    |   |   ├── gps.json
    |   |   ├── timestamps.json
    ├── 002
    └── ...
    ├── 158
    └── ...

Note if anyone made the same mistake as me. There should be 158 folders, and I only unzipped one zip file. also, change 'dataset' to ' '

67    self.dataset = ps.DataSet(os.path.join(root_path, ''))
372    'lidar_path': os.path.join(self.root_path, '', seq, 'lidar', ("{:02d}.pkl.gz".format(ii))),
373    'cuboids_path': os.path.join(self.root_path, '', seq,