MCPcopy
hub / github.com/xingyizhou/CenterNet / get_alpha

Function get_alpha

src/lib/utils/post_process.py:13–20  ·  view source on GitHub ↗
(rot)

Source from the content-addressed store, hash-verified

11 return depth
12
13def get_alpha(rot):
14 # output: (B, 8) [bin1_cls[0], bin1_cls[1], bin1_sin, bin1_cos,
15 # bin2_cls[0], bin2_cls[1], bin2_sin, bin2_cos]
16 # return rot[:, 0]
17 idx = rot[:, 1] > rot[:, 5]
18 alpha1 = np.arctan2(rot[:, 2], rot[:, 3]) + (-0.5 * np.pi)
19 alpha2 = np.arctan2(rot[:, 6], rot[:, 7]) + ( 0.5 * np.pi)
20 return alpha1 * idx + alpha2 * (1 - idx)
21
22
23def ddd_post_process_2d(dets, c, s, opt):

Callers 1

ddd_post_process_2dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected