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

Function ddd_post_process_2d

src/lib/utils/post_process.py:23–47  ·  view source on GitHub ↗
(dets, c, s, opt)

Source from the content-addressed store, hash-verified

21
22
23def ddd_post_process_2d(dets, c, s, opt):
24 # dets: batch x max_dets x dim
25 # return 1-based class det list
26 ret = []
27 include_wh = dets.shape[2] > 16
28 for i in range(dets.shape[0]):
29 top_preds = {}
30 dets[i, :, :2] = transform_preds(
31 dets[i, :, 0:2], c[i], s[i], (opt.output_w, opt.output_h))
32 classes = dets[i, :, -1]
33 for j in range(opt.num_classes):
34 inds = (classes == j)
35 top_preds[j + 1] = np.concatenate([
36 dets[i, inds, :3].astype(np.float32),
37 get_alpha(dets[i, inds, 3:11])[:, np.newaxis].astype(np.float32),
38 get_pred_depth(dets[i, inds, 11:12]).astype(np.float32),
39 dets[i, inds, 12:15].astype(np.float32)], axis=1)
40 if include_wh:
41 top_preds[j + 1] = np.concatenate([
42 top_preds[j + 1],
43 transform_preds(
44 dets[i, inds, 15:17], c[i], s[i], (opt.output_w, opt.output_h))
45 .astype(np.float32)], axis=1)
46 ret.append(top_preds)
47 return ret
48
49def ddd_post_process_3d(dets, calibs):
50 # dets: batch x max_dets x dim

Callers 1

ddd_post_processFunction · 0.85

Calls 3

transform_predsFunction · 0.85
get_alphaFunction · 0.85
get_pred_depthFunction · 0.85

Tested by

no test coverage detected