Skip to content

Commit 6378d1d

Browse files
committed
fix speed problem of nuscenes info generation
1 parent d1455d5 commit 6378d1d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

second/data/nuscenes_dataset.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,7 @@ def _fill_trainval_infos(nusc,
508508
break
509509
info["sweeps"] = sweeps
510510
if not test:
511-
ann_tokens = nusc.field2token('sample_annotation', 'sample_token', sample["token"])
512-
annotations = []
513-
for anno_token in ann_tokens:
514-
annotations.append(nusc.get("sample_annotation", anno_token))
511+
annotations = [nusc.get('sample_annotation', token) for token in sample['anns']]
515512
locs = np.array([b.center for b in boxes]).reshape(-1, 3)
516513
dims = np.array([b.wlh for b in boxes]).reshape(-1, 3)
517514
rots = np.array([b.orientation.yaw_pitch_roll[0]

0 commit comments

Comments
 (0)