Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
quiver-frontend-local
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
subugoe
OCR-D
quiver-frontend-local
Commits
9a306c5c
Commit
9a306c5c
authored
2 years ago
by
Paul Pestov
Browse files
Options
Downloads
Patches
Plain Diff
Add dynamic evals color calculation for cer and wall time
parent
ebb4c572
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Workflows.vue
+3
-0
3 additions, 0 deletions
src/components/Workflows.vue
src/helpers/eval-colors.js
+41
-5
41 additions, 5 deletions
src/helpers/eval-colors.js
with
44 additions
and
5 deletions
src/components/Workflows.vue
+
3
−
0
View file @
9a306c5c
...
@@ -15,6 +15,7 @@ import { useRouter, useRoute } from "vue-router";
...
@@ -15,6 +15,7 @@ import { useRouter, useRoute } from "vue-router";
import
WorkflowsList
from
"
@/components/workflows/WorkflowsList.vue
"
;
import
WorkflowsList
from
"
@/components/workflows/WorkflowsList.vue
"
;
import
WorkflowsTable
from
"
@/components/workflows/WorkflowsTable.vue
"
;
import
WorkflowsTable
from
"
@/components/workflows/WorkflowsTable.vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
setEvalColors
}
from
"
../helpers/eval-colors
"
;
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
...
@@ -40,6 +41,8 @@ onMounted(async () => {
...
@@ -40,6 +41,8 @@ onMounted(async () => {
data
.
value
=
await
api
.
getWorkflows
();
data
.
value
=
await
api
.
getWorkflows
();
defs
.
value
=
await
api
.
getEvalDefinitions
();
defs
.
value
=
await
api
.
getEvalDefinitions
();
setEvalColors
(
data
.
value
);
const
filtered
=
options
.
value
.
filter
((
option
)
=>
{
const
filtered
=
options
.
value
.
filter
((
option
)
=>
{
return
route
.
query
.
view
&&
route
.
query
.
view
===
option
.
value
;
return
route
.
query
.
view
&&
route
.
query
.
view
===
option
.
value
;
});
});
...
...
This diff is collapsed.
Click to expand it.
src/helpers/eval-colors.js
+
41
−
5
View file @
9a306c5c
const
evalColors
=
{
import
{
ref
}
from
'
vue
'
;
const
evalColors
=
ref
({
wall_time
:
{
wall_time
:
{
'
eval-low
'
:
2000
,
'
eval-low
'
:
2000
,
'
eval-medium
'
:
4000
,
'
eval-medium
'
:
4000
,
...
@@ -14,10 +16,10 @@ const evalColors = {
...
@@ -14,10 +16,10 @@ const evalColors = {
'
eval-medium
'
:
0.8
,
'
eval-medium
'
:
0.8
,
'
eval-high
'
:
0.9
'
eval-high
'
:
0.9
}
}
};
}
)
;
const
getEvalColor
=
(
name
,
value
)
=>
{
const
getEvalColor
=
(
name
,
value
)
=>
{
const
colorMap
=
evalColors
[
name
];
const
colorMap
=
evalColors
.
value
[
name
];
if
(
colorMap
)
{
if
(
colorMap
)
{
const
keys
=
Object
.
keys
(
colorMap
);
const
keys
=
Object
.
keys
(
colorMap
);
return
keys
.
find
((
key
,
i
)
=>
{
return
keys
.
find
((
key
,
i
)
=>
{
...
@@ -28,6 +30,40 @@ const getEvalColor = (name, value) => {
...
@@ -28,6 +30,40 @@ const getEvalColor = (name, value) => {
return
null
;
return
null
;
};
};
const
setEvalColors
=
(
data
)
=>
{
const
allCERs
=
[];
const
allWallTimes
=
[];
data
.
forEach
(({
evaluation
})
=>
{
const
{
document_wide
:
evals
}
=
evaluation
;
const
{
cer
,
wall_time
,
cer_min_max
}
=
evals
;
if
(
cer
)
allCERs
.
push
(
cer
);
if
(
wall_time
)
allWallTimes
.
push
(
wall_time
);
});
const
minCER
=
Math
.
min
(...
allCERs
);
const
maxCER
=
Math
.
max
(...
allCERs
);
const
minWallTime
=
Math
.
min
(...
allWallTimes
);
const
maxWallTime
=
Math
.
max
(...
allWallTimes
);
const
diffCER
=
maxCER
-
minCER
;
const
stepCER
=
diffCER
/
3
;
evalColors
.
value
.
cer
[
"
eval-low
"
]
=
minCER
+
stepCER
;
evalColors
.
value
.
cer
[
"
eval-medium
"
]
=
minCER
+
2
*
stepCER
;
evalColors
.
value
.
cer
[
"
eval-high
"
]
=
minCER
+
3
*
stepCER
;
const
diffallTime
=
maxWallTime
-
minWallTime
;
const
stepWallTime
=
diffallTime
/
3
;
evalColors
.
value
.
wall_time
[
"
eval-low
"
]
=
minWallTime
+
stepWallTime
;
evalColors
.
value
.
wall_time
[
"
eval-medium
"
]
=
minWallTime
+
2
*
stepWallTime
;
evalColors
.
value
.
wall_time
[
"
eval-high
"
]
=
minWallTime
+
3
*
stepWallTime
;
};
export
{
export
{
getEvalColor
getEvalColor
,
};
setEvalColors
\ No newline at end of file
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment