Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
ef334e31
Commit
ef334e31
authored
Nov 28, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MaskRCNN] bugfix on inference
parent
f0e049a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
examples/FasterRCNN/model_frcnn.py
examples/FasterRCNN/model_frcnn.py
+3
-2
No files found.
examples/FasterRCNN/model_frcnn.py
View file @
ef334e31
...
...
@@ -201,6 +201,7 @@ def fastrcnn_predictions(boxes, scores):
Returns: n boolean, the selection
"""
prob
,
box
=
X
output_shape
=
tf
.
shape
(
prob
,
out_type
=
tf
.
int64
)
# filter by score threshold
ids
=
tf
.
reshape
(
tf
.
where
(
prob
>
cfg
.
TEST
.
RESULT_SCORE_THRESH
),
[
-
1
])
prob
=
tf
.
gather
(
prob
,
ids
)
...
...
@@ -216,13 +217,13 @@ def fastrcnn_predictions(boxes, scores):
if
get_tf_version_tuple
()
>=
(
1
,
12
):
mask
=
tf
.
sparse
.
SparseTensor
(
indices
=
tf
.
expand_dims
(
sorted_selection
,
1
),
values
=
tf
.
ones_like
(
sorted_selection
,
dtype
=
tf
.
bool
),
dense_shape
=
tf
.
shape
(
prob
,
out_type
=
tf
.
int64
)
)
dense_shape
=
output_shape
)
mask
=
tf
.
sparse
.
to_dense
(
mask
,
default_value
=
False
)
else
:
# this function is deprecated by TF
mask
=
tf
.
sparse_to_dense
(
sparse_indices
=
sorted_selection
,
output_shape
=
tf
.
shape
(
prob
,
out_type
=
tf
.
int64
)
,
output_shape
=
output_shape
,
sparse_values
=
True
,
default_value
=
False
)
return
mask
...
...
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