Skip to content

Commit

Permalink
Release v2.4.4
Browse files Browse the repository at this point in the history
### Added
- Introduced a new configuration option for controlling the invocation of Nuclio functions.
  (<#6146>)

### Changed
- Relocated SAM masks decoder to frontend operation.
  (<#6019>)
- Switched `person-reidentification-retail-0300` and `faster_rcnn_inception_v2_coco` Nuclio functions with `person-reidentification-retail-0277` and `faster_rcnn_inception_resnet_v2_atrous_coco` respectively.
  (<#6129>)
- Upgraded OpenVINO-based Nuclio functions to utilize the OpenVINO 2022.3 runtime.
  (<#6129>)

### Fixed
- Resolved issues with tracking multiple objects (30 and more) using the TransT tracker.
  (<#6073>)
- Addressed azure.core.exceptions.ResourceExistsError: The specified blob already exists.
  (<#6082>)
- Corrected image scaling issues when transitioning between images of different resolutions.
  (<#6081>)
- Fixed inaccurate reporting of completed job counts.
  (<#6098>)
- Allowed OpenVINO-based Nuclio functions to be deployed to Kubernetes.
  (<#6129>)
- Improved skeleton size checks after drawing.
  (<#6156>)
- Fixed HRNet CPU serverless function.
  (<#6150>)
- Prevented sending of empty list of events.
  (<#6154>)
  • Loading branch information
nmanovic authored May 18, 2023
2 parents 8a2c23f + fa4a200 commit d5ef45a
Show file tree
Hide file tree
Showing 95 changed files with 1,601 additions and 647 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"npm.exclude": "**/.env/**",
"licenser.license": "Custom",
"licenser.customHeader": "Copyright (C) @YEAR@ Intel Corporation\n\nSPDX-License-Identifier: MIT",
"licenser.customHeader": "Copyright (C) @YEAR@ CVAT.ai Corporation\n\nSPDX-License-Identifier: MIT",
"files.trimTrailingWhitespace": true,
"sqltools.connections": [
{
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## \[2.4.4] - 2023-05-18
### Added
- Introduced a new configuration option for controlling the invocation of Nuclio functions.
(<https://github.com/opencv/cvat/pull/6146>)

### Changed
- Relocated SAM masks decoder to frontend operation.
(<https://github.com/opencv/cvat/pull/6019>)
- Switched `person-reidentification-retail-0300` and `faster_rcnn_inception_v2_coco` Nuclio functions with `person-reidentification-retail-0277` and `faster_rcnn_inception_resnet_v2_atrous_coco` respectively.
(<https://github.com/opencv/cvat/pull/6129>)
- Upgraded OpenVINO-based Nuclio functions to utilize the OpenVINO 2022.3 runtime.
(<https://github.com/opencv/cvat/pull/6129>)

### Fixed
- Resolved issues with tracking multiple objects (30 and more) using the TransT tracker.
(<https://github.com/opencv/cvat/pull/6073>)
- Addressed azure.core.exceptions.ResourceExistsError: The specified blob already exists.
(<https://github.com/opencv/cvat/pull/6082>)
- Corrected image scaling issues when transitioning between images of different resolutions.
(<https://github.com/opencv/cvat/pull/6081>)
- Fixed inaccurate reporting of completed job counts.
(<https://github.com/opencv/cvat/issues/6098>)
- Allowed OpenVINO-based Nuclio functions to be deployed to Kubernetes.
(<https://github.com/opencv/cvat/pull/6129>)
- Improved skeleton size checks after drawing.
(<https://github.com/opencv/cvat/pull/6156>)
- Fixed HRNet CPU serverless function.
(<https://github.com/opencv/cvat/pull/6150>)
- Prevented sending of empty list of events.
(<https://github.com/opencv/cvat/pull/6154>)

## \[2.4.3] - 2023-04-24
### Changed
- Docker images no longer include Ubuntu package sources or FFmpeg/OpenH264 sources
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.3",
"version": "2.16.6",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
39 changes: 35 additions & 4 deletions cvat-canvas/src/typescript/canvasModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface Configuration {
shapeOpacity?: number;
controlPointsSize?: number;
outlinedBorders?: string | false;
resetZoom?: boolean;
}

export interface BrushTool {
Expand Down Expand Up @@ -160,6 +161,7 @@ export enum UpdateReasons {
IMAGE_ZOOMED = 'image_zoomed',
IMAGE_FITTED = 'image_fitted',
IMAGE_MOVED = 'image_moved',
IMAGE_ROTATED = 'image_rotated',
GRID_UPDATED = 'grid_updated',

ISSUE_REGIONS_UPDATED = 'issue_regions_updated',
Expand Down Expand Up @@ -312,11 +314,12 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
imageIsDeleted: boolean;
focusData: FocusData;
gridSize: Size;
left: number;
objects: any[];
issueRegions: Record<number, { hidden: boolean; points: number[] }>;
scale: number;
top: number;
left: number;
fittedScale: number;
zLayer: number | null;
drawData: DrawData;
editData: MasksEditData;
Expand Down Expand Up @@ -355,6 +358,7 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
selectedShapeOpacity: 0.5,
shapeOpacity: 0.2,
outlinedBorders: false,
resetZoom: true,
textFontSize: consts.DEFAULT_SHAPE_TEXT_SIZE,
controlPointsSize: consts.BASE_POINT_SIZE,
textPosition: consts.DEFAULT_SHAPE_TEXT_POSITION,
Expand All @@ -378,11 +382,12 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
height: 100,
width: 100,
},
left: 0,
objects: [],
issueRegions: {},
scale: 1,
top: 0,
left: 0,
fittedScale: 0,
zLayer: null,
selected: null,
mode: Mode.IDLE,
Expand Down Expand Up @@ -506,6 +511,12 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
return;
}

const relativeScaling = this.data.scale / this.data.fittedScale;
const prevImageLeft = this.data.left;
const prevImageTop = this.data.top;
const prevImageWidth = this.data.imageSize.width;
const prevImageHeight = this.data.imageSize.height;

this.data.imageSize = {
height: frameData.height as number,
width: frameData.width as number,
Expand All @@ -516,6 +527,20 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
if (this.data.imageIsDeleted) {
this.data.angle = 0;
}

this.fit();

// restore correct image position after switching to a new frame
// if corresponding option is disabled
// prevImageHeight and prevImageWidth are initialized by 0 by default
if (prevImageHeight !== 0 && prevImageWidth !== 0 && !this.data.configuration.resetZoom) {
const leftOffset = Math.round((this.data.imageSize.width - prevImageWidth) / 2);
const topOffset = Math.round((this.data.imageSize.height - prevImageHeight) / 2);
this.data.left = prevImageLeft - leftOffset;
this.data.top = prevImageTop - topOffset;
this.data.scale *= relativeScaling;
}

this.notify(UpdateReasons.IMAGE_CHANGED);
this.data.zLayer = zLayer;
this.data.objects = objectStates;
Expand Down Expand Up @@ -562,7 +587,7 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
public rotate(rotationAngle: number): void {
if (this.data.angle !== rotationAngle && !this.data.imageIsDeleted) {
this.data.angle = (360 + Math.floor(rotationAngle / 90) * 90) % 360;
this.fit();
this.notify(UpdateReasons.IMAGE_ROTATED);
}
}

Expand Down Expand Up @@ -592,10 +617,13 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
}

this.data.scale = Math.min(Math.max(this.data.scale, FrameZoom.MIN), FrameZoom.MAX);

this.data.top = this.data.canvasSize.height / 2 - this.data.imageSize.height / 2;
this.data.left = this.data.canvasSize.width / 2 - this.data.imageSize.width / 2;

// scale is changed during zooming or translating
// so, remember fitted scale to compute fit-relative scaling
this.data.fittedScale = this.data.scale;

this.notify(UpdateReasons.IMAGE_FITTED);
}

Expand Down Expand Up @@ -813,6 +841,9 @@ export class CanvasModelImpl extends MasterImpl implements CanvasModel {
if (typeof configuration.forceFrameUpdate === 'boolean') {
this.data.configuration.forceFrameUpdate = configuration.forceFrameUpdate;
}
if (typeof configuration.resetZoom === 'boolean') {
this.data.configuration.resetZoom = configuration.resetZoom;
}
if (typeof configuration.selectedShapeOpacity === 'number') {
this.data.configuration.selectedShapeOpacity = configuration.selectedShapeOpacity;
}
Expand Down
16 changes: 8 additions & 8 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,12 @@ export class CanvasViewImpl implements CanvasView, Listener {
// Setup event handlers
this.canvas.addEventListener('dblclick', (e: MouseEvent): void => {
this.controller.fit();
this.canvas.dispatchEvent(
new CustomEvent('canvas.fit', {
bubbles: false,
cancelable: true,
}),
);
e.preventDefault();
});

Expand Down Expand Up @@ -1460,14 +1466,8 @@ export class CanvasViewImpl implements CanvasView, Listener {
} else if ([UpdateReasons.IMAGE_ZOOMED, UpdateReasons.IMAGE_FITTED].includes(reason)) {
this.moveCanvas();
this.transformCanvas();
if (reason === UpdateReasons.IMAGE_FITTED) {
this.canvas.dispatchEvent(
new CustomEvent('canvas.fit', {
bubbles: false,
cancelable: true,
}),
);
}
} else if (reason === UpdateReasons.IMAGE_ROTATED) {
this.transformCanvas();
} else if (reason === UpdateReasons.IMAGE_MOVED) {
this.moveCanvas();
} else if (reason === UpdateReasons.OBJECTS_UPDATED) {
Expand Down
7 changes: 6 additions & 1 deletion cvat-canvas/src/typescript/drawHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ function checkConstraint(shapeType: string, points: number[], box: Box | null =
(points.length === 2 * 2 && (points[2] - points[0]) * (points[3] - points[1]) >= consts.AREA_THRESHOLD);
}

if (shapeType === 'skeleton') {
const [xtl, ytl, xbr, ybr] = points;
return (xbr - xtl >= 1 || ybr - ytl >= 1);
}

return false;
}

Expand Down Expand Up @@ -762,7 +767,7 @@ export class DrawHandlerImpl implements DrawHandler {
this.release();

if (this.canceled) return;
if (checkConstraint('rectangle', [xtl, ytl, xbr, ybr])) {
if (checkConstraint('skeleton', [xtl, ytl, xbr, ybr])) {
this.onDrawDone({
clientID,
shapeType,
Expand Down
5 changes: 3 additions & 2 deletions cvat-canvas/src/typescript/interactionHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -146,13 +147,13 @@ export class InteractionHandlerImpl implements InteractionHandler {
_e.stopPropagation();
self.remove();
this.shapesWereUpdated = true;
const shouldRaiseEvent = this.shouldRaiseEvent(_e.ctrlKey);
this.interactionShapes = this.interactionShapes.filter(
(shape: SVG.Shape): boolean => shape !== self,
);
if (this.interactionData.startWithBox && this.interactionShapes.length === 1) {
this.interactionShapes[0].style({ visibility: '' });
}
const shouldRaiseEvent = this.shouldRaiseEvent(_e.ctrlKey);
if (shouldRaiseEvent) {
this.onInteraction(this.prepareResult(), true, false);
}
Expand Down Expand Up @@ -314,7 +315,7 @@ export class InteractionHandlerImpl implements InteractionHandler {
'pointer-events': 'none',
opacity: 0.5,
}).addClass('cvat_canvas_interact_intermediate_shape');
image.move(this.geometry.offset, this.geometry.offset);
image.move(this.geometry.offset + left, this.geometry.offset + top);
this.drawnIntermediateShape = image;

imageDataToDataURL(
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "9.0.1",
"version": "9.1.1",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "src/api.ts",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/src/lambda-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class LambdaManager {

if (response.status === RQStatus.QUEUED || response.status === RQStatus.STARTED) {
onUpdate(response.status, response.progress || 0);
this.listening[requestID].timeout = setTimeout(timeoutCallback, 2000);
this.listening[requestID].timeout = setTimeout(timeoutCallback, 20000);
} else {
if (response.status === RQStatus.FINISHED) {
onUpdate(response.status, response.progress || 100);
Expand All @@ -148,7 +148,7 @@ class LambdaManager {
this.listening[requestID] = {
onUpdate,
functionID,
timeout: setTimeout(timeoutCallback, 2000),
timeout: setTimeout(timeoutCallback, 20000),
};
}

Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/logger-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Object.defineProperties(LoggerStorage.prototype.save, {
writable: false,
enumerable: false,
value: async function implementation() {
if (!this.collection) {
if (!this.collection.length) {
return;
}

Expand Down
22 changes: 19 additions & 3 deletions cvat-core/src/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
// Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

import { PluginError } from './exceptions';

const plugins = [];

export interface APIWrapperEnterOptions {
preventMethodCall?: boolean;
}

export default class PluginRegistry {
static async apiWrapper(wrappedFunc, ...args) {
// I have to optimize the wrapper
const pluginList = await PluginRegistry.list();
const aggregatedOptions: APIWrapperEnterOptions = {
preventMethodCall: false,
};

for (const plugin of pluginList) {
const pluginDecorators = plugin.functions.filter((obj) => obj.callback === wrappedFunc)[0];
if (pluginDecorators && pluginDecorators.enter) {
try {
await pluginDecorators.enter.call(this, plugin, ...args);
const options: APIWrapperEnterOptions | undefined = await pluginDecorators
.enter.call(this, plugin, ...args);
if (options?.preventMethodCall) {
aggregatedOptions.preventMethodCall = true;
}
} catch (exception) {
if (exception instanceof PluginError) {
throw exception;
Expand All @@ -24,7 +37,10 @@ export default class PluginRegistry {
}
}

let result = await wrappedFunc.implementation.call(this, ...args);
let result = null;
if (!aggregatedOptions.preventMethodCall) {
result = await wrappedFunc.implementation.call(this, ...args);
}

for (const plugin of pluginList) {
const pluginDecorators = plugin.functions.filter((obj) => obj.callback === wrappedFunc)[0];
Expand Down
5 changes: 4 additions & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.50.8",
"version": "1.51.0",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand All @@ -22,6 +22,7 @@
"dependencies": {
"@ant-design/icons": "^4.6.3",
"@types/lodash": "^4.14.172",
"@types/lru-cache": "^7.10.10",
"@types/platform": "^1.3.4",
"@types/react": "^16.14.15",
"@types/react-color": "^3.0.5",
Expand All @@ -41,8 +42,10 @@
"dotenv-webpack": "^8.0.1",
"error-stack-parser": "^2.0.6",
"lodash": "^4.17.21",
"lru-cache": "^9.1.1",
"moment": "^2.29.2",
"mousetrap": "^1.6.5",
"onnxruntime-web": "^1.14.0",
"platform": "^1.3.6",
"prop-types": "^15.7.2",
"react": "^16.14.0",
Expand Down
Loading

0 comments on commit d5ef45a

Please sign in to comment.