Skip to content

Commit 1c96a89

Browse files
authored
update stat to classify papers (open-mmlab#348)
1 parent 49515e7 commit 1c96a89

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

configs/fp16/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
[ALGORITHM]
5+
[OTHERS]
66

77
```latex
88
@article{micikevicius2017mixed,

docs/stat.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env python
2+
import functools as func
23
import glob
34
import os.path as osp
45
import re
56

7+
import numpy as np
8+
69
url_prefix = 'https://github.com/open-mmlab/mmsegmentation/blob/master/'
7-
titles_to_be_excluded = ['Mixed Precision Training']
810

911
files = sorted(glob.glob('../configs/*/README.md'))
1012

@@ -18,29 +20,40 @@
1820
with open(f, 'r') as content_file:
1921
content = content_file.read()
2022

21-
title = content.split('\n')[0].replace('#', '')
22-
if title.strip() in titles_to_be_excluded:
23-
continue
24-
23+
title = content.split('\n')[0].replace('#', '').strip()
2524
ckpts = set(x.lower().strip()
2625
for x in re.findall(r'https?://download.*\.pth', content)
2726
if 'mmsegmentation' in x)
2827
if len(ckpts) == 0:
2928
continue
3029

30+
_papertype = [x for x in re.findall(r'\[([A-Z]+)\]', content)]
31+
assert len(_papertype) > 0
32+
papertype = _papertype[0]
33+
34+
paper = set([(papertype, title)])
35+
3136
titles.append(title)
3237
num_ckpts += len(ckpts)
3338
statsmsg = f"""
34-
\t* [{title}]({url}) ({len(ckpts)} ckpts)
39+
\t* [{papertype}] [{title}]({url}) ({len(ckpts)} ckpts)
3540
"""
36-
stats.append((title, ckpts, statsmsg))
41+
stats.append((paper, ckpts, statsmsg))
3742

43+
allpapers = func.reduce(lambda a, b: a.union(b), [p for p, _, _ in stats])
3844
msglist = '\n'.join(x for _, _, x in stats)
3945

46+
papertypes, papercounts = np.unique([t for t, _ in allpapers],
47+
return_counts=True)
48+
countstr = '\n'.join(
49+
[f' - {t}: {c}' for t, c in zip(papertypes, papercounts)])
50+
4051
modelzoo = f"""
4152
# Model Zoo Statistics
4253
4354
* Number of papers: {len(set(titles))}
55+
{countstr}
56+
4457
* Number of checkpoints: {num_ckpts}
4558
{msglist}
4659
"""

0 commit comments

Comments
 (0)