Skip to content

Commit

Permalink
[Dependent] Simple Review Pipeline (Client) (#2357)
Browse files Browse the repository at this point in the history
* tmp

* Removed migration

* Rebased

* Added signals & rating

* Updated API views

* Added reviewer serializer

* Added permissions

* Fixed some code issues

* Fixed swagger docs

* Some fixes

* Updated api method to create review

* Added some API tests & some fixes

* Added some tests

* Removed extra code

* cvat-core, basic review view

* Removed extra components

* Fixed context menu

* Added api method to canvas, removed extra files

* Implemented roi selection

* Added method to display rois on canvas

* Updated README.md

* Create issue dialog, some fixes

* Setup chat dialog windows

* Code refactoring

* Some fixes

* Small enhancement

* Fixed core tests, removed extra code

* A couple of fixes on canvas

* Canvas issues highlighting

* Small UX fix

* Fixed width of chat

* Code refactoring

* Added dialogs & review summary

* Fixed tests

* Fixed bug during rendering

* Applied changes from client part

* Fixed bugs in tests

* Added docs & setup plugins in cvat-core

* Aborted cypress changes

* Fixed comments

* Removed extra change

* Renamed fields

* Updated versions, fixed some comments

* Merged develop

* Merged develop

* Removed extra changes

* Removed extra changes

* Fixed tests

* Fixed scale & animation

* Using hull instead of the whole set of points

* Fixed minor issue

* Added additional logic to improve UX

* Updated task instance after review submitting

* Removed extra dependenci from package lock

* Fixed REST API test

* Removed /comments/<id> [PUT]

* /issue/comments/create [POST] -> /comments [POST]

* /job/<id>/reviews/create [POST] -> /reviews [POST]

* [PATCH] /issue/<id>/resolve(reopen) -> [PATCH] /issue/id

* Minor fix

* Updated till the latest REST APi

* Fixed test

* Reviewed review summary

* Review summary client-side

* Removed unused import

* Checking permissions client side

* Checking job permissions

* UP issue dialog onmouseout

* Added shadow & pressenter event

* Added ref initial value

* Using the same box shadow in the whole project

* Removed extra files in the patch

* Removed extra files in the patch

* Updated versions

* Updated changelog

* Fixed merge issue

* Set updated flag on changing a reviewer

* Fixed submit review modal

* Two minor issue fixed

* Searching issues & additional sidebar tab

* Show text for locked objects

* Fixed permissions for reviewers

* Fixed typos

* Fixed review request/submit actions, added action to finish a job

* Star rating instead

* Fixed migration

* Removed animation, updated blur/highlight behaviour, updated hiddel labels position

* Hide/show issues button, adjusted header

* Context menu & buttons

* Removed ability to select an object in region selector

* Do not show issues in AAM & tag annotation

* Fixed jest tests

* Fixed: cannot read property label of undefined

* Getting hull before creating the issue

* Added ability to leave quick comment one of latest

Co-authored-by: Nikita Manovich <nikita.manovich@intel.com>
  • Loading branch information
Boris Sekachev and Nikita Manovich committed Dec 1, 2020
1 parent 45e2ea0 commit d6ac8cc
Show file tree
Hide file tree
Showing 87 changed files with 5,171 additions and 1,062 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Manual review pipeline: issues/comments/workspace (<https://github.com/openvinotoolkit/cvat/pull/2357>)
- Added basic projects implementation (<https://github.com/openvinotoolkit/cvat/pull/2255>)

### Changed
Expand Down
67 changes: 40 additions & 27 deletions cvat-canvas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ Canvas itself handles:
IDLE = 'idle',
DRAG = 'drag',
RESIZE = 'resize',
INTERACT = 'interact',
DRAW = 'draw',
EDIT = 'edit',
MERGE = 'merge',
SPLIT = 'split',
GROUP = 'group',
INTERACT = 'interact',
SELECT_ROI = 'select_roi',
DRAG_CANVAS = 'drag_canvas',
ZOOM_CANVAS = 'zoom_canvas',
}
Expand Down Expand Up @@ -111,30 +112,33 @@ Canvas itself handles:

interface Canvas {
html(): HTMLDivElement;
setZLayer(zLayer: number | null): void;
setup(frameData: any, objectStates: any[]): void;
activate(clientID: number, attributeID?: number): void;
rotate(frameAngle: number): void;
setup(frameData: any, objectStates: any[], zLayer?: number): void;
setupReviewROIs(reviewROIs: Record<number, number[]>): void;
activate(clientID: number | null, attributeID?: number): void;
rotate(rotationAngle: number): void;
focus(clientID: number, padding?: number): void;
fit(): void;
grid(stepX: number, stepY: number): void;

draw(drawData: DrawData): void;
interact(interactionData: InteractionData): void;
draw(drawData: DrawData): void;
group(groupData: GroupData): void;
split(splitData: SplitData): void;
merge(mergeData: MergeData): void;
select(objectState: any): void;

fitCanvas(): void;
bitmap(enabled: boolean): void;
bitmap(enable: boolean): void;
selectROI(enable: boolean): void;
dragCanvas(enable: boolean): void;
zoomCanvas(enable: boolean): void;

mode(): Mode;
cancel(): void;
configure(configuration: Configuration): void;
isAbleToChangeFrame(): boolean;

readonly geometry: Geometry;
}
```

Expand All @@ -147,11 +151,14 @@ Canvas itself handles:
`cvat_canvas_shape_merging`,
`cvat_canvas_shape_drawing`,
`cvat_canvas_shape_occluded`
- Drawn review ROIs have an id `cvat_canvas_issue_region_{issue.id}`
- Drawn review roi has the class `cvat_canvas_issue_region`
- Drawn texts have the class `cvat_canvas_text`
- Tags have the class `cvat_canvas_tag`
- Canvas image has ID `cvat_canvas_image`
- Grid on the canvas has ID `cvat_canvas_grid` and `cvat_canvas_grid_pattern`
- Crosshair during a draw has class `cvat_canvas_crosshair`
- To stick something to a specific position you can use an element with id `cvat_canvas_attachment_board`

### Events

Expand All @@ -178,6 +185,7 @@ Standard JS events are used.
- canvas.zoom
- canvas.fit
- canvas.dragshape => {id: number}
- canvas.roiselected => {points: number[]}
- canvas.resizeshape => {id: number}
- canvas.contextmenu => { mouseEvent: MouseEvent, objectState: ObjectState, pointID: number }
```
Expand Down Expand Up @@ -205,28 +213,33 @@ canvas.draw({
});
```

<!--lint disable maximum-line-length-->

## API Reaction

| | IDLE | GROUP | SPLIT | DRAW | MERGE | EDIT | DRAG | RESIZE | ZOOM_CANVAS | DRAG_CANVAS | INTERACT |
| ------------ | ---- | ----- | ----- | ---- | ----- | ---- | ---- | ------ | ----------- | ----------- | -------- |
| setup() | + | + | + | +/- | + | +/- | +/- | +/- | + | + | + |
| activate() | + | - | - | - | - | - | - | - | - | - | - |
| rotate() | + | + | + | + | + | + | + | + | + | + | + |
| focus() | + | + | + | + | + | + | + | + | + | + | + |
| fit() | + | + | + | + | + | + | + | + | + | + | + |
| grid() | + | + | + | + | + | + | + | + | + | + | + |
| draw() | + | - | - | + | - | - | - | - | - | - | - |
| interact() | + | - | - | - | - | - | - | - | - | - | + |
| split() | + | - | + | - | - | - | - | - | - | - | - |
| group() | + | + | - | - | - | - | - | - | - | - | - |
| merge() | + | - | - | - | + | - | - | - | - | - | - |
| fitCanvas() | + | + | + | + | + | + | + | + | + | + | + |
| dragCanvas() | + | - | - | - | - | - | + | - | - | + | - |
| zoomCanvas() | + | - | - | - | - | - | - | + | + | - | - |
| cancel() | - | + | + | + | + | + | + | + | + | + | + |
| configure() | + | + | + | + | + | + | + | + | + | + | + |
| bitmap() | + | + | + | + | + | + | + | + | + | + | + |
| setZLayer() | + | + | + | + | + | + | + | + | + | + | + |
| | IDLE | GROUP | SPLIT | DRAW | MERGE | EDIT | DRAG | RESIZE | ZOOM_CANVAS | DRAG_CANVAS | INTERACT |
| ----------------- | ---- | ----- | ----- | ---- | ----- | ---- | ---- | ------ | ----------- | ----------- | -------- |
| setup() | + | + | + | +/- | + | +/- | +/- | +/- | + | + | + |
| activate() | + | - | - | - | - | - | - | - | - | - | - |
| rotate() | + | + | + | + | + | + | + | + | + | + | + |
| focus() | + | + | + | + | + | + | + | + | + | + | + |
| fit() | + | + | + | + | + | + | + | + | + | + | + |
| grid() | + | + | + | + | + | + | + | + | + | + | + |
| draw() | + | - | - | + | - | - | - | - | - | - | - |
| interact() | + | - | - | - | - | - | - | - | - | - | + |
| split() | + | - | + | - | - | - | - | - | - | - | - |
| group() | + | + | - | - | - | - | - | - | - | - | - |
| merge() | + | - | - | - | + | - | - | - | - | - | - |
| fitCanvas() | + | + | + | + | + | + | + | + | + | + | + |
| dragCanvas() | + | - | - | - | - | - | + | - | - | + | - |
| zoomCanvas() | + | - | - | - | - | - | - | + | + | - | - |
| cancel() | - | + | + | + | + | + | + | + | + | + | + |
| configure() | + | + | + | + | + | + | + | + | + | + | + |
| bitmap() | + | + | + | + | + | + | + | + | + | + | + |
| setZLayer() | + | + | + | + | + | + | + | + | + | + | + |
| setupReviewROIs() | + | + | + | + | + | + | + | + | + | + | + |

<!--lint enable maximum-line-length-->

You can call setup() during editing, dragging, and resizing only to update objects, not to change a frame.
You can change frame during draw only when you do not redraw an existing object
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.1.3",
"version": "2.2.0",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
26 changes: 26 additions & 0 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ polyline.cvat_shape_drawing_opacity {
fill: darkmagenta;
}

.cvat_canvas_shape_region_selection {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;

fill: white;
stroke: white;
}

.cvat_canvas_issue_region {
display: none;
stroke-width: 0;
}

circle.cvat_canvas_issue_region {
opacity: 1 !important;
}

polyline.cvat_canvas_shape_grouping {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;
Expand Down Expand Up @@ -258,6 +275,15 @@ polyline.cvat_canvas_shape_splitting {
height: 100%;
}

#cvat_canvas_attachment_board {
position: absolute;
z-index: 4;
pointer-events: none;
width: 100%;
height: 100%;
user-select: none;
}

@keyframes loadingAnimation {
0% {
stroke-dashoffset: 1;
Expand Down
17 changes: 17 additions & 0 deletions cvat-canvas/src/typescript/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
RectDrawingMethod,
CuboidDrawingMethod,
Configuration,
Geometry,
} from './canvasModel';
import { Master } from './master';
import { CanvasController, CanvasControllerImpl } from './canvasController';
Expand All @@ -28,6 +29,7 @@ const CanvasVersion = pjson.version;
interface Canvas {
html(): HTMLDivElement;
setup(frameData: any, objectStates: any[], zLayer?: number): void;
setupIssueRegions(issueRegions: Record<number, number[]>): void;
activate(clientID: number | null, attributeID?: number): void;
rotate(rotationAngle: number): void;
focus(clientID: number, padding?: number): void;
Expand All @@ -43,13 +45,16 @@ interface Canvas {

fitCanvas(): void;
bitmap(enable: boolean): void;
selectRegion(enable: boolean): void;
dragCanvas(enable: boolean): void;
zoomCanvas(enable: boolean): void;

mode(): Mode;
cancel(): void;
configure(configuration: Configuration): void;
isAbleToChangeFrame(): boolean;

readonly geometry: Geometry;
}

class CanvasImpl implements Canvas {
Expand All @@ -71,6 +76,10 @@ class CanvasImpl implements Canvas {
this.model.setup(frameData, objectStates, zLayer);
}

public setupIssueRegions(issueRegions: Record<number, number[]>): void {
this.model.setupIssueRegions(issueRegions);
}

public fitCanvas(): void {
this.model.fitCanvas(this.view.html().clientWidth, this.view.html().clientHeight);
}
Expand All @@ -79,6 +88,10 @@ class CanvasImpl implements Canvas {
this.model.bitmap(enable);
}

public selectRegion(enable: boolean): void {
this.model.selectRegion(enable);
}

public dragCanvas(enable: boolean): void {
this.model.dragCanvas(enable);
}
Expand Down Expand Up @@ -146,6 +159,10 @@ class CanvasImpl implements Canvas {
public isAbleToChangeFrame(): boolean {
return this.model.isAbleToChangeFrame();
}

public get geometry(): Geometry {
return this.model.geometry;
}
}

export {
Expand Down
16 changes: 16 additions & 0 deletions cvat-canvas/src/typescript/canvasController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import {
GroupData,
Mode,
InteractionData,
Configuration,
} from './canvasModel';

export interface CanvasController {
readonly objects: any[];
readonly issueRegions: Record<number, number[]>;
readonly zLayer: number | null;
readonly focusData: FocusData;
readonly activeElement: ActiveElement;
Expand All @@ -27,6 +29,7 @@ export interface CanvasController {
readonly splitData: SplitData;
readonly groupData: GroupData;
readonly selected: any;
readonly configuration: Configuration;
mode: Mode;
geometry: Geometry;

Expand All @@ -36,6 +39,7 @@ export interface CanvasController {
merge(mergeData: MergeData): void;
split(splitData: SplitData): void;
group(groupData: GroupData): void;
selectRegion(enabled: boolean): void;
enableDrag(x: number, y: number): void;
drag(x: number, y: number): void;
disableDrag(): void;
Expand Down Expand Up @@ -103,6 +107,10 @@ export class CanvasControllerImpl implements CanvasController {
this.model.group(groupData);
}

public selectRegion(enable: boolean): void {
this.model.selectRegion(enable);
}

public get geometry(): Geometry {
return this.model.geometry;
}
Expand All @@ -115,6 +123,10 @@ export class CanvasControllerImpl implements CanvasController {
return this.model.zLayer;
}

public get issueRegions(): Record<number, number[]> {
return this.model.issueRegions;
}

public get objects(): any[] {
return this.model.objects;
}
Expand Down Expand Up @@ -151,6 +163,10 @@ export class CanvasControllerImpl implements CanvasController {
return this.model.selected;
}

public get configuration(): Configuration {
return this.model.configuration;
}

public set mode(value: Mode) {
this.model.mode = value;
}
Expand Down
Loading

0 comments on commit d6ac8cc

Please sign in to comment.