Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
a3f3dc75
Commit
a3f3dc75
authored
Mar 11, 2019
by
Alexander Pivovarov
Committed by
Tianqi Chen
Mar 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make topi cuda nms_gpu method signature similar to non_max_suppression (#2780)
parent
d8abc733
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
topi/python/topi/cuda/nms.py
+12
-5
No files found.
topi/python/topi/cuda/nms.py
View file @
a3f3dc75
...
...
@@ -182,8 +182,15 @@ def nms_ir(data, sort_result, valid_count, out, nms_threshold, force_suppress, n
@non_max_suppression.register
([
"cuda"
,
"gpu"
])
def
nms_gpu
(
data
,
valid_count
,
return_indices
,
iou_threshold
=
0.5
,
force_suppress
=
False
,
topk
=-
1
,
id_index
=
0
,
invalid_to_bottom
=
False
):
def
nms_gpu
(
data
,
valid_count
,
max_output_size
=-
1
,
iou_threshold
=
0.5
,
force_suppress
=
False
,
top_k
=-
1
,
id_index
=
0
,
return_indices
=
True
,
invalid_to_bottom
=
False
):
"""Non-maximum suppression operator for object detection.
Parameters
...
...
@@ -205,7 +212,7 @@ def nms_gpu(data, valid_count, return_indices, iou_threshold=0.5, force_suppress
force_suppress : optional, boolean
Whether to suppress all detections regardless of class_id.
topk : optional, int
top
_
k : optional, int
Keep maximum top k detections before nms, -1 for no limit.
id_index : optional, int
...
...
@@ -229,7 +236,7 @@ def nms_gpu(data, valid_count, return_indices, iou_threshold=0.5, force_suppress
valid_count = tvm.placeholder((dshape[0],), dtype="int32", name="valid_count")
iou_threshold = 0.7
force_suppress = True
topk = -1
top
_
k = -1
out = nms(data, valid_count, iou_threshold, force_suppress, topk)
np_data = np.random.uniform(dshape)
np_valid_count = np.array([4])
...
...
@@ -273,7 +280,7 @@ def nms_gpu(data, valid_count, return_indices, iou_threshold=0.5, force_suppress
[
data
,
sort_tensor
,
valid_count
],
lambda
ins
,
outs
:
nms_ir
(
ins
[
0
],
ins
[
1
],
ins
[
2
],
outs
[
0
],
iou_threshold
,
force_suppress
,
topk
),
force_suppress
,
top
_
k
),
dtype
=
"float32"
,
in_buffers
=
[
data_buf
,
sort_tensor_buf
,
valid_count_buf
],
tag
=
"nms"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment