Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
cfd6f99e
Unverified
Commit
cfd6f99e
authored
Jan 14, 2021
by
congee
Committed by
GitHub
Jan 14, 2021
Browse files
update stat to classify papers (#267)
parent
c2261db0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
docs/stat.py
docs/stat.py
+19
-3
No files found.
docs/stat.py
View file @
cfd6f99e
#!/usr/bin/env python
#!/usr/bin/env python
import
functools
as
func
import
glob
import
glob
import
numpy
as
np
import
re
import
re
from
os
import
path
as
osp
from
os
import
path
as
osp
...
@@ -17,26 +19,40 @@ for f in files:
...
@@ -17,26 +19,40 @@ for f in files:
with
open
(
f
,
'r'
)
as
content_file
:
with
open
(
f
,
'r'
)
as
content_file
:
content
=
content_file
.
read
()
content
=
content_file
.
read
()
title
=
content
.
split
(
'
\n
'
)[
0
].
replace
(
'#'
,
''
)
title
=
content
.
split
(
'
\n
'
)[
0
].
replace
(
'#'
,
''
)
.
strip
()
ckpts
=
set
(
x
.
lower
().
strip
()
ckpts
=
set
(
x
.
lower
().
strip
()
for
x
in
re
.
findall
(
r
'https?://download.*\.pth'
,
content
)
for
x
in
re
.
findall
(
r
'https?://download.*\.pth'
,
content
)
if
'mmdetection3d'
in
x
)
if
'mmdetection3d'
in
x
)
if
len
(
ckpts
)
==
0
:
if
len
(
ckpts
)
==
0
:
continue
continue
_papertype
=
[
x
for
x
in
re
.
findall
(
r
'\[([A-Z]+)\]'
,
content
)]
assert
len
(
_papertype
)
>
0
papertype
=
_papertype
[
0
]
paper
=
set
([(
papertype
,
title
)])
titles
.
append
(
title
)
titles
.
append
(
title
)
num_ckpts
+=
len
(
ckpts
)
num_ckpts
+=
len
(
ckpts
)
statsmsg
=
f
"""
statsmsg
=
f
"""
\t
* [
{
title
}
](
{
url
}
) (
{
len
(
ckpts
)
}
ckpts)
\t
*
[
{
papertype
}
]
[
{
title
}
](
{
url
}
) (
{
len
(
ckpts
)
}
ckpts)
"""
"""
stats
.
append
((
title
,
ckpts
,
statsmsg
))
stats
.
append
((
paper
,
ckpts
,
statsmsg
))
allpapers
=
func
.
reduce
(
lambda
a
,
b
:
a
.
union
(
b
),
[
p
for
p
,
_
,
_
in
stats
])
msglist
=
'
\n
'
.
join
(
x
for
_
,
_
,
x
in
stats
)
msglist
=
'
\n
'
.
join
(
x
for
_
,
_
,
x
in
stats
)
papertypes
,
papercounts
=
np
.
unique
([
t
for
t
,
_
in
allpapers
],
return_counts
=
True
)
countstr
=
'
\n
'
.
join
(
[
f
' -
{
t
}
:
{
c
}
'
for
t
,
c
in
zip
(
papertypes
,
papercounts
)])
modelzoo
=
f
"""
modelzoo
=
f
"""
\n
## Model Zoo Statistics
\n
## Model Zoo Statistics
* Number of papers:
{
len
(
set
(
titles
))
}
* Number of papers:
{
len
(
set
(
titles
))
}
{
countstr
}
* Number of checkpoints:
{
num_ckpts
}
* Number of checkpoints:
{
num_ckpts
}
{
msglist
}
{
msglist
}
"""
"""
...
...
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