Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honey pot UI #6039

Merged
merged 362 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
362 commits
Select commit Hold shift + click to select a range
decccb7
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
zhiltsov-max May 11, 2023
00813cd
Fix points matching
zhiltsov-max May 11, 2023
dbc2a48
Rename NORMAL to ANNOTATION job type
zhiltsov-max May 12, 2023
533ef8d
Add frame results in the task report
zhiltsov-max May 12, 2023
dbfd59a
Handle the case with no matches
zhiltsov-max May 12, 2023
b3144ff
added raw conflict frame filter
klakhov May 12, 2023
3fb345e
changed job type to normal
klakhov May 12, 2023
c7963f9
Add annotation links in the downloaded report
zhiltsov-max May 12, 2023
7103954
Merge commit 'b3144ff' into zm/gt-jobs
zhiltsov-max May 12, 2023
c5d7163
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
zhiltsov-max May 12, 2023
b76d93c
Revert "changed job type to normal"
zhiltsov-max May 12, 2023
eca2319
Fix frame share values in reports
zhiltsov-max May 12, 2023
15bcac7
Extract quality to a separate app, add migrations and settings
zhiltsov-max May 16, 2023
6f93200
Add an option to set quality check delay via env vars
zhiltsov-max May 16, 2023
2f4a138
Refactor rqscheduler script and fix pylint
zhiltsov-max May 16, 2023
e6a4c55
Disable quality reports for 3d tasks
zhiltsov-max May 17, 2023
7e0dca7
Add conflict distribution by type info in the report and general info
zhiltsov-max May 17, 2023
66fb920
Fix operation naming in schema
zhiltsov-max May 17, 2023
9e82b30
Merge branch 'develop' into zm/gt-jobs
klakhov May 18, 2023
ceefdf4
updated create job form
klakhov May 18, 2023
29678f9
added analytics title
klakhov May 18, 2023
d5fc9aa
updated mean accuracy card
klakhov May 18, 2023
d90a1c0
Update test assets
zhiltsov-max May 18, 2023
e8b4d4f
Update gt job creation tests
zhiltsov-max May 18, 2023
177a580
Make quality_settings field optional in the responses
zhiltsov-max May 18, 2023
ee1bbf1
Fix migration
zhiltsov-max May 18, 2023
bd8cb30
Fix time comparison
zhiltsov-max May 18, 2023
73d3692
Fix summary fields in create responses, avoid races
zhiltsov-max May 18, 2023
98f6278
Avoid quality report updates in tests
zhiltsov-max May 18, 2023
421fcf5
Add tests for quality endpoints
zhiltsov-max May 18, 2023
ac6aa97
Format code
zhiltsov-max May 18, 2023
7ccf16d
added gt conflicts card
klakhov May 19, 2023
f410a84
added issues card
klakhov May 19, 2023
1f12173
Add more quality tests
zhiltsov-max May 19, 2023
2aa1eee
updated analytics utility functions
klakhov May 19, 2023
ac4e56f
added quality reports hint
klakhov May 19, 2023
8f519cb
updated job card
klakhov May 19, 2023
17b2783
added ability to delete jobs
klakhov May 19, 2023
819d347
improved job card on smaller screens
klakhov May 19, 2023
c11d2a6
added empty job card
klakhov May 19, 2023
c7cbaf8
Merge branch 'zm/gt-jobs' of https://github.com/cvat-ai/cvat into zm/…
klakhov May 19, 2023
5d536dc
Add quality reports creation endpoint
zhiltsov-max May 19, 2023
7aa9027
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
zhiltsov-max May 19, 2023
994a3de
Fix report computation
zhiltsov-max May 19, 2023
54f15e2
Allow optional request body, fix some apis schema
zhiltsov-max May 19, 2023
f488734
Add tests for report creation by request
zhiltsov-max May 19, 2023
98a2ff4
Revert some changes in api
zhiltsov-max May 19, 2023
57231df
Fix list test
zhiltsov-max May 19, 2023
6f07b83
Fix set intersection
zhiltsov-max May 19, 2023
37c3dc8
improved tooltips
klakhov May 20, 2023
546154a
updated table to new design, added sorting
klakhov May 20, 2023
bb8c0d8
updated adaptive job card
klakhov May 20, 2023
63b24fc
added quality settings
klakhov May 20, 2023
6d750fe
updated job item
klakhov May 21, 2023
4e3f2e7
refactored job list, added filtering/sorting
klakhov May 21, 2023
3195f6d
added type filter
klakhov May 21, 2023
c8da689
added colors to conflicts, conflict position
klakhov May 21, 2023
1f04dd3
moved switch to objects sidebar
klakhov May 21, 2023
20f15b1
refactored issues view
klakhov May 21, 2023
3d6340a
changed tasks breakpoints
klakhov May 21, 2023
3186001
improved issue first comment
klakhov May 21, 2023
66be4d0
added conflicts to sidebar
klakhov May 21, 2023
e96889e
added highlight feature
klakhov May 21, 2023
8a4a8dc
activate object from conflict
klakhov May 21, 2023
99bb87c
make inactive conflicts darker
klakhov May 21, 2023
56be78f
fixed show gt annotations position
klakhov May 21, 2023
8e16eeb
fixed scaling problem
klakhov May 21, 2023
6476cf4
added icon to issue sidebar
klakhov May 22, 2023
291b499
added colors to warnings
klakhov May 22, 2023
db8286b
show gt icon only in review workspace
klakhov May 22, 2023
7046c0a
fixed multiple objects highlight
klakhov May 22, 2023
efd76d9
Check quality after settings updated
zhiltsov-max May 22, 2023
56cfbe0
Improve settings dialog layout
zhiltsov-max May 22, 2023
54c4025
Fix several UI failures
zhiltsov-max May 22, 2023
b42a29a
Init quality settings on job creation
zhiltsov-max May 22, 2023
2958aac
Add settings patching tests
zhiltsov-max May 22, 2023
69d0643
Add more permission tests for endpoints
zhiltsov-max May 22, 2023
3ee41e6
Fix frame count display
zhiltsov-max May 23, 2023
1b54265
Add report content tests
zhiltsov-max May 23, 2023
6aa931f
Extend job result ttl, remove debug endpoint
zhiltsov-max May 24, 2023
9be819c
Remove comparison script
zhiltsov-max May 24, 2023
637841b
Polish quality tests
zhiltsov-max May 24, 2023
bb1c107
Fix frame naming in interpolation tasks
zhiltsov-max May 25, 2023
674ba56
Add draft solution for frame skips in chunks
zhiltsov-max May 25, 2023
412603c
Fix job removal
zhiltsov-max May 25, 2023
8c56cea
Polish some code
zhiltsov-max May 25, 2023
6ee3974
Add gt job data tests
zhiltsov-max May 26, 2023
bdfe614
Add squashed migration
zhiltsov-max May 26, 2023
ea8331a
Replace squashed migrations
zhiltsov-max May 26, 2023
8ee0000
Merge branch 'develop' into zm/gt-jobs
zhiltsov-max May 26, 2023
226e8b5
Fix quality settings defaults installation
zhiltsov-max May 26, 2023
da50bf5
Fix pylint messages
zhiltsov-max May 26, 2023
140105e
Merge branch 'develop' into zm/gt-jobs
zhiltsov-max May 26, 2023
8ffab84
Fix task mode in tasks from backup
zhiltsov-max May 26, 2023
504b4c0
Support drf-spectacular 0.26.2
zhiltsov-max May 26, 2023
d2eee3f
Merge test assets
zhiltsov-max May 26, 2023
25f61c4
Remove UI changes
zhiltsov-max May 26, 2023
56c27a2
Merge branch 'develop' into zm/gt-jobs
zhiltsov-max May 26, 2023
35d1918
Fix remaining places with org_id query params
zhiltsov-max May 26, 2023
b6117bd
Fix merge
zhiltsov-max May 26, 2023
76e2942
Fix some permission problems
zhiltsov-max May 26, 2023
6cd3dc3
Merge branch 'zm/gt-jobs' into zm/honey-pot-server
zhiltsov-max May 26, 2023
fa34b76
Drop ui changes
zhiltsov-max May 26, 2023
50c695e
Fix access permissions
zhiltsov-max May 29, 2023
6766e8a
Fix an error arising in rq worker debugging
zhiltsov-max May 29, 2023
484b75a
Move test setting declaration
zhiltsov-max May 29, 2023
32f80b1
Fix access permissions
zhiltsov-max May 29, 2023
7a0bbff
Fix an error arising in rq worker debugging
zhiltsov-max May 29, 2023
9294e9b
Move test setting declaration
zhiltsov-max May 29, 2023
6ccbff7
Add settings list endpoint
zhiltsov-max May 30, 2023
ded60d9
Update schema
zhiltsov-max May 30, 2023
fc7fa37
Fix CI
zhiltsov-max May 30, 2023
731c4f0
Add quality settings list endpoint
zhiltsov-max May 30, 2023
d4e0e47
Merge branch 'zm/gt-jobs' into zm/honey-pot-server
zhiltsov-max May 30, 2023
7434d48
Fix CI
zhiltsov-max May 30, 2023
b5331af
Merge branch 'zm/gt-jobs' into zm/honey-pot-server
zhiltsov-max May 30, 2023
3de9f6b
Fix interpolation tests
zhiltsov-max May 30, 2023
66c6474
Revert change for outside shapes
zhiltsov-max May 30, 2023
ce82601
Fix track merging
zhiltsov-max May 30, 2023
b3fcd51
Merge branch 'zm/gt-jobs' into zm/honey-pot-server
zhiltsov-max May 30, 2023
88ed6d8
Fix test requirements
zhiltsov-max May 31, 2023
0d7e59f
Merge branch 'zm/gt-jobs' into zm/honey-pot-server
zhiltsov-max May 31, 2023
0c5a6e5
Update frame shape percent
zhiltsov-max Jun 1, 2023
7151ddc
Add field descriptions in the quality settings api
zhiltsov-max Jun 1, 2023
a7b3ef3
Merge branch 'develop' into zm/gt-jobs
zhiltsov-max Jun 1, 2023
af9b951
removed dash from conflicted annotations
klakhov Jun 1, 2023
d57e561
fixed settings requests
klakhov Jun 1, 2023
14875d2
Update wrt iam changes
zhiltsov-max Jun 1, 2023
ebd6061
Merge branch 'zm/gt-jobs' into zm/honey-pot-server
zhiltsov-max Jun 1, 2023
0a291a5
Implement asgi server debugging
zhiltsov-max Jun 1, 2023
3416e87
Clear data cache
zhiltsov-max Jun 1, 2023
62a0247
Implement asgi server debugging
zhiltsov-max Jun 1, 2023
2179fb2
Clear data cache
zhiltsov-max Jun 1, 2023
3520d94
Fix frame range in job meta and ui handling
zhiltsov-max Jun 1, 2023
4d79aa3
Merge branch 'zm/gt-jobs' of https://github.com/cvat-ai/cvat into zm/…
klakhov Jun 2, 2023
cb17f54
removed description from task page
klakhov Jun 2, 2023
97871ae
Add helm config for quality reports worker
zhiltsov-max Jun 2, 2023
df24201
Fix frame range in job meta and ui handling
zhiltsov-max Jun 1, 2023
7a5301c
updated navigation
klakhov Jun 2, 2023
b11fe90
fixed job updated date
klakhov Jun 2, 2023
aac7b81
updated confclits tooltip and table col
klakhov Jun 2, 2023
3618a61
updated quality reports hint text
klakhov Jun 2, 2023
eee12b6
Merge branch 'zm/gt-jobs' of https://github.com/cvat-ai/cvat into zm/…
klakhov Jun 2, 2023
620ea2e
fix name
zhiltsov-max Jun 2, 2023
0720625
Fix comments
zhiltsov-max Jun 2, 2023
0d18320
fixed statistics module
klakhov Jun 2, 2023
086cb53
reverted frame filter changes
klakhov Jun 2, 2023
ba3b1ee
updated quality report names
klakhov Jun 2, 2023
203a135
added tooltips to settings
klakhov Jun 2, 2023
3aaba28
Add more tests
zhiltsov-max Jun 2, 2023
04604d7
Merge branch 'develop' into zm/honey-pot-server
zhiltsov-max Jun 2, 2023
a708cb9
Rename worker in helm
zhiltsov-max Jun 2, 2023
bdfe70b
Fix formatting
zhiltsov-max Jun 2, 2023
0a84f76
Update rqscheduler to use asgi
zhiltsov-max Jun 5, 2023
58e8fa9
Apply suggestions from code review
zhiltsov-max Jun 5, 2023
3257cd6
Remove extra permission checks
zhiltsov-max Jun 5, 2023
866f626
Merge branch 'develop' into zm/honey-pot-server
zhiltsov-max Jun 5, 2023
9bc966f
Fix method
zhiltsov-max Jun 5, 2023
11db795
Fix script name
zhiltsov-max Jun 5, 2023
d80ee00
changed conflict highlight, reworked aggregation
klakhov Jun 6, 2023
12856df
removed unused code, fixed comments
klakhov Jun 6, 2023
f4423d9
Enable code formatting for the quality control app
zhiltsov-max Jun 6, 2023
b66a296
renamed `frame_meta` to `frameMeta`
klakhov Jun 6, 2023
8f78184
Merge branch 'zm/honey-pot-server' of https://github.com/cvat-ai/cvat…
klakhov Jun 6, 2023
e4bd960
Fix python linters
zhiltsov-max Jun 6, 2023
f5d3fa0
Merge remote-tracking branch 'origin/zm/honey-pot-server' into zm/hon…
zhiltsov-max Jun 6, 2023
c2735d3
Merge branch 'develop' into zm/gt-jobs
zhiltsov-max Jun 6, 2023
02e0a13
Merge server changes from branch 'zm/honey-pot-server' into zm/gt-jobs
zhiltsov-max Jun 6, 2023
b2d6682
fixed deleted frames navigation
klakhov Jun 7, 2023
b853e2b
fixed overlap test
klakhov Jun 7, 2023
de7fb4a
fixed job asignee and job stage
klakhov Jun 7, 2023
231a25c
fixed changing state of job
klakhov Jun 7, 2023
2fb04fc
fixed skeletons test
klakhov Jun 7, 2023
9d06efb
fixed eslint
klakhov Jun 7, 2023
d2333c6
fixed links in tests
klakhov Jun 7, 2023
5c76068
fixed unit tests
klakhov Jun 7, 2023
05b9fa0
Remove query params with no values from schema
zhiltsov-max Jun 7, 2023
ee3891f
Improve some descriptions in api
zhiltsov-max Jun 7, 2023
87782cc
Rename importance to severity
zhiltsov-max Jun 7, 2023
cf4a4f3
Update some descriptions
zhiltsov-max Jun 7, 2023
732bb18
Update tests
zhiltsov-max Jun 7, 2023
1d309d7
Update tests
zhiltsov-max Jun 7, 2023
2fc2c27
Update changelog
zhiltsov-max Jun 7, 2023
bd23e22
Rename line orientation parameter
zhiltsov-max Jun 7, 2023
6bd00c6
Update frame share percent
zhiltsov-max Jun 7, 2023
990efdc
Merge branch 'zm/honey-pot-server' into zm/gt-jobs
zhiltsov-max Jun 7, 2023
cc8ec35
Update ui after api changes
zhiltsov-max Jun 7, 2023
230efd8
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
zhiltsov-max Jun 7, 2023
71f7bfd
Fix schema
zhiltsov-max Jun 7, 2023
a4c0e9b
updated job actions menu
klakhov Jun 8, 2023
7147ed1
Don't remove frame_share from report data
zhiltsov-max Jun 8, 2023
5075c2b
fixed dashes on ground truth skeletons
klakhov Jun 8, 2023
17fad17
Remove parameters from reports list
zhiltsov-max Jun 8, 2023
27dcfd6
Use condensed db repr for report data, disjoint ann_id.type,
zhiltsov-max Jun 8, 2023
ea3cbc3
Fix schema
zhiltsov-max Jun 8, 2023
5d5985d
Merge branch 'develop' into zm/honey-pot-server
zhiltsov-max Jun 8, 2023
67b943b
Update migrations
zhiltsov-max Jun 8, 2023
3b1a60d
Merge branch 'zm/honey-pot-server' into zm/gt-jobs
zhiltsov-max Jun 8, 2023
2a8752e
reworked `case_69` filtering_sorting_jobs
klakhov Jun 8, 2023
e548da0
Update ui
zhiltsov-max Jun 8, 2023
e3dc63b
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
zhiltsov-max Jun 8, 2023
0278c03
fixed create issue from conflict
klakhov Jun 9, 2023
85a5ddf
improved state & stage tip on analytics page
klakhov Jun 9, 2023
60ca387
Merge branch 'zm/gt-jobs' of https://github.com/cvat-ai/cvat into zm/…
klakhov Jun 9, 2023
4b7dd3a
added copy object from gt to normal job
klakhov Jun 9, 2023
3748d3f
activate main conflict, disable activation of others
klakhov Jun 9, 2023
0999497
Fix lambda function runs on job a frame
zhiltsov-max Jun 9, 2023
ce00104
Merge branch 'develop' into zm/honey-pot-server
zhiltsov-max Jun 9, 2023
080fa8e
Merge migrations
zhiltsov-max Jun 9, 2023
8a4ed6c
Fix gt job frames in complex setups
zhiltsov-max Jun 9, 2023
f80fbe0
Fix stop_frame
zhiltsov-max Jun 9, 2023
0e122a9
Merge branch 'develop' into zm/honey-pot-server
zhiltsov-max Jun 12, 2023
74edcaf
Merge branch 'zm/honey-pot-server' into zm/gt-jobs
zhiltsov-max Jun 12, 2023
3777316
Merge remote-tracking branch 'origin/zm/gt-jobs' into zm/gt-jobs
zhiltsov-max Jun 12, 2023
8a72d2b
Merge branch 'develop' into zm/gt-jobs
zhiltsov-max Jun 12, 2023
0daced7
changed aligns on task page
klakhov Jun 14, 2023
e57b409
fixed job item styles
klakhov Jun 14, 2023
fcae9fa
fixed filtering by updated date
klakhov Jun 14, 2023
a727cdc
returned copy feature
klakhov Jun 14, 2023
f6183a8
fixed frame count percent
klakhov Jun 14, 2023
b1a55fd
fixed sorting in quality job list
klakhov Jun 14, 2023
ec933d0
Merge branch 'zm/gt-jobs' of https://github.com/cvat-ai/cvat into zm/…
klakhov Jun 14, 2023
bd84ed6
removed list from gt anno, fixed higlight
klakhov Jun 14, 2023
e6d3d0d
fixed opening gt job
klakhov Jun 14, 2023
fc3af2b
gt tracks shown only on gt job frames
klakhov Jun 14, 2023
5faf945
unified annotation filter
klakhov Jun 15, 2023
a46df53
fixed issue highlight
klakhov Jun 15, 2023
01f86fd
fixed array operations
klakhov Jun 19, 2023
290634a
Renamed Raw to Serialized
klakhov Jun 19, 2023
9ba5934
fixed navigation with deleted frames
klakhov Jun 21, 2023
a136a86
fixed height on quality page
klakhov Jun 21, 2023
96090f2
reworked cvat-core classes
klakhov Jun 21, 2023
55c535d
removed !important
klakhov Jun 21, 2023
6c3ad26
fixed intersecting ids in conflicts/server-ids
klakhov Jun 21, 2023
39764f8
removed ablity to delete frame from GT
klakhov Jun 21, 2023
442050d
updated chanelog
klakhov Jun 21, 2023
614f3c7
Merge branch 'develop' into zm/gt-jobs
klakhov Jun 21, 2023
109cd7a
applied comments
klakhov Jun 21, 2023
4bb0003
fixed potential performance issue
klakhov Jun 22, 2023
98cf03b
Merge branch 'develop' into zm/gt-jobs
klakhov Jun 22, 2023
cf91dcb
fixed unit test
klakhov Jun 22, 2023
27a1861
applied comments
klakhov Jun 22, 2023
821c456
fixed more comments
klakhov Jun 22, 2023
65d6713
renamed `ready` variable
klakhov Jun 22, 2023
ff76c64
removed outdated code, removed submit and open
klakhov Jun 23, 2023
8c8e2a8
Merge branch 'develop' into zm/gt-jobs
klakhov Jun 23, 2023
7ae3b93
fixed merge error
klakhov Jun 23, 2023
0908914
fixed eslint
klakhov Jun 23, 2023
33dd488
fixed styles and report time
klakhov Jun 23, 2023
4775e3f
improved highlight styles
klakhov Jun 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Now CVAT supports project/task markdown description with additional assets
(png, jpeg, gif, webp images and pdf files) (<https://github.com/opencv/cvat/pull/6191>)
- Ground Truth jobs and quality analytics for tasks (<https://github.com/opencv/cvat/pull/6039>)


### Changed
- TDB
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "2.16.7",
"version": "2.17.0",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
77 changes: 77 additions & 0 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,46 @@ polyline.cvat_canvas_shape_splitting {
stroke-dasharray: 5;
}

.cvat_canvas_ground_truth {
stroke-dasharray: 1;
}

.cvat_canvas_conflicted {
stroke: #ff4800;
fill: #ff4800;

rect,
ellipse,
polygon,
polyline,
line {
fill: #ff4800;
stroke: #ff4800;
}

circle {
fill: #ff4800;
}
}

.cvat_canvas_warned {
stroke: #ff7301;
fill: #ff7301;

rect,
ellipse,
polygon,
polyline,
line {
fill: #ff7301;
stroke: #ff7301;
}

circle {
fill: #ff7301;
}
}

.cvat_canvas_shape_occluded_point {
stroke-dasharray: 1 !important;
stroke: white;
Expand Down Expand Up @@ -298,6 +338,38 @@ g.cvat_canvas_shape_occluded {
position: relative;
}

.cvat-canvas-highlight-enabled {
svg {
>rect:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned),
>ellipse:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned),
>polygon:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned),
>polyline:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned),
>line:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned) {
fill: gray;
stroke: gray;
}

>circle:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned) {
fill: gray;
}

>g:not(.cvat_canvas_issue_region,.cvat_canvas_conflicted,.cvat_canvas_warned) {
rect,
ellipse,
polygon,
polyline,
line {
fill: gray;
stroke: gray;
}

circle {
fill: gray;
}
}
}
}

#cvat_canvas_text_content {
text-rendering: optimizeSpeed;
position: absolute;
Expand Down Expand Up @@ -380,3 +452,8 @@ g.cvat_canvas_shape_occluded {
stroke: #09c;
}
}

.cvat_canvas_shape_darken {
fill: #838383;
stroke: #838383;
}
14 changes: 13 additions & 1 deletion cvat-canvas/src/typescript/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
CuboidDrawingMethod,
Configuration,
Geometry,
HighlightSeverity as _HighlightSeverity,
} from './canvasModel';
import { Master } from './master';
import { CanvasController, CanvasControllerImpl } from './canvasController';
Expand All @@ -32,7 +33,9 @@ interface Canvas {
html(): HTMLDivElement;
setup(frameData: any, objectStates: any[], zLayer?: number): void;
setupIssueRegions(issueRegions: Record<number, { hidden: boolean; points: number[] }>): void;
activate(clientID: number | null, attributeID?: number): void;
setupConflictRegions(clientID: number): number[];
activate(clientID: number | null, attributeID?: number): number[];
highlight(clientIDs: number[] | null, severity: HighlightSeverity | null): void;
rotate(rotationAngle: number): void;
focus(clientID: number, padding?: number): void;
fit(): void;
Expand Down Expand Up @@ -84,6 +87,10 @@ class CanvasImpl implements Canvas {
this.model.setupIssueRegions(issueRegions);
}

public setupConflictsRegions(clientID: number): number[] {
return this.view.setupConflictsRegions(clientID);
}

public fitCanvas(): void {
this.model.fitCanvas(this.view.html().clientWidth, this.view.html().clientHeight);
}
Expand All @@ -108,6 +115,10 @@ class CanvasImpl implements Canvas {
this.model.activate(clientID, attributeID);
}

public highlight(clientIDs: number[] | null, severity: HighlightSeverity | null = null): void {
this.model.highlight(clientIDs, severity);
}

public rotate(rotationAngle: number): void {
this.model.rotate(rotationAngle);
}
Expand Down Expand Up @@ -179,6 +190,7 @@ class CanvasImpl implements Canvas {

export type InteractionData = _InteractionData;
export type InteractionResult = _InteractionResult;
export type HighlightSeverity = _HighlightSeverity;

export {
CanvasImpl as Canvas, CanvasVersion, RectDrawingMethod, CuboidDrawingMethod, Mode as CanvasMode,
Expand Down
6 changes: 6 additions & 0 deletions cvat-canvas/src/typescript/canvasController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
InteractionData,
Configuration,
MasksEditData,
HighlightedElements,
} from './canvasModel';

export interface CanvasController {
Expand All @@ -25,6 +26,7 @@ export interface CanvasController {
readonly zLayer: number | null;
readonly focusData: FocusData;
readonly activeElement: ActiveElement;
readonly highlightedElements: HighlightedElements;
readonly drawData: DrawData;
readonly editData: MasksEditData;
readonly interactionData: InteractionData;
Expand Down Expand Up @@ -147,6 +149,10 @@ export class CanvasControllerImpl implements CanvasController {
return this.model.activeElement;
}

public get highlightedElements(): HighlightedElements {
return this.model.highlightedElements;
}

public get drawData(): DrawData {
return this.model.drawData;
}
Expand Down
44 changes: 44 additions & 0 deletions cvat-canvas/src/typescript/canvasModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ export interface ActiveElement {
attributeID: number | null;
}

export enum HighlightSeverity {
ERROR = 'error',
WARNING = 'warning',
}

export interface HighlightedElements {
elementsIDs: number [];
severity: HighlightSeverity;
}

export enum RectDrawingMethod {
CLASSIC = 'By 2 points',
EXTREME_POINTS = 'By 4 points',
Expand All @@ -68,6 +78,7 @@ export interface Configuration {
textContent?: string;
undefinedAttrValue?: string;
showProjections?: boolean;
showConflicts?: boolean;
forceDisableEditing?: boolean;
intelligentPolygonCrop?: boolean;
forceFrameUpdate?: boolean;
Expand Down Expand Up @@ -168,6 +179,7 @@ export enum UpdateReasons {
OBJECTS_UPDATED = 'objects_updated',
SHAPE_ACTIVATED = 'shape_activated',
SHAPE_FOCUSED = 'shape_focused',
SHAPE_HIGHLIGHTED = 'shape_highlighted',

FITTED_CANVAS = 'fitted_canvas',

Expand Down Expand Up @@ -213,6 +225,7 @@ export interface CanvasModel {
readonly gridSize: Size;
readonly focusData: FocusData;
readonly activeElement: ActiveElement;
readonly highlightedElements: HighlightedElements;
readonly drawData: DrawData;
readonly editData: MasksEditData;
readonly interactionData: InteractionData;
Expand All @@ -231,6 +244,7 @@ export interface CanvasModel {
setup(frameData: any, objectStates: any[], zLayer: number): void;
setupIssueRegions(issueRegions: Record<number, { hidden: boolean; points: number[] }>): void;
activate(clientID: number | null, attributeID: number | null): void;
highlight(clientIDs: number[] | null, severity: HighlightSeverity): void;
rotate(rotationAngle: number): void;
focus(clientID: number, padding: number): void;
fit(): void;
Expand Down Expand Up @@ -303,6 +317,7 @@ function disableInternalSVGDrawing(data: DrawData | MasksEditData, currentData:
export class CanvasModelImpl extends MasterImpl implements CanvasModel {
private data: {
activeElement: ActiveElement;
highlightedElements: HighlightedElements;
angle: number;
canvasSize: Size;
configuration: Configuration;
Expand Down Expand Up @@ -340,6 +355,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
clientID: null,
attributeID: null,
},
highlightedElements: {
elementsIDs: [],
severity: null,
},
angle: 0,
canvasSize: {
height: 0,
Expand All @@ -350,6 +369,7 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
autoborders: false,
displayAllText: false,
showProjections: false,
showConflicts: false,
forceDisableEditing: false,
intelligentPolygonCrop: false,
forceFrameUpdate: false,
Expand Down Expand Up @@ -584,6 +604,22 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
this.notify(UpdateReasons.SHAPE_ACTIVATED);
}

public highlight(clientIDs: number[] | null, severity: HighlightSeverity | null): void {
if (Array.isArray(clientIDs)) {
this.data.highlightedElements = {
elementsIDs: clientIDs,
severity,
};
} else {
this.data.highlightedElements = {
elementsIDs: [],
severity: null,
};
}

this.notify(UpdateReasons.SHAPE_HIGHLIGHTED);
}

public rotate(rotationAngle: number): void {
if (this.data.angle !== rotationAngle && !this.data.imageIsDeleted) {
this.data.angle = (360 + Math.floor(rotationAngle / 90) * 90) % 360;
Expand Down Expand Up @@ -857,6 +893,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
this.data.configuration.colorBy = configuration.colorBy;
}

if (typeof configuration.showConflicts === 'boolean') {
this.data.configuration.showConflicts = configuration.showConflicts;
}

if (typeof configuration.CSSImageFilter === 'string') {
this.data.configuration.CSSImageFilter = configuration.CSSImageFilter;
}
Expand Down Expand Up @@ -955,6 +995,10 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
return { ...this.data.activeElement };
}

public get highlightedElements(): HighlightedElements {
return { ...this.data.highlightedElements };
}

public get drawData(): DrawData {
return { ...this.data.drawData };
}
Expand Down
Loading