Skip to content

Commit e8bf16a

Browse files
author
Roni Choudhury
authored
Merge pull request #465 from Kitware/trackerdash
Add initial TrackerDash component
2 parents edcac1d + 8ee1900 commit e8bf16a

27 files changed

+1794
-0
lines changed

app/examples/index.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,9 @@
107107
{
108108
"title": "OnSet",
109109
"link": "onset"
110+
},
111+
{
112+
"title": "TrackerDash",
113+
"link": "trackerdash"
110114
}
111115
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
doctype html
2+
3+
head
4+
meta(charset="utf-8")
5+
6+
body
7+
.dash-container
8+
9+
script(src="index.js")

app/examples/trackerdash/index.js

Lines changed: 373 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,373 @@
1+
import html from './index.jade';
2+
import TrackerDash from '../../../src/candela/components/TrackerDash';
3+
import '../../../src/candela/components/TrackerDash/styles';
4+
5+
document.write(html());
6+
7+
// Pass query param 'omitAggTrends' to test without 'agg_trends' key.
8+
var betaGroundTruthSettings = {
9+
el: '.dash-container',
10+
name: 'Beta Ground Truth Pre-Approved With a very long name',
11+
day: '2014-06-03',
12+
submission_uuid: '2d14dd46-0738-11e6-b653-000c29998cff',
13+
branch: 'feature/incredibly-complex-and-precise-branch-name-master',
14+
producer_link: 'http://www.example.com',
15+
histogram_max_x: 0.5,
16+
trendValuesByDataset: [
17+
{
18+
dataset: 'dataset0.jpg',
19+
trend: 'ALGA RMSE Euclidean Distance',
20+
current: 0.1
21+
},
22+
{
23+
dataset: 'dataset0.jpg',
24+
trend: 'ALGC RMSE Euclidean Distance',
25+
// ALGC RMSE values are strings to elicit alpha sorting order bug.
26+
// With the bug, the median is 215, with the fix, it is 5.
27+
current: '215'
28+
},
29+
{
30+
dataset: 'dataset0.jpg',
31+
trend: 'ALGASBR RMSE Euclidean Distance',
32+
current: 0.3
33+
},
34+
{
35+
dataset: 'dataset0.jpg',
36+
trend: 'ALGD-OFFLINE RMSE Euclidean Distance',
37+
current: 0.25
38+
},
39+
{
40+
dataset: 'dataset0.jpg',
41+
trend: 'ALGD-ONLINE RMSE Euclidean Distance',
42+
current: 0.15
43+
},
44+
{
45+
dataset: 'dataset1',
46+
trend: 'ALGA RMSE Euclidean Distance',
47+
current: 0.2
48+
},
49+
{
50+
dataset: 'dataset1',
51+
trend: 'ALGC RMSE Euclidean Distance',
52+
current: '1'
53+
},
54+
{
55+
dataset: 'dataset1',
56+
trend: 'ALGASBR RMSE Euclidean Distance',
57+
current: 0.2
58+
},
59+
{
60+
dataset: 'dataset1',
61+
trend: 'ALGD-OFFLINE RMSE Euclidean Distance',
62+
current: 0.10
63+
},
64+
{
65+
dataset: 'dataset1',
66+
trend: 'ALGD-ONLINE RMSE Euclidean Distance',
67+
current: 0.12
68+
},
69+
{
70+
dataset: 'dataset2',
71+
trend: 'ALGA RMSE Euclidean Distance',
72+
current: 0.5
73+
},
74+
{
75+
dataset: 'dataset2',
76+
trend: 'ALGC RMSE Euclidean Distance',
77+
current: '5'
78+
},
79+
{
80+
dataset: 'dataset2',
81+
trend: 'ALGASBR RMSE Euclidean Distance',
82+
current: 0.3
83+
},
84+
{
85+
dataset: 'dataset2',
86+
trend: 'ALGD-OFFLINE RMSE Euclidean Distance',
87+
current: 0.22
88+
},
89+
{
90+
dataset: 'dataset2',
91+
trend: 'ALGD-ONLINE RMSE Euclidean Distance',
92+
current: 0.18
93+
},
94+
{
95+
dataset: 'dataset3',
96+
trend: 'ALGA RMSE Euclidean Distance',
97+
current: 0.8
98+
},
99+
{
100+
dataset: 'dataset3',
101+
trend: 'ALGC RMSE Euclidean Distance',
102+
current: '6'
103+
},
104+
// Omit ALGASBR dataset3
105+
{
106+
dataset: 'dataset3',
107+
trend: 'ALGD-OFFLINE RMSE Euclidean Distance',
108+
current: 27,
109+
callback: function () { console.log('dataset3-algd-offline'); }
110+
},
111+
{
112+
dataset: 'dataset3',
113+
trend: 'ALGD-ONLINE RMSE Euclidean Distance',
114+
current: 21,
115+
callback: function () { console.log('dataset3--algd-online'); }
116+
}
117+
],
118+
datasetLabelMap: {
119+
'dataset2': 'rotation',
120+
'dataset1': 'label'
121+
},
122+
datasetMap: {
123+
'dataset3': 'http://www.example.com',
124+
'dataset2': function () { console.log('dataset 2'); }
125+
},
126+
trajectoryMap: {
127+
'dataset0.jpg': function () { console.log('dataset 0 -- trajectory'); },
128+
'dataset1': 'http://www.example.com'
129+
},
130+
agg_trends: [
131+
{
132+
name: 'ALGA 50th percentile RMSE Euclidean Distance',
133+
trend_name: 'ALGA RMSE Euclidean Distance',
134+
// No abbreviation provided.
135+
lower_is_better: true,
136+
warning: 10,
137+
fail: 25,
138+
max: 50,
139+
history: [0.4, 0.5, 0.6, 0.8, 1.2, 0.55, 0.5]
140+
},
141+
{
142+
name: 'ALGASBR 50th percentile RMSE Euclidean Distance',
143+
lower_is_better: true,
144+
trend_name: 'ALGASBR RMSE Euclidean Distance',
145+
abbreviation: 'ALGASBR',
146+
// Lacks a valid threshold definition.
147+
history: [0.4, 0.6, 0.6, 0.8, 1.2, 4, 0.3]
148+
},
149+
// ALGC is left out of agg_trends so it will be synthesized.
150+
{
151+
name: 'ALGD-ONLINE 50th percentile RMSE Euclidean Distance',
152+
lower_is_better: true,
153+
trend_name: 'ALGD-ONLINE RMSE Euclidean Distance',
154+
abbreviation: 'ALGD-ONLINE',
155+
warning: 0.10,
156+
fail: 0.2,
157+
max: 0.5,
158+
history: [0.4, 0.5, 0.6, 0.8, 2.2, 3.1415, 0.18]
159+
},
160+
{
161+
name: 'ALGD-OFFLINE 50th percentile RMSE Euclidean Distance',
162+
lower_is_better: true,
163+
trend_name: 'ALGD-OFFLINE RMSE Euclidean Distance',
164+
// A to force first in the sort order.
165+
abbreviation: 'AALGD-OFFLINE',
166+
warning: 10,
167+
fail: 25,
168+
max: 50,
169+
history: [0.4, 0.45, 0.52, 0.74, 2.4, 2.7, 0.25]
170+
}
171+
],
172+
trends: [
173+
{
174+
name: 'ALGC RMSE Euclidean Distance',
175+
lower_is_better: true,
176+
abbreviation: 'ALGC',
177+
warning: 3,
178+
fail: 4,
179+
max: 5
180+
},
181+
{
182+
name: 'ALGA RMSE Euclidean Distance',
183+
// No abbreviation provided.
184+
lower_is_better: true,
185+
warning: 0.5,
186+
fail: 1,
187+
max: 2
188+
},
189+
{
190+
name: 'ALGASBR RMSE Euclidean Distance',
191+
// Z to force last in the sort order.
192+
lower_is_better: true,
193+
abbreviation: 'ZALGASBR',
194+
warning: 10,
195+
fail: 25,
196+
max: 50
197+
},
198+
{
199+
lower_is_better: true,
200+
name: 'ALGD-OFFLINE RMSE Euclidean Distance',
201+
abbreviation: 'ALGD-OFFLINE',
202+
warning: 10,
203+
fail: 25,
204+
max: 50
205+
},
206+
{
207+
lower_is_better: true,
208+
name: 'ALGD-ONLINE RMSE Euclidean Distance',
209+
abbreviation: 'ALGD-ONLINE',
210+
warning: 10,
211+
fail: 25,
212+
max: 50
213+
}
214+
]
215+
};
216+
217+
var imageProcessingSettings = {
218+
el: '.dash-container',
219+
name: 'Image Processing',
220+
day: '2014-06-03',
221+
submission_uuid: '2d14dd46-0738-11e6-b653-000c29998cff',
222+
branch: 'master',
223+
help_link: 'https://en.wikipedia.org/wiki/Image_processing',
224+
trendValuesByDataset: [{
225+
dataset: 'dataset0',
226+
trend: 'KEYPOINT-MATCHING Precision',
227+
current: 0.75
228+
},
229+
{
230+
dataset: 'dataset0',
231+
trend: 'KEYPOINT-MATCHING Recall',
232+
current: 0.5
233+
},
234+
{
235+
dataset: 'dataset0',
236+
trend: 'RANSAC Precision',
237+
current: 0.3
238+
},
239+
{
240+
dataset: 'dataset0',
241+
trend: 'RANSAC Recall',
242+
current: 0.25
243+
},
244+
{
245+
dataset: 'dataset1',
246+
trend: 'KEYPOINT-MATCHING Precision',
247+
current: 0.85
248+
},
249+
{
250+
dataset: 'dataset1',
251+
trend: 'KEYPOINT-MATCHING Recall',
252+
current: 0.85
253+
},
254+
{
255+
dataset: 'dataset1',
256+
trend: 'RANSAC Precision',
257+
current: 0.5
258+
},
259+
{
260+
dataset: 'dataset1',
261+
trend: 'RANSAC Recall',
262+
current: 0.35
263+
}],
264+
trends: [
265+
{
266+
name: 'KEYPOINT-MATCHING Precision',
267+
abbreviation: 'Matching Precision',
268+
lower_is_better: false,
269+
warning: 0.75,
270+
fail: 0.5,
271+
max: 1
272+
},
273+
{
274+
name: 'KEYPOINT-MATCHING Recall',
275+
abbreviation: 'Matching Recall',
276+
lower_is_better: false,
277+
warning: 0.75,
278+
fail: 0.5,
279+
max: 1.0
280+
},
281+
{
282+
name: 'RANSAC Precision',
283+
lower_is_better: false,
284+
warning: 0.5,
285+
fail: 0.25,
286+
max: 1.0
287+
},
288+
{
289+
name: 'RANSAC Recall',
290+
lower_is_better: false,
291+
warning: 0.75,
292+
fail: 0.5,
293+
max: 1.0
294+
}
295+
],
296+
agg_trends: [
297+
{
298+
trend_name: 'KEYPOINT-MATCHING Precision',
299+
lower_is_better: false,
300+
name: 'KEYPOINT-MATCHING Precision',
301+
abbreviation: 'Matching Precision',
302+
warning: 0.75,
303+
fail: 0.5,
304+
max: 1.0,
305+
history: [0.4, 0.5, 0.6, 0.8, 0.6, 0.75, 0.85]
306+
},
307+
{
308+
trend_name: 'KEYPOINT-MATCHING Recall',
309+
lower_is_better: false,
310+
name: 'KEYPOINT-MATCHING Recall',
311+
abbreviation: 'Matching Recall',
312+
warning: 0.75,
313+
fail: 0.5,
314+
max: 1.0,
315+
// This trend only has one point.
316+
history: [0.85]
317+
},
318+
{
319+
trend_name: 'RANSAC Precision',
320+
lower_is_better: false,
321+
name: 'RANSAC Precision',
322+
warning: 0.5,
323+
fail: 0.25,
324+
max: 1.0,
325+
history: [0.8, 0.75, 0.64, 0.28, 0.69, 0.87, 0.5]
326+
},
327+
{
328+
trend_name: 'RANSAC Recall',
329+
lower_is_better: false,
330+
name: 'RANSAC Recall',
331+
warning: 0.75,
332+
fail: 0.5,
333+
max: 1.0,
334+
history: [0.7, 0.7, 0.86, 0.92, 0.7, 0.72, 0.35]
335+
}
336+
]
337+
};
338+
339+
// Ground truth dataset is default.
340+
var appSettings = betaGroundTruthSettings;
341+
var qParams = window.location.search;
342+
if (qParams) {
343+
qParams = qParams.split('?')[1].split('&');
344+
for (let i = 0; i < qParams.length; i++) {
345+
if (qParams[i] === 'imageProcessing') {
346+
// Replace with imageProcessing dataset.
347+
appSettings = imageProcessingSettings;
348+
}
349+
}
350+
// Perform two separate loops since we set appSettings
351+
// above, which is modified below.
352+
for (let i = 0; i < qParams.length; i++) {
353+
if (qParams[i] === 'omitAggTrends') {
354+
delete appSettings['agg_trends'];
355+
}
356+
if (qParams[i] === 'omitTrends') {
357+
delete appSettings['trends'];
358+
}
359+
if (qParams[i] === 'multipleValues') {
360+
appSettings['trendValuesByDataset'][0]['current'] = [0.1, 0.2, 0.3, 0.5, 0.9, 0.1, 0.5, 0.3, 5.0];
361+
appSettings['trendValuesByDataset'][1]['current'] = [0.1, 0.2, 0.3, 0.5, 0.9, 0.1, 0.5, 0.3, 2.0];
362+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 1]['current'] = [20, 20, 20, 30, 20, 21, 22, 23, 25];
363+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 2]['current'] = [120, 220, 220, 330, 202, 2100, 220, 11, 333];
364+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 3]['current'] = [0.1, 0.52, 0.3];
365+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 3]['current'] = [0.1, 3.2, 0.3];
366+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 8]['current'] = [0.1, 8.2, 10.3];
367+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 13]['current'] = [0.1, 0.2, 0.3];
368+
appSettings['trendValuesByDataset'][appSettings['trendValuesByDataset'].length - 11]['current'] = [99.9];
369+
}
370+
}
371+
}
372+
var app = new TrackerDash(document.body, appSettings);
373+
app.render();

0 commit comments

Comments
 (0)