Skip to content

Commit 1dbaa49

Browse files
authored
Merge pull request #12 from DeepLabCut/niels/update_display
Update display to have 1 table per benchmark
2 parents 53bb905 + d139b1d commit 1dbaa49

25 files changed

+963
-554
lines changed

docs/_sources/index.rst.txt

+21-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,29 @@ Click on columns to sort in ascending or descending order.
1919
Press ``Ctrl`` while selecting columns to sort by multiple columns.
2020
Hover over a column name to get additional explanations for the metric.
2121

22+
TRI-MOUSE
23+
^^^^^^^^^
24+
2225
.. raw:: html
23-
:file: generated/table.html
26+
:file: generated/tableTRI-MOUSE.html
27+
28+
FISH
29+
^^^^
30+
31+
.. raw:: html
32+
:file: generated/tableFISH.html
33+
34+
MARMOSETS
35+
^^^^^^^^^
2436

37+
.. raw:: html
38+
:file: generated/tableMARMOSETS.html
39+
40+
PARENTING-MOUSE
41+
^^^^^^^^^^^^^^^
42+
43+
.. raw:: html
44+
:file: generated/tablePARENTING.html
2545

2646
.. toctree::
2747
:maxdepth: 2

docs/_sources/submission.rst.txt

+12-6
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,21 @@ These looks as follows:
6565
"path/to/image.png" : (
6666
# animal 1
6767
{
68-
"snout" : (0, 1),
69-
"leftear" : (2, 3),
70-
...
68+
"pose": {
69+
"snout" : (12, 17),
70+
"leftear" : (15, 13),
71+
...
72+
},
73+
"score": 0.9172,
7174
},
7275
# animal 2
7376
{
74-
"snout" : (0, 1),
75-
"leftear" : (2, 3),
76-
...
77+
"pose": {
78+
"snout" : (27, 138),
79+
"leftear" : (23, 142),
80+
...
81+
},
82+
"score": 0.8534,
7783
},
7884
),
7985
...

docs/_static/copybutton.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ div.highlight {
3535
position: relative;
3636
}
3737

38-
.highlight:hover button.copybtn {
38+
/* Show the copybutton */
39+
.highlight:hover button.copybtn, button.copybtn.success {
3940
opacity: 1;
4041
}
4142

docs/_static/copybutton.js

+36-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const messages = {
2020
},
2121
'fr' : {
2222
'copy': 'Copier',
23-
'copy_to_clipboard': 'Copié dans le presse-papier',
23+
'copy_to_clipboard': 'Copier dans le presse-papier',
2424
'copy_success': 'Copié !',
2525
'copy_failure': 'Échec de la copie',
2626
},
@@ -102,18 +102,25 @@ const clearSelection = () => {
102102
}
103103
}
104104

105-
// Changes tooltip text for two seconds, then changes it back
105+
// Changes tooltip text for a moment, then changes it back
106+
// We want the timeout of our `success` class to be a bit shorter than the
107+
// tooltip and icon change, so that we can hide the icon before changing back.
108+
var timeoutIcon = 2000;
109+
var timeoutSuccessClass = 1500;
110+
106111
const temporarilyChangeTooltip = (el, oldText, newText) => {
107112
el.setAttribute('data-tooltip', newText)
108113
el.classList.add('success')
109-
setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
110-
setTimeout(() => el.classList.remove('success'), 2000)
114+
// Remove success a little bit sooner than we change the tooltip
115+
// So that we can use CSS to hide the copybutton first
116+
setTimeout(() => el.classList.remove('success'), timeoutSuccessClass)
117+
setTimeout(() => el.setAttribute('data-tooltip', oldText), timeoutIcon)
111118
}
112119

113120
// Changes the copy button icon for two seconds, then changes it back
114121
const temporarilyChangeIcon = (el) => {
115122
el.innerHTML = iconCheck;
116-
setTimeout(() => {el.innerHTML = iconCopy}, 2000)
123+
setTimeout(() => {el.innerHTML = iconCopy}, timeoutIcon)
117124
}
118125

119126
const addCopyButtonToCodeCells = () => {
@@ -125,7 +132,8 @@ const addCopyButtonToCodeCells = () => {
125132
}
126133

127134
// Add copybuttons to all of our code cells
128-
const codeCells = document.querySelectorAll('div.highlight pre')
135+
const COPYBUTTON_SELECTOR = 'div.highlight pre';
136+
const codeCells = document.querySelectorAll(COPYBUTTON_SELECTOR)
129137
codeCells.forEach((codeCell, index) => {
130138
const id = codeCellId(index)
131139
codeCell.setAttribute('id', id)
@@ -141,10 +149,25 @@ function escapeRegExp(string) {
141149
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
142150
}
143151

152+
/**
153+
* Removes excluded text from a Node.
154+
*
155+
* @param {Node} target Node to filter.
156+
* @param {string} exclude CSS selector of nodes to exclude.
157+
* @returns {DOMString} Text from `target` with text removed.
158+
*/
159+
function filterText(target, exclude) {
160+
const clone = target.cloneNode(true); // clone as to not modify the live DOM
161+
if (exclude) {
162+
// remove excluded nodes
163+
clone.querySelectorAll(exclude).forEach(node => node.remove());
164+
}
165+
return clone.innerText;
166+
}
167+
144168
// Callback when a copy button is clicked. Will be passed the node that was clicked
145169
// should then grab the text and replace pieces of text that shouldn't be used in output
146170
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {
147-
148171
var regexp;
149172
var match;
150173

@@ -199,7 +222,12 @@ function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onl
199222

200223
var copyTargetText = (trigger) => {
201224
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
202-
return formatCopyText(target.innerText, '', false, true, true, true, '', '')
225+
226+
// get filtered text
227+
let exclude = '.linenos';
228+
229+
let text = filterText(target, exclude);
230+
return formatCopyText(text, '', false, true, true, true, '', '')
203231
}
204232

205233
// Initialize with a callback so we can modify the text before copy

docs/_static/copybutton_funcs.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@ function escapeRegExp(string) {
22
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
33
}
44

5+
/**
6+
* Removes excluded text from a Node.
7+
*
8+
* @param {Node} target Node to filter.
9+
* @param {string} exclude CSS selector of nodes to exclude.
10+
* @returns {DOMString} Text from `target` with text removed.
11+
*/
12+
export function filterText(target, exclude) {
13+
const clone = target.cloneNode(true); // clone as to not modify the live DOM
14+
if (exclude) {
15+
// remove excluded nodes
16+
clone.querySelectorAll(exclude).forEach(node => node.remove());
17+
}
18+
return clone.innerText;
19+
}
20+
521
// Callback when a copy button is clicked. Will be passed the node that was clicked
622
// should then grab the text and replace pieces of text that shouldn't be used in output
723
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {
8-
924
var regexp;
1025
var match;
1126

docs/_static/pygments.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
2222
.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
2323
.highlight .gd { color: #a40000 } /* Generic.Deleted */
2424
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
25+
.highlight .ges { color: #000000; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
2526
.highlight .gr { color: #ef2929 } /* Generic.Error */
2627
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
2728
.highlight .gi { color: #00A000 } /* Generic.Inserted */
@@ -54,7 +55,8 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
5455
.highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */
5556
.highlight .nv { color: #000000 } /* Name.Variable */
5657
.highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */
57-
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
58+
.highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */
59+
.highlight .w { color: #f8f8f8 } /* Text.Whitespace */
5860
.highlight .mb { color: #0000cf; font-weight: bold } /* Literal.Number.Bin */
5961
.highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
6062
.highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */

docs/_static/webpack-macros.html

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<!-- these macros are generated by "yarn build:production". do not edit by hand. -->
1+
<!--
2+
AUTO-GENERATED from webpack.config.js, do **NOT** edit by hand.
3+
These are re-used in layout.html
4+
-->
5+
{# Load FontAwesome icons #}
26
{% macro head_pre_icons() %}
37
<link rel="stylesheet"
48
href="{{ pathto('_static/vendor/fontawesome/5.13.0/css/all.min.css', 1) }}">
@@ -8,18 +12,18 @@
812
href="{{ pathto('_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2', 1) }}">
913
{% endmacro %}
1014

11-
{% macro head_pre_fonts() %}
12-
{% endmacro %}
13-
14-
{% macro head_pre_bootstrap() %}
15-
<link href="{{ pathto('_static/css/theme.css', 1) }}" rel="stylesheet" />
16-
<link href="{{ pathto('_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css', 1) }}" rel="stylesheet" />
15+
{% macro head_pre_assets() %}
16+
<!-- Loaded before other Sphinx assets -->
17+
<link href="{{ pathto('_static/styles/theme.css', 1) }}?digest=1999514e3f237ded88cf" rel="stylesheet">
18+
<link href="{{ pathto('_static/styles/pydata-sphinx-theme.css', 1) }}?digest=1999514e3f237ded88cf" rel="stylesheet">
1719
{% endmacro %}
1820

1921
{% macro head_js_preload() %}
20-
<link rel="preload" as="script" href="{{ pathto('_static/js/index.1c5a1a01449ed65a7b51.js', 1) }}">
22+
<!-- Pre-loaded scripts that we'll load fully later -->
23+
<link rel="preload" as="script" href="{{ pathto('_static/scripts/pydata-sphinx-theme.js', 1) }}?digest=1999514e3f237ded88cf">
2124
{% endmacro %}
2225

2326
{% macro body_post() %}
24-
<script src="{{ pathto('_static/js/index.1c5a1a01449ed65a7b51.js', 1) }}"></script>
27+
<!-- Scripts loaded after <body> so the DOM is not blocked -->
28+
<script src="{{ pathto('_static/scripts/pydata-sphinx-theme.js', 1) }}?digest=1999514e3f237ded88cf"></script>
2529
{% endmacro %}

docs/about.html

+30-27
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
<html>
55
<head>
66
<meta charset="utf-8" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
8+
89
<title>About the benchmark &#8212; DeepLabCut benchmark</title>
910

10-
<link href="_static/css/theme.css" rel="stylesheet" />
11-
<link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
11+
<!-- Loaded before other Sphinx assets -->
12+
<link href="_static/styles/theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
13+
<link href="_static/styles/pydata-sphinx-theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
1214

1315

1416
<link rel="stylesheet"
@@ -18,15 +20,11 @@
1820
<link rel="preload" as="font" type="font/woff2" crossorigin
1921
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
2022

21-
22-
23-
24-
2523
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
26-
<link rel="stylesheet" type="text/css" href="_static/basic.css" />
2724
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
2825

29-
<link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js">
26+
<!-- Pre-loaded scripts that we'll load fully later -->
27+
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf">
3028

3129
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
3230
<script src="_static/jquery.js"></script>
@@ -42,12 +40,21 @@
4240
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
4341
<script>
4442
$(function() {
45-
$("#myTable").tablesorter();
43+
$("#TRI-MOUSE").tablesorter();
44+
});
45+
$(function() {
46+
$("#MARMOSETS").tablesorter();
47+
});
48+
$(function() {
49+
$("#PARENTING").tablesorter();
50+
});
51+
$(function() {
52+
$("#FISH").tablesorter();
4653
});
4754
</script>
4855

4956
</head>
50-
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
57+
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="60">
5158

5259
<div class="container-fluid" id="banner"></div>
5360

@@ -109,16 +116,12 @@
109116
<div class="navbar-end-item">
110117
<ul id="navbar-icon-links" class="navbar-nav" aria-label="Icon Links">
111118
<li class="nav-item">
112-
<a class="nav-link" href="https://github.com/deeplabcut/benchmark" rel="noopener" target="_blank" title="Github">
113-
<span><i class="fab fa-github"></i></span>
114-
<label class="sr-only">Github</label>
115-
</a>
119+
<a class="nav-link" href="https://github.com/deeplabcut/benchmark" rel="noopener" target="_blank" title="Github"><span><i class="fab fa-github"></i></span>
120+
<label class="sr-only">Github</label></a>
116121
</li>
117122
<li class="nav-item">
118-
<a class="nav-link" href="https://twitter.com/DeepLabCut" rel="noopener" target="_blank" title="Twitter">
119-
<span><i class="fab fa-twitter"></i></span>
120-
<label class="sr-only">Twitter</label>
121-
</a>
123+
<a class="nav-link" href="https://twitter.com/DeepLabCut" rel="noopener" target="_blank" title="Twitter"><span><i class="fab fa-twitter"></i></span>
124+
<label class="sr-only">Twitter</label></a>
122125
</li>
123126
</ul>
124127
</div>
@@ -153,13 +156,13 @@
153156

154157
<div>
155158

156-
<div class="section" id="about-the-benchmark">
157-
<h1>About the benchmark<a class="headerlink" href="#about-the-benchmark" title="Permalink to this headline"></a></h1>
159+
<section id="about-the-benchmark">
160+
<h1>About the benchmark<a class="headerlink" href="#about-the-benchmark" title="Permalink to this headline">#</a></h1>
158161
<div class="admonition note">
159162
<p class="admonition-title">Note</p>
160163
<p>TODO</p>
161164
</div>
162-
</div>
165+
</section>
163166

164167

165168
</div>
@@ -171,20 +174,20 @@ <h1>About the benchmark<a class="headerlink" href="#about-the-benchmark" title="
171174
</div>
172175
</div>
173176

174-
<script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script>
175-
176-
<footer class="footer mt-5 mt-md-0">
177+
<!-- Scripts loaded after <body> so the DOM is not blocked -->
178+
<script src="_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf"></script>
179+
<footer class="footer mt-5 mt-md-0">
177180
<div class="container">
178181

179182
<div class="footer-item">
180183
<p class="copyright">
181-
&copy; Copyright 2021, DeepLabCut Developers.<br/>
184+
&copy; Copyright 2021, DeepLabCut Developers.<br>
182185
</p>
183186
</div>
184187

185188
<div class="footer-item">
186189
<p class="sphinx-version">
187-
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 4.2.0.<br/>
190+
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 4.2.0.<br>
188191
</p>
189192
</div>
190193

0 commit comments

Comments
 (0)