Skip to content

Commit

Permalink
Merge pull request #8300 from cvat-ai/release-2.16.3
Browse files Browse the repository at this point in the history
Release v2.16.3
  • Loading branch information
cvat-bot[bot] authored Aug 13, 2024
2 parents 3811aed + 80d3999 commit 8323104
Show file tree
Hide file tree
Showing 95 changed files with 2,296 additions and 1,715 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,23 @@ jobs:
- name: Verify API schema
id: verify_schema
run: |
docker run --rm --entrypoint /bin/bash cvat/server:${CVAT_VERSION} \
docker run --rm cvat/server:${CVAT_VERSION} bash \
-c 'python manage.py spectacular' > cvat/schema-expected.yml
if ! git diff --no-index cvat/schema.yml cvat/schema-expected.yml; then
echo
echo 'API schema has changed! Please update cvat/schema.yml:'
echo
echo ' docker run --rm --entrypoint /bin/bash cvat/server:dev \'
echo ' docker run --rm cvat/server:dev bash \'
echo " -c 'python manage.py spectacular' > cvat/schema.yml"
exit 1
fi
- name: Verify migrations
run: |
docker run --rm cvat/server:${CVAT_VERSION} bash \
-c 'python manage.py makemigrations --check'
- name: Upload expected schema as an artifact
if: failure() && steps.verify_schema.conclusion == 'failure'
uses: actions/[email protected]
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,23 @@ jobs:
id: verify_schema
run: |
docker load --input /tmp/cvat_server/image.tar
docker run --rm --entrypoint /bin/bash cvat/server \
docker run --rm cvat/server bash \
-c 'python manage.py spectacular' > cvat/schema-expected.yml
if ! git diff --no-index cvat/schema.yml cvat/schema-expected.yml; then
echo
echo 'API schema has changed! Please update cvat/schema.yml:'
echo
echo ' docker run --rm --entrypoint /bin/bash cvat/server:dev \'
echo ' docker run --rm cvat/server:dev bash \'
echo " -c 'python manage.py spectacular' > cvat/schema.yml"
exit 1
fi
- name: Verify migrations
run: |
docker run --rm cvat/server bash \
-c 'python manage.py makemigrations --check'
- name: Upload CVAT server artifact
uses: actions/upload-artifact@v3
with:
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- scriv-insert-here -->

<a id='changelog-2.16.3'></a>
## \[2.16.3\] - 2024-08-13

### Added

- Labels mapper on UI now supports attributes for skeleton points
(<https://github.com/cvat-ai/cvat/pull/8251>)

- Segment Anything now supports bounding box input
(<https://github.com/cvat-ai/cvat/pull/8270>)

### Changed

- Player navigation not blocked anymore if a frame is being loaded from the server
(<https://github.com/cvat-ai/cvat/pull/8284>)

- Accelerated implementation of IntelligentScissors from OpenCV
(<https://github.com/cvat-ai/cvat/pull/8293>)

### Fixed

- Issue tool was not reset after creating new issue
(<https://github.com/cvat-ai/cvat/pull/8236>)

- Fixed issue with slices handling in `LazyList` which caused problems with exporting masks
in `CVAT for images 1.1` format.
(<https://github.com/cvat-ai/cvat/pull/8299>)

<a id='changelog-2.16.2'></a>
## \[2.16.2\] - 2024-08-06

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.20.6",
"version": "2.20.8",
"type": "module",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
Expand Down
8 changes: 0 additions & 8 deletions cvat-canvas/src/scss/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ polyline.cvat_shape_drawing_opacity {
stroke: red;
}

.cvat_canvas_threshold {
stroke: red;
}

.cvat_canvas_shape_selection {
@extend .cvat_shape_action_dasharray;
@extend .cvat_shape_action_opacity;
Expand Down Expand Up @@ -255,10 +251,6 @@ g.cvat_canvas_shape_occluded {
auto;
}

.cvat_canvas_interact_intermediate_shape_point {
pointer-events: none;
}

.svg_select_boundingRect {
opacity: 0;
pointer-events: none;
Expand Down
28 changes: 14 additions & 14 deletions cvat-canvas/src/typescript/canvasModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,12 @@ export interface InteractionData {
minPosVertices?: number;
minNegVertices?: number;
startWithBox?: boolean;
enableThreshold?: boolean;
enableSliding?: boolean;
allowRemoveOnlyLast?: boolean;
intermediateShape?: {
shapeType: string;
points: number[];
};
onChangeToolsBlockerState?: (event: string) => void;
}

export interface InteractionResult {
Expand Down Expand Up @@ -549,14 +547,24 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
) {
this.data.zLayer = zLayer;
this.data.objects = objectStates;
this.notify(UpdateReasons.OBJECTS_UPDATED);
if (this.data.image) {
// display objects only if there is a drawn image
// if there is not, UpdateReasons.OBJECTS_UPDATED will be triggered after image is set
// it covers cases when annotations are changed while image is being received from the server
// e.g. with UI buttons (lock, unlock), shortcuts, delete/restore frames,
// and anytime when a list of objects updated in cvat-ui
this.notify(UpdateReasons.OBJECTS_UPDATED);
}
return;
}

this.data.imageID = frameData.number;
this.data.imageIsDeleted = frameData.deleted;
if (this.data.imageIsDeleted) {
this.data.angle = 0;
}

const { zLayer: prevZLayer, objects: prevObjects } = this.data;

frameData
.data((): void => {
this.data.image = null;
Expand All @@ -580,11 +588,6 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
};

this.data.image = data;
this.data.imageIsDeleted = frameData.deleted;
if (this.data.imageIsDeleted) {
this.data.angle = 0;
}

this.fit();

// restore correct image position after switching to a new frame
Expand Down Expand Up @@ -811,11 +814,8 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
if (![Mode.IDLE, Mode.INTERACT].includes(this.data.mode)) {
throw Error(`Canvas is busy. Action: ${this.data.mode}`);
}
const thresholdChanged = this.data.interactionData.enableThreshold !== interactionData.enableThreshold;
if (interactionData.enabled && !interactionData.intermediateShape && !thresholdChanged) {
if (this.data.interactionData.enabled) {
throw new Error('Interaction has been already started');
} else if (!interactionData.shapeType) {
if (interactionData.enabled) {
if (!this.data.interactionData.enabled && !interactionData.shapeType) {
throw new Error('A shape type was not specified');
}
}
Expand Down
35 changes: 21 additions & 14 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
private controller: CanvasController;
private svgShapes: Record<number, SVG.Shape>;
private svgTexts: Record<number, SVG.Text>;
private isImageLoading: boolean;
private issueRegionPattern_1: SVG.Pattern;
private issueRegionPattern_2: SVG.Pattern;
private drawnStates: Record<number, DrawnState>;
Expand Down Expand Up @@ -248,7 +249,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
shapes: InteractionResult[] | null,
shapesUpdated = true,
isDone = false,
threshold: number | null = null,
): void => {
const { zLayer } = this.controller;
if (Array.isArray(shapes)) {
Expand All @@ -260,7 +260,6 @@ export class CanvasViewImpl implements CanvasView, Listener {
isDone,
shapes,
zOrder: zLayer || 0,
threshold,
},
});

Expand Down Expand Up @@ -1437,6 +1436,8 @@ export class CanvasViewImpl implements CanvasView, Listener {
editHidden: {},
sliceHidden: {},
};

this.isImageLoading = true;
this.draggableShape = null;
this.resizableShape = null;

Expand Down Expand Up @@ -1643,19 +1644,21 @@ export class CanvasViewImpl implements CanvasView, Listener {
if (this.mode !== Mode.IDLE) return;
if (e.ctrlKey || e.altKey) return;

const { offset } = this.controller.geometry;
const [x, y] = translateToSVG(this.content, [e.clientX, e.clientY]);
const event: CustomEvent = new CustomEvent('canvas.moved', {
bubbles: false,
cancelable: true,
detail: {
x: x - offset,
y: y - offset,
states: this.controller.objects,
},
});
if (!this.isImageLoading) {
const { offset } = this.controller.geometry;
const [x, y] = translateToSVG(this.content, [e.clientX, e.clientY]);
const event: CustomEvent = new CustomEvent('canvas.moved', {
bubbles: false,
cancelable: true,
detail: {
x: x - offset,
y: y - offset,
states: this.controller.objects,
},
});

this.canvas.dispatchEvent(event);
this.canvas.dispatchEvent(event);
}
});

this.content.oncontextmenu = (): boolean => false;
Expand Down Expand Up @@ -1787,6 +1790,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
} else if (reason === UpdateReasons.IMAGE_CHANGED) {
const { image } = model;
if (image) {
this.isImageLoading = false;
const ctx = this.background.getContext('2d');
this.background.setAttribute('width', `${image.renderWidth}px`);
this.background.setAttribute('height', `${image.renderHeight}px`);
Expand Down Expand Up @@ -1819,6 +1823,8 @@ export class CanvasViewImpl implements CanvasView, Listener {
this.moveCanvas();
this.resizeCanvas();
this.transformCanvas();
} else {
this.isImageLoading = true;
}
} else if (reason === UpdateReasons.FITTED_CANVAS) {
// Canvas geometry is going to be changed. Old object positions aren't valid any more
Expand Down Expand Up @@ -1875,6 +1881,7 @@ export class CanvasViewImpl implements CanvasView, Listener {
this.canvas.style.cursor = 'pointer';
} else {
this.regionSelector.select(false);
this.canvas.style.cursor = '';
}
} else if (reason === UpdateReasons.DRAG_CANVAS) {
if (this.mode === Mode.DRAG_CANVAS) {
Expand Down
Loading

0 comments on commit 8323104

Please sign in to comment.