提交 5a6e7803 编写于 作者: C chenyuntc

python code for nms_gpu_code

上级 8b2430eb
import numpy as np
def _nms_gpu_post( mask,
n_bbox,
threads_per_block,
col_blocks
):
selection = np.zeros((n_bbox,), dtype=np.int32)
remv = np.zeros((col_blocks,), dtype=np.uint64)
for i in range(n_bbox):
nblock = i // threads_per_block
inblock = i % threads_per_block
if not (remv[nblock] & one_ull << inblock):
selection[n_selection] = i
n_selection += 1
index = i * col_blocks
for j in range(nblock, col_blocks):
remv[j] |= mask[index + j]
return selection, n_selection
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册