zhangyp15 / OccFormer

[ICCV 2023] OccFormer: Dual-path Transformer for Vision-based 3D Semantic Occupancy Prediction
https://arxiv.org/abs/2304.05316
Apache License 2.0
324 stars 22 forks source link

How to generate the nuscenes_infos_temporal_trainval.pkl? #4

Closed rockywind closed 1 year ago

rockywind commented 1 year ago

Hi, Thank you for sharing the great work. I want to generate the nuscenes_infos_temporal_trainval.pkl in the code. Can you help me?

zhangyp15 commented 1 year ago

The basic idea is to merge train and val infos, we use the following:

file1 = '/mnt/cfs/algorithm/yunpeng.zhang/public_data/occupancy_infos/nuscenes_infos_temporal_train.pkl'
file2 = '/mnt/cfs/algorithm/yunpeng.zhang/public_data/occupancy_infos/nuscenes_infos_temporal_val.pkl'

info1 = mmcv.load(file1, file_format='pkl')
info2 = mmcv.load(file2, file_format='pkl')
assert info1['metadata'] == info2['metadata']

info = dict(infos=info1['infos'] + info2['infos'], metadata=info1['metadata'])
out_file = '/mnt/cfs/algorithm/yunpeng.zhang/public_data/occupancy_infos/nuscenes_infos_temporal_trainval.pkl'
mmcv.dump(info, out_file)