Giter Club home page Giter Club logo

Comments (2)

jskhu avatar jskhu commented on July 24, 2024

It depends on the dataset, but typically the pickle files contain labels, calibration, and basic metadata. For example, KITTI's train pickle file contains the following information for each training sample:

>>> import pickle
>>> import pprint
>>> pp = pprint.PrettyPrinter()
>>> with open('kitti_infos_train.pkl', 'rb') as f:
...     data = pickle.load(f)
...
>>> pp.pprint(data[0])
{'annos': {'alpha': array([-0.2]),
           'bbox': array([[712.4 , 143.  , 810.73, 307.92]], dtype=float32),
           'difficulty': array([0], dtype=int32),
           'dimensions': array([[1.2 , 1.89, 0.48]]),
           'gt_boxes_lidar': array([[ 8.73138046, -1.85591757, -0.65469939,  1.2       ,  0.48      ,
         1.89      , -1.58079633]]),
           'index': array([0], dtype=int32),
           'location': array([[1.84, 1.47, 8.41]], dtype=float32),
           'name': array(['Pedestrian'], dtype='<U10'),
           'num_points_in_gt': array([377], dtype=int32),
           'occluded': array([0.]),
           'rotation_y': array([0.01]),
           'score': array([-1.]),
           'truncated': array([0.])},
 'calib': {'P2': array([[ 7.07049316e+02,  0.00000000e+00,  6.04081421e+02,
         4.57583084e+01],
       [ 0.00000000e+00,  7.07049316e+02,  1.80506607e+02,
        -3.45415711e-01],
       [ 0.00000000e+00,  0.00000000e+00,  1.00000000e+00,
         4.98101581e-03],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         1.00000000e+00]]),
           'R0_rect': array([[ 0.9999128 ,  0.01009263, -0.00851193,  0.        ],
       [-0.01012729,  0.9999406 , -0.00403767,  0.        ],
       [ 0.00847067,  0.00412352,  0.9999556 ,  0.        ],
       [ 0.        ,  0.        ,  0.        ,  1.        ]],
      dtype=float32),
           'Tr_velo_to_cam': array([[ 0.00692796, -0.99997222, -0.00275783, -0.02457729],
       [-0.00116298,  0.00274984, -0.99999553, -0.06127237],
       [ 0.99997532,  0.00693114, -0.0011439 , -0.33210289],
       [ 0.        ,  0.        ,  0.        ,  1.        ]])},
 'image': {'image_idx': '000000',
           'image_shape': array([ 370, 1224], dtype=int32)},
 'point_cloud': {'lidar_idx': '000000', 'num_features': 4}}

Unless your data is extremely different, my suggestion would be to convert your data to a KITTI-like format so you can use OpenPCDet's dataset framework easily. An example Waymo to KITTI converter is here: https://github.com/caizhongang/waymo_kitti_converter. You can probably do something similar with your dataset.

from pdv.

KyleYueye avatar KyleYueye commented on July 24, 2024

It depends on the dataset, but typically the pickle files contain labels, calibration, and basic metadata. For example, KITTI's train pickle file contains the following information for each training sample:

>>> import pickle
>>> import pprint
>>> pp = pprint.PrettyPrinter()
>>> with open('kitti_infos_train.pkl', 'rb') as f:
...     data = pickle.load(f)
...
>>> pp.pprint(data[0])
{'annos': {'alpha': array([-0.2]),
           'bbox': array([[712.4 , 143.  , 810.73, 307.92]], dtype=float32),
           'difficulty': array([0], dtype=int32),
           'dimensions': array([[1.2 , 1.89, 0.48]]),
           'gt_boxes_lidar': array([[ 8.73138046, -1.85591757, -0.65469939,  1.2       ,  0.48      ,
         1.89      , -1.58079633]]),
           'index': array([0], dtype=int32),
           'location': array([[1.84, 1.47, 8.41]], dtype=float32),
           'name': array(['Pedestrian'], dtype='<U10'),
           'num_points_in_gt': array([377], dtype=int32),
           'occluded': array([0.]),
           'rotation_y': array([0.01]),
           'score': array([-1.]),
           'truncated': array([0.])},
 'calib': {'P2': array([[ 7.07049316e+02,  0.00000000e+00,  6.04081421e+02,
         4.57583084e+01],
       [ 0.00000000e+00,  7.07049316e+02,  1.80506607e+02,
        -3.45415711e-01],
       [ 0.00000000e+00,  0.00000000e+00,  1.00000000e+00,
         4.98101581e-03],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         1.00000000e+00]]),
           'R0_rect': array([[ 0.9999128 ,  0.01009263, -0.00851193,  0.        ],
       [-0.01012729,  0.9999406 , -0.00403767,  0.        ],
       [ 0.00847067,  0.00412352,  0.9999556 ,  0.        ],
       [ 0.        ,  0.        ,  0.        ,  1.        ]],
      dtype=float32),
           'Tr_velo_to_cam': array([[ 0.00692796, -0.99997222, -0.00275783, -0.02457729],
       [-0.00116298,  0.00274984, -0.99999553, -0.06127237],
       [ 0.99997532,  0.00693114, -0.0011439 , -0.33210289],
       [ 0.        ,  0.        ,  0.        ,  1.        ]])},
 'image': {'image_idx': '000000',
           'image_shape': array([ 370, 1224], dtype=int32)},
 'point_cloud': {'lidar_idx': '000000', 'num_features': 4}}

Unless your data is extremely different, my suggestion would be to convert your data to a KITTI-like format so you can use OpenPCDet's dataset framework easily. An example Waymo to KITTI converter is here: https://github.com/caizhongang/waymo_kitti_converter. You can probably do something similar with your dataset.

Thank you

from pdv.

Related Issues (19)

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.