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
610a8b9b
Commit
610a8b9b
authored
Jul 12, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MaskRCNN] nicer table
parent
21f74399
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
examples/FasterRCNN/data.py
examples/FasterRCNN/data.py
+8
-4
No files found.
examples/FasterRCNN/data.py
View file @
610a8b9b
...
...
@@ -46,11 +46,15 @@ def print_class_histogram(roidbs):
gt_inds
=
np
.
where
((
entry
[
"class"
]
>
0
)
&
(
entry
[
"is_crowd"
]
==
0
))[
0
]
gt_classes
=
entry
[
"class"
][
gt_inds
]
gt_hist
+=
np
.
histogram
(
gt_classes
,
bins
=
hist_bins
)[
0
]
data
=
[[
cfg
.
DATA
.
CLASS_NAMES
[
i
],
v
]
for
i
,
v
in
enumerate
(
gt_hist
)]
data
.
append
([
"total"
,
sum
(
x
[
1
]
for
x
in
data
)])
COL
=
6
data
=
list
(
itertools
.
chain
(
*
[[
cfg
.
DATA
.
CLASS_NAMES
[
i
],
v
]
for
i
,
v
in
enumerate
(
gt_hist
[
1
:])]))
total_instances
=
sum
(
data
[
1
::
2
])
data
.
extend
([
None
]
*
(
COL
-
len
(
data
)
%
COL
))
data
.
extend
([
"total"
,
total_instances
])
data
=
itertools
.
zip_longest
(
*
[
data
[
i
::
COL
]
for
i
in
range
(
COL
)])
# the first line is BG
table
=
tabulate
(
data
[
1
:],
headers
=
[
"class"
,
"#box"
],
tablefmt
=
"pipe
"
)
logger
.
info
(
"Ground-Truth
Boxes
:
\n
"
+
colored
(
table
,
"cyan"
))
table
=
tabulate
(
data
,
headers
=
[
"class"
,
"#box"
]
*
(
COL
//
2
),
tablefmt
=
"pipe"
,
stralign
=
"center"
,
numalign
=
"left
"
)
logger
.
info
(
"Ground-Truth
category distribution
:
\n
"
+
colored
(
table
,
"cyan"
))
@
memoized
...
...
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