Skip to content

Commit 02414b2

Browse files
author
Sofiene Boutaj
committed
Add learderboard in the documentation
1 parent 18a62f0 commit 02414b2

4 files changed

Lines changed: 298 additions & 9 deletions

File tree

docs/javascripts/rank-table.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
document$.subscribe(() => {
2+
const $table = $('#rankTable');
3+
if (!$table.length || $table.hasClass('dataTable')) {
4+
return; // Table not present or already initialized
5+
}
6+
7+
const dt = $table.DataTable({
8+
paging: false,
9+
info: true,
10+
ordering: true,
11+
searching: true,
12+
13+
searchPanes: {
14+
columns: [1, 2, 3],
15+
viewTotal: true
16+
},
17+
18+
dom: 'Pfrt',
19+
columnDefs: [
20+
{ targets: [1, 2], visible: false, searchable: true },
21+
{
22+
targets: [3, 4, 5, 6, 7, 8, 9],
23+
render: function (data, type) {
24+
if (type === 'sort' || type === 'type') {
25+
const match = data.match(/\((\d+)\)/);
26+
return match ? parseInt(match[1], 10) : Infinity;
27+
}
28+
return data;
29+
}
30+
},
31+
{
32+
targets: 9,
33+
className: 'fw-semibold',
34+
}
35+
],
36+
order: [[9, 'asc']],
37+
language: {
38+
search: '_INPUT_',
39+
searchPlaceholder: 'Search models…'
40+
},
41+
});
42+
43+
// ─── Highlight top-3 rows with podium colours ───────────────────────
44+
function paintWinners() {
45+
// clear any previous podium colours
46+
dt.rows().nodes().to$().removeClass('winner-gold winner-silver winner-bronze');
47+
48+
// Get the current sort direction (ascending or descending)
49+
const sortOrder = dt.order();
50+
const isDescending = sortOrder[0][1] === 'desc'; // Check if it's descending
51+
52+
var rows = dt.rows({ order: 'applied', search: 'applied' }).indexes().toArray();
53+
54+
rows = rows.sort((a, b) => {
55+
const extractRank = (str) => {
56+
const match = str.match(/\((\d+)\)/); // Match number inside parentheses
57+
return match ? parseInt(match[1], 10) : Infinity; // Use Infinity if not found
58+
};
59+
60+
const valueA = extractRank(dt.cell(a, 9).data());
61+
const valueB = extractRank(dt.cell(b, 9).data());
62+
63+
return !isDescending ? valueB - valueA : valueA - valueB;
64+
});
65+
if (isDescending)
66+
var top3 = rows.slice(0, 3);
67+
68+
else {
69+
var top3 = rows.slice(rows.length - 3, rows.length);
70+
top3.reverse();
71+
}
72+
// Apply podium classes based on the sorted top 3 rows
73+
if (top3[0] !== undefined) $(dt.row(top3[0]).node()).addClass('winner-gold');
74+
if (top3[1] !== undefined) $(dt.row(top3[1]).node()).addClass('winner-silver');
75+
if (top3[2] !== undefined) $(dt.row(top3[2]).node()).addClass('winner-bronze');
76+
}
77+
78+
paintWinners();
79+
80+
dt.on('draw', paintWinners);
81+
82+
$('.dtsp-titleRow').hide();
83+
});

docs/leaderboard.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Rank-sum Leaderboard
3+
---
4+
5+
# 🏆 Rank-sum Leaderboard
6+
7+
<div class="table-responsive-sm">
8+
<table id="rankTable" class="table table-hover table-bordered table-sm nowrap w-100">
9+
<caption>Lower Rank-sum = better overall performance</caption>
10+
<thead class="align-middle text-center">
11+
<tr>
12+
<th>Model</th>
13+
<th>Domain</th>
14+
<th>Type</th>
15+
<th>KNN &uarr;</th>
16+
<th>Lin. prob. &uarr;</th>
17+
<th>Few-shot &uarr;</th>
18+
<th>Calib. &darr;</th>
19+
<th>Adv. attack &darr;</th>
20+
<th>Seg.&uarr;</th>
21+
<th>Rank sum &darr;</th>
22+
</tr>
23+
</thead>
24+
<tbody>
25+
<tr><td>HIBOU-B</td><td>Histopathology</td><td>VM</td><td>75.8 (10)</td><td>78.0 (14)</td><td>74.2 (6)</td><td>3.7 (2)</td><td>52.8 (14)</td><td>61.5 (10)</td><td>56 (8)</td></tr>
26+
<tr><td>HIBOU-L</td><td>Histopathology</td><td>VM</td><td>75.2 (12)</td><td>81.2 (7)</td><td>70.4 (12)</td><td>5.5 (21)</td><td>40.0 (5)</td><td>62.2 (7)</td><td>64 (10)</td></tr>
27+
<tr><td>H-OPTIMUS-0</td><td>Histopathology</td><td>VM</td><td>79.2 (5)</td><td>81.4 (5)</td><td>73.4 (7)</td><td>4.7 (12)</td><td>44.2 (9)</td><td>59.0 (13)</td><td>51 (7)</td></tr>
28+
<tr><td>H-OPTIMUS-1</td><td>Histopathology</td><td>VM</td><td>80.5 (3)</td><td>83.3 (2)</td><td>74.8 (4)</td><td>4.1 (4)</td><td>58.0 (17)</td><td>58.4 (14)</td><td>44 (5)</td></tr>
29+
<tr><td>MIDNIGHT</td><td>Histopathology</td><td>VM</td><td>78.2 (8)</td><td>82.9 (3)</td><td>70.6 (11)</td><td>3.2 (1)</td><td>36.3 (4)</td><td>62.9 (2)</td><td>29 (3)</td></tr>
30+
<tr><td>PHIKON</td><td>Histopathology</td><td>VM</td><td>72.8 (14)</td><td>78.5 (13)</td><td>72.2 (10)</td><td>6.4 (22)</td><td>34.4 (3)</td><td>61.7 (9)</td><td>71 (13)</td></tr>
31+
<tr><td>PHIKON2</td><td>Histopathology</td><td>VM</td><td>70.1 (15)</td><td>76.5 (15)</td><td>70.1 (13)</td><td>4.6 (10)</td><td>45.6 (11)</td><td>62.0 (8)</td><td>72 (14)</td></tr>
32+
<tr><td>UNI</td><td>Histopathology</td><td>VM</td><td>78.8 (6)</td><td>81.3 (6)</td><td>76.4 (2)</td><td>4.3 (7)</td><td>42.8 (7)</td><td>62.2 (6)</td><td>34 (4)</td></tr>
33+
<tr><td>UNI2-H</td><td>Histopathology</td><td>VM</td><td>81.7 (1)</td><td>83.9 (1)</td><td>78.4 (1)</td><td>4.5 (8)</td><td>34.3 (2)</td><td>62.8 (4)</td><td>17 (1)</td></tr>
34+
<tr><td>VIRCHOW</td><td>Histopathology</td><td>VM</td><td>74.2 (13)</td><td>80.2 (11)</td><td>68.5 (15)</td><td>5.5 (19)</td><td>41.0 (6)</td><td>62.7 (5)</td><td>69 (11)</td></tr>
35+
<tr><td>VIRCHOW2</td><td>Histopathology</td><td>VM</td><td>81.2 (2)</td><td>82.7 (4)</td><td>72.5 (9)</td><td>4.6 (11)</td><td>33.6 (1)</td><td>63.4 (1)</td><td>28 (2)</td></tr>
36+
<tr><td>CONCH</td><td>Histopathology</td><td>VLM</td><td>77.3 (9)</td><td>80.2 (10)</td><td>73.1 (8)</td><td>4.3 (6)</td><td>55.0 (15)</td><td>42.0 (23)</td><td>71 (12)</td></tr>
37+
<tr><td>CONCH&nbsp;1.5</td><td>Histopathology</td><td>VLM</td><td>78.6 (7)</td><td>80.8 (9)</td><td>74.6 (5)</td><td>4.9 (15)</td><td>75.3 (23)</td><td>62.8 (3)</td><td>62 (9)</td></tr>
38+
<tr><td>KEEP</td><td>Histopathology</td><td>VLM</td><td>79.7 (4)</td><td>81.1 (8)</td><td>75.8 (3)</td><td>4.7 (13)</td><td>44.7 (10)</td><td>61.3 (11)</td><td>49 (6)</td></tr>
39+
<tr><td>MUSK</td><td>Histopathology</td><td>VLM</td><td>75.6 (11)</td><td>79.0 (12)</td><td>70.0 (14)</td><td>4.5 (9)</td><td>69.3 (22)</td><td>59.7 (12)</td><td>80 (15)</td></tr>
40+
<tr><td>PLIP</td><td>Histopathology</td><td>VLM</td><td>67.8 (19)</td><td>71.0 (21)</td><td>63.4 (17)</td><td>4.9 (14)</td><td>56.9 (16)</td><td>54.0 (21)</td><td>108 (20)</td></tr>
41+
<tr><td>QUILTNET</td><td>Histopathology</td><td>VLM</td><td>68.3 (17)</td><td>71.0 (22)</td><td>65.7 (16)</td><td>7.0 (23)</td><td>52.7 (13)</td><td>54.3 (20)</td><td>111 (21)</td></tr>
42+
<tr><td>DINOv2-B</td><td>Natural-image</td><td>VM</td><td>67.9 (18)</td><td>74.8 (17)</td><td>61.0 (18)</td><td>5.5 (20)</td><td>65.8 (20)</td><td>54.7 (18)</td><td>111 (22)</td></tr>
43+
<tr><td>DINOv2-L</td><td>Natural-image</td><td>VM</td><td>69.5 (16)</td><td>75.3 (16)</td><td>59.2 (19)</td><td>5.3 (17)</td><td>64.5 (19)</td><td>54.4 (19)</td><td>106 (19)</td></tr>
44+
<tr><td>ViT-B/16</td><td>Natural-image</td><td>VM</td><td>64.4 (21)</td><td>71.9 (19)</td><td>57.8 (21)</td><td>3.9 (3)</td><td>46.8 (12)</td><td>57.9 (15)</td><td>93 (16)</td></tr>
45+
<tr><td>ViT-L/16</td><td>Natural-image</td><td>VM</td><td>67.5 (20)</td><td>72.8 (18)</td><td>56.5 (22)</td><td>5.0 (16)</td><td>44.1 (8)</td><td>51.9 (22)</td><td>99 (17)</td></tr>
46+
<tr><td>CLIP-B/32</td><td>Natural-image</td><td>VLM</td><td>61.9 (23)</td><td>65.8 (23)</td><td>53.3 (23)</td><td>5.5 (18)</td><td>60.4 (18)</td><td>55.9 (16)</td><td>127 (23)</td></tr>
47+
<tr><td>CLIP-L/14</td><td>Natural-image</td><td>VLM</td><td>64.2 (22)</td><td>71.3 (20)</td><td>58.2 (20)</td><td>4.2 (5)</td><td>67.8 (21)</td><td>55.5 (17)</td><td>104 (18)</td></tr>
48+
</tbody>
49+
</table>
50+
</div>

docs/stylesheets/extra.css

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,154 @@
22
--md-primary-fg-color: #61449b;
33
--md-primary-fg-color--light: #88bee7;
44
--md-primary-fg-color--dark: #412a71;
5+
--thunder-purple-700: #5433a6;
6+
--thunder-purple-800: #412a71;
7+
--thunder-purple-50 : #ede9f7;
58
}
69

710
.md-header__button.md-logo img,
811
.md-header__button.md-logo svg {
912
height: 2rem;
1013
width: 2rem;
11-
}
14+
}
15+
16+
#rankTable {
17+
border:1px solid #ede9f7 ;
18+
}
19+
#rankTable.table {
20+
21+
width: 100%;
22+
font-size: 0.60rem;
23+
}
24+
25+
#rankTable.table thead th {
26+
background: #5330a5;
27+
color: white;
28+
border:1px solid #ede9f7 ;
29+
30+
text-align: center;
31+
vertical-align: middle;
32+
padding: 0.60rem 0.75rem;
33+
font-weight: 600;
34+
}
35+
36+
#rankTable.table tbody td,
37+
#rankTable.table tbody th {
38+
border:1px solid #ede9f7 ;
39+
40+
vertical-align: middle;
41+
padding: 0.55rem 0.75rem;
42+
text-align: center;
43+
white-space: nowrap;
44+
}
45+
46+
47+
#rankTable_filter label {
48+
display: block;
49+
width: 100%;
50+
}
51+
52+
#rankTable caption {
53+
caption-side: bottom;
54+
text-align: center;
55+
font-size: 0.60rem;
56+
padding-top: 0.5rem;
57+
color: var(--bs-gray-600);
58+
}
59+
60+
61+
#rankTable_filter{
62+
width:100% ;
63+
float:none ;
64+
text-align:center ;
65+
padding:0;
66+
margin-block:0.75rem;
67+
}
68+
69+
#rankTable_filter > label{
70+
display:block;
71+
width:100%;
72+
margin:0;
73+
}
74+
75+
#rankTable_filter > label{
76+
position:relative;
77+
}
78+
79+
#rankTable_filter input[type="search"]:hover, #rankTable_filter input[type="search"]:focus{
80+
outline:none;
81+
border-color:#5433a6;
82+
background:#fff;
83+
box-shadow:0 0 0 .18rem rgba(43,133,255,.25);
84+
}
85+
86+
#rankTable_filter input[type="search"]::placeholder{
87+
color:#adb5bd;
88+
opacity:1;
89+
}
90+
91+
#rankTable_filter input{
92+
padding:.5rem 1rem .5rem 2.5rem;
93+
border:2px solid #000000;
94+
border-radius:9999px;
95+
background:#f9fafb;
96+
transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
97+
font-size:.9rem;
98+
width:100% ;
99+
max-width:100%;
100+
box-sizing:border-box;
101+
margin: 0px;
102+
103+
}
104+
105+
#rankTable_filter > label::before{
106+
content:'';
107+
position:absolute;
108+
top:50%;
109+
left:1rem;
110+
translate:0 -50%;
111+
width:1rem; height:1rem;
112+
background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='%23adb5bd' viewBox='0 0 16 16'><path d='M11 6a5 5 0 1 1-2-4 5 5 0 0 1 2 4z'/><path d='M15.7 14.3 11.3 9.9a6 6 0 1 0-1.4 1.4l4.4 4.4a1 1 0 0 0 1.4-1.4z'/></svg>") no-repeat center/contain;
113+
pointer-events:none;
114+
opacity:.7;
115+
116+
}
117+
118+
#rankTable_filter input[type="search"]:focus + *::before,
119+
#rankTable_filter input[type="search"]:hover + *::before{
120+
opacity:1;
121+
}
122+
123+
.dataTables_scrollBody {
124+
text-align: center;
125+
max-height: 72px !important;
126+
}
127+
128+
/* ─── Podium-row styling ───────────────────────────────────────────── */
129+
.winner-gold { background-color:#fff9db!important;}
130+
.winner-silver { background-color:#edeff1!important;}
131+
.winner-bronze { background-color:#fff1e6!important;}
132+
133+
.winner-gold td:first-child::before { content:"🥇 "; }
134+
.winner-silver td:first-child::before { content:"🥈 "; }
135+
.winner-bronze td:first-child::before { content:"🥉 "; }
136+
137+
.fw-semibold {
138+
font-weight: 600;
139+
}
140+
141+
#rankTable_wrapper {
142+
display: flex;
143+
flex-direction: column;
144+
align-items: center;
145+
}
146+
147+
#rankTable_filter {
148+
width: 100%;
149+
margin-bottom: 10px;
150+
}
151+
152+
153+
div.dtsp-panesContainer {
154+
margin: 0px !important;
155+
}

mkdocs.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,31 @@ repo_name: MICS-Lab/thunder
33
site_url: https://mics-lab.github.io/thunder
44
repo_url: https://github.com/MICS-Lab/thunder
55

6-
plugins:
7-
- mkdocstrings
6+
extra_css:
7+
- stylesheets/extra.css
8+
- https://cdn.jsdelivr.net/npm/datatables.net-bs5@1.13.7/css/dataTables.bootstrap5.min.css
9+
- https://cdn.datatables.net/searchpanes/2.3.3/css/searchPanes.dataTables.min.css
10+
11+
extra_javascript:
12+
- https://code.jquery.com/jquery-3.7.1.min.js
13+
- https://cdn.jsdelivr.net/npm/datatables.net@1.13.7/js/jquery.dataTables.min.js
14+
- https://cdn.jsdelivr.net/npm/datatables.net-bs5@1.13.7/js/dataTables.bootstrap5.min.js
15+
16+
- https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js
17+
- https://cdn.datatables.net/searchpanes/2.3.3/js/dataTables.searchPanes.min.js
18+
19+
- javascripts/rank-table.js
820

921
nav:
1022
- Home: index.md
23+
- Leaderboard: leaderboard.md
1124
- Tutorials:
1225
- Getting Started: getting_started.md
13-
- Benchmarking a Custom Model: custom_model.md
26+
- Benchmark a Custom Model: custom_model.md
1427
- Overriding Configurations: custom_config.md
15-
- Using foundation models on your data: get_model.md
1628
- API: api.md
1729

18-
theme:
30+
theme:
1931
name: material
2032
logo: logo.svg
2133
favicon: logo.svg
@@ -32,9 +44,9 @@ plugins:
3244
heading_level: 3
3345

3446
markdown_extensions:
47+
- md_in_html
48+
- attr_list
3549
- admonition
3650
- pymdownx.details
3751
- pymdownx.superfences
38-
39-
extra_css:
40-
- stylesheets/extra.css
52+

0 commit comments

Comments
 (0)