MCPcopy Create free account
hub / github.com/OpenDriveLab/OccNet / normalize_bbox

Function normalize_bbox

projects/mmdet3d_plugin/core/bbox/util.py:4–24  ·  view source on GitHub ↗
(bboxes, pc_range)

Source from the content-addressed store, hash-verified

2
3
4def normalize_bbox(bboxes, pc_range):
5
6 cx = bboxes[..., 0:1]
7 cy = bboxes[..., 1:2]
8 cz = bboxes[..., 2:3]
9 w = bboxes[..., 3:4].log()
10 l = bboxes[..., 4:5].log()
11 h = bboxes[..., 5:6].log()
12
13 rot = bboxes[..., 6:7]
14 if bboxes.size(-1) > 7:
15 vx = bboxes[..., 7:8]
16 vy = bboxes[..., 8:9]
17 normalized_bboxes = torch.cat(
18 (cx, cy, w, l, cz, h, rot.sin(), rot.cos(), vx, vy), dim=-1
19 )
20 else:
21 normalized_bboxes = torch.cat(
22 (cx, cy, w, l, cz, h, rot.sin(), rot.cos()), dim=-1
23 )
24 return normalized_bboxes
25
26def denormalize_bbox(normalized_bboxes, pc_range):
27 # rotation

Callers 1

assignMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected