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
13ee370c
Commit
13ee370c
authored
Aug 07, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve b/w visualization
parent
c28a3fa5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
examples/FasterRCNN/viz.py
examples/FasterRCNN/viz.py
+6
-14
No files found.
examples/FasterRCNN/viz.py
View file @
13ee370c
...
@@ -102,30 +102,22 @@ def draw_final_outputs_blackwhite(img, results):
...
@@ -102,30 +102,22 @@ def draw_final_outputs_blackwhite(img, results):
Args:
Args:
results: [DetectionResult]
results: [DetectionResult]
"""
"""
if
len
(
results
)
==
0
:
return
img
# Display in largest to smallest order to reduce occlusion
boxes
=
np
.
asarray
([
r
.
box
for
r
in
results
])
areas
=
np_area
(
boxes
)
sorted_inds
=
np
.
argsort
(
-
areas
)
img_bw
=
img
.
mean
(
axis
=
2
)
img_bw
=
img
.
mean
(
axis
=
2
)
img_bw
=
np
.
stack
([
img_bw
]
*
3
,
axis
=
2
)
img_bw
=
np
.
stack
([
img_bw
]
*
3
,
axis
=
2
)
tags
=
[]
if
len
(
results
)
==
0
:
return
img_bw
boxes
=
np
.
asarray
([
r
.
box
for
r
in
results
])
all_masks
=
[
r
esults
[
rid
]
.
mask
for
rid
in
sorted_ind
s
]
all_masks
=
[
r
.
mask
for
r
in
result
s
]
if
all_masks
[
0
]
is
not
None
:
if
all_masks
[
0
]
is
not
None
:
m
=
all_masks
[
0
]
>
0
m
=
all_masks
[
0
]
>
0
for
m2
in
all_masks
[
1
:]:
for
m2
in
all_masks
[
1
:]:
m
=
m
|
(
m2
>
0
)
m
=
m
|
(
m2
>
0
)
print
(
m
,
m
.
sum
())
img_bw
[
m
]
=
img
[
m
]
img_bw
[
m
]
=
img
[
m
]
for
r
in
results
:
tags
=
[
"{},{:.2f}"
.
format
(
cfg
.
DATA
.
CLASS_NAMES
[
r
.
class_id
],
r
.
score
)
for
r
in
results
]
tags
.
append
(
"{},{:.2f}"
.
format
(
cfg
.
DATA
.
CLASS_NAMES
[
r
.
class_id
],
r
.
score
))
ret
=
viz
.
draw_boxes
(
img_bw
,
boxes
,
tags
)
ret
=
viz
.
draw_boxes
(
img_bw
,
boxes
,
tags
)
return
ret
return
ret
...
...
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