Skip to content

Commit

Permalink
Merge pull request #8264 from cvat-ai/release-2.16.2
Browse files Browse the repository at this point in the history
Release v2.16.2
  • Loading branch information
cvat-bot[bot] authored Aug 6, 2024
2 parents 04853fe + dd34b9c commit 3811aed
Show file tree
Hide file tree
Showing 72 changed files with 1,382 additions and 473 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

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

### Changed

- Following the link in notification no longer reloads the page
(<https://github.com/cvat-ai/cvat/pull/8197>)

### Fixed

- Copy/paste annotation guide with assets did not work, showing the message
**Asset is already related to another guide** (<https://github.com/cvat-ai/cvat/pull/7989>)

- Undo can't be done when a shape is rotated
(<https://github.com/cvat-ai/cvat/pull/8129>)

- Exporting a skeleton track in a format defined for shapes raises error
`operands could not be broadcast together with shapes (X, ) (Y, )`
(<https://github.com/cvat-ai/cvat/pull/8179>)

- Delete label modal window does not have cancellation button
(<https://github.com/cvat-ai/cvat/pull/8196>)

- Export and export cache clean rq job retries' hangs
(<https://github.com/cvat-ai/cvat/pull/8198>)

- The automatic annotation process failed for tasks from cloud data
(<https://github.com/cvat-ai/cvat/pull/8199>)

- Request card was not disabed properly after downloading
(<https://github.com/cvat-ai/cvat/pull/8197>)

- Annotations in a ground truth jobs marked as GT annotations after modifying
(<https://github.com/cvat-ai/cvat/pull/8206>)

- API call to run automatic annotations fails on a model with attributes
when mapping not provided in the request (<https://github.com/cvat-ai/cvat/pull/8250>)

- Fixed a label collision issue where labels with similar prefixes
and numeric suffixes could conflict, causing error on export.
(<https://github.com/cvat-ai/cvat/pull/8262>)

<a id='changelog-2.16.1'></a>
## \[2.16.1\] - 2024-07-18

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN apt-get update && \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
libhdf5-dev \
&& rm -rf /var/lib/apt/lists/*

ARG PIP_VERSION
Expand Down
6 changes: 0 additions & 6 deletions cvat-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ profile = "black"
forced_separate = ["tests"]
line_length = 100
skip_gitignore = true # align tool behavior with Black

# Can't just use a pyproject in the root dir, so duplicate
# https://github.com/psf/black/issues/2863
[tool.black]
line-length = 100
target-version = ['py38']
2 changes: 1 addition & 1 deletion cvat-cli/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cvat-sdk~=2.16.1
cvat-sdk~=2.16.2
Pillow>=10.3.0
setuptools>=70.0.0 # not directly required, pinned by Snyk to avoid a vulnerability
2 changes: 1 addition & 1 deletion cvat-cli/src/cvat_cli/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "2.16.1"
VERSION = "2.16.2"
14 changes: 12 additions & 2 deletions cvat-core/src/annotations-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2349,12 +2349,16 @@ export class MaskShape extends Shape {
redoWithUnderlyingPixels();
redo();
},
[this.clientID, ...clientIDs], frame,
[this.clientID, ...clientIDs],
frame,
);
} else {
this.history.do(
HistoryActions.CHANGED_POINTS,
undo, redo, [this.clientID], frame,
undo,
redo,
[this.clientID],
frame,
);
}
}
Expand Down Expand Up @@ -2999,6 +3003,12 @@ export class SkeletonTrack extends Track {
// Method is used to export data to the server
public toJSON(): SerializedTrack {
const result: SerializedTrack = Track.prototype.toJSON.call(this);

result.shapes = result.shapes.map((shape) => ({
...shape,
points: [],
}));

result.elements = this.elements.map((el) => ({
...el.toJSON(),
source: this.source,
Expand Down
2 changes: 1 addition & 1 deletion cvat-sdk/gen/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e

GENERATOR_VERSION="v6.0.1"

VERSION="2.16.1"
VERSION="2.16.2"
LIB_NAME="cvat_sdk"
LAYER1_LIB_NAME="${LIB_NAME}/api_client"
DST_DIR="$(cd "$(dirname -- "$0")/.." && pwd)"
Expand Down
6 changes: 0 additions & 6 deletions cvat-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ profile = "black"
forced_separate = ["tests"]
line_length = 100
skip_gitignore = true # align tool behavior with Black

# Can't just use a pyproject in the root dir, so duplicate
# https://github.com/psf/black/issues/2863
[tool.black]
line-length = 100
target-version = ['py38']
2 changes: 1 addition & 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.64.0",
"version": "1.64.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
33 changes: 21 additions & 12 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,20 @@ export function highlightConflict(conflict: QualityConflict | null): AnyAction {
};
}

function wrapAnnotationsInGTJob(states: ObjectState[]): ObjectState[] {
return states.map((state: ObjectState) => new Proxy(state, {
get(_state, prop) {
if (prop === 'isGroundTruth') {
// ground truth objects are not considered as gt objects, relatively to a gt jobs
// to avoid extra css styles, or restrictions applied
return false;
}

return Reflect.get(_state, prop);
},
}));
}

async function fetchAnnotations(predefinedFrame?: number): Promise<{
states: CombinedState['annotation']['annotations']['states'];
history: CombinedState['annotation']['annotations']['history'];
Expand All @@ -279,18 +293,9 @@ async function fetchAnnotations(predefinedFrame?: number): Promise<{
const fetchFrame = typeof predefinedFrame === 'undefined' ? frame : predefinedFrame;
let states = await jobInstance.annotations.get(fetchFrame, showAllInterpolationTracks, filters);
const [minZ, maxZ] = computeZRange(states);
if (jobInstance.type === JobType.GROUND_TRUTH) {
states = states.map((state: ObjectState) => new Proxy(state, {
get(_state, prop) {
if (prop === 'isGroundTruth') {
// ground truth objects are not considered as gt objects, relatively to a gt jobs
// to avoid extra css styles, or restrictions applied
return false;
}

return Reflect.get(_state, prop);
},
}));
if (jobInstance.type === JobType.GROUND_TRUTH) {
states = wrapAnnotationsInGTJob(states);
} else if (showGroundTruth && groundTruthInstance) {
const gtStates = await groundTruthInstance.annotations.get(fetchFrame, showAllInterpolationTracks, filters);
states.push(...gtStates);
Expand Down Expand Up @@ -1110,7 +1115,11 @@ export function updateAnnotationsAsync(statesToUpdate: any[]): ThunkAction {
}

const promises = statesToUpdate.map((objectState: any): Promise<any> => objectState.save());
const states = await Promise.all(promises);
let states = await Promise.all(promises);

if (jobInstance.type === JobType.GROUND_TRUTH) {
states = wrapAnnotationsInGTJob(states);
}

const needToUpdateAll = states
.some((state: any) => state.shapeType === ShapeType.MASK || state.parentID !== null);
Expand Down
4 changes: 4 additions & 0 deletions cvat-ui/src/actions/requests-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum RequestsActionsTypes {
CANCEL_REQUEST_FAILED = 'CANCEL_REQUEST_FAILED',
DELETE_REQUEST = 'DELETE_REQUEST',
DELETE_REQUEST_FAILED = 'DELETE_REQUEST_FAILED',
DISABLE_REQUEST = 'DISABLE_REQUEST',
}

export const requestsActions = {
Expand All @@ -44,6 +45,9 @@ export const requestsActions = {
cancelRequestFailed: (request: Request, error: any) => createAction(
RequestsActionsTypes.CANCEL_REQUEST_FAILED, { request, error },
),
disableRequest: (request: Request) => createAction(
RequestsActionsTypes.DISABLE_REQUEST, { request },
),
};

export type RequestsActions = ActionUnion<typeof requestsActions>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ function JobListComponent(props: Props): JSX.Element {
Number.isFinite(field1) && Number.isFinite(field2)) return field1 - field2;
}

if (field1 === null || !Number.isFinite(field1)) {
if (field1 === null && field2 === null) return 0;

if (field1 === null || (typeof field1 === 'number' && !Number.isFinite(field1))) {
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,11 @@ class CanvasWrapperComponent extends React.PureComponent<Props> {
private onCanvasEditDone = (event: any): void => {
const { activeControl, onUpdateAnnotations, updateActiveControl } = this.props;
const { state, points, rotation } = event.detail;
state.points = points;
state.rotation = rotation;
if (state.rotation !== rotation) {
state.rotation = rotation;
} else {
state.points = points;
}

if (activeControl !== ActiveControl.CURSOR) {
// do not need to reset and deactivate if it was just resizing/dragging and other simple actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ import {
import DetectorRunner, { DetectorRequestBody } from 'components/model-runner-modal/detector-runner';
import LabelSelector from 'components/label-selector/label-selector';
import CVATTooltip from 'components/common/cvat-tooltip';
import CVATMarkdown from 'components/common/cvat-markdown';

import ApproximationAccuracy, {
thresholdFromAccuracy,
} from 'components/annotation-page/standard-workspace/controls-side-bar/approximation-accuracy';
import { switchToolsBlockerState } from 'actions/settings-actions';
import { ReactMarkdown } from 'react-markdown/lib/react-markdown';
import withVisibilityHandling from './handle-popover-visibility';
import ToolsTooltips from './interactor-tooltips';

Expand Down Expand Up @@ -440,7 +440,7 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
setTimeout(() => this.runInteractionRequest(interactionId));
} catch (error: any) {
notification.error({
description: <ReactMarkdown>{error.message}</ReactMarkdown>,
description: <CVATMarkdown>{error.message}</CVATMarkdown>,
message: 'Interaction error occurred',
duration: null,
});
Expand Down Expand Up @@ -533,7 +533,7 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
fetchAnnotations();
} catch (error: any) {
notification.error({
description: <ReactMarkdown>{error.message}</ReactMarkdown>,
description: <CVATMarkdown>{error.message}</CVATMarkdown>,
message: 'Tracking error occurred',
duration: null,
});
Expand Down Expand Up @@ -787,7 +787,7 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
} catch (error: any) {
notification.error({
message: 'Tracker initialization error',
description: <ReactMarkdown>{error.message}</ReactMarkdown>,
description: <CVATMarkdown>{error.message}</CVATMarkdown>,
duration: null,
});
} finally {
Expand Down Expand Up @@ -841,7 +841,7 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
} catch (error: any) {
notification.error({
message: 'Tracking error',
description: <ReactMarkdown>{error.message}</ReactMarkdown>,
description: <CVATMarkdown>{error.message}</CVATMarkdown>,
duration: null,
});
} finally {
Expand Down Expand Up @@ -900,7 +900,7 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
} catch (error: any) {
notification.error({
message: 'Could not initialize OpenCV',
description: <ReactMarkdown>{error.message}</ReactMarkdown>,
description: <CVATMarkdown>{error.message}</CVATMarkdown>,
duration: null,
});
} finally {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
onSwitchToolsBlockerState({ buttonVisible: false });
} catch (error: any) {
notification.error({
description: <ReactMarkdown>{error.message}</ReactMarkdown>,
description: <CVATMarkdown>{error.message}</CVATMarkdown>,
message: 'Detection error occurred',
duration: null,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function RightGroup(props: Props): JSX.Element {
const openGuide = useCallback(() => {
const PADDING = Math.min(window.screen.availHeight, window.screen.availWidth) * 0.4;
jobInstance.guide().then((guide) => {
if (guide?.markdown) {
if (guide) {
Modal.info({
icon: null,
width: window.screen.availWidth - PADDING,
Expand Down
45 changes: 45 additions & 0 deletions cvat-ui/src/components/common/cvat-markdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (C) 2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

import Button from 'antd/lib/button';
import React from 'react';
import ReactMarkdown from 'react-markdown';
import { RouteComponentProps } from 'react-router-dom';

export type UseHistoryType = RouteComponentProps['history'];

const RouterLinkHOC = (history?: UseHistoryType) => (
function (props: { children: React.ReactNode, href?: string }): JSX.Element {
const { href, children } = props;

if (href?.match(/^\//) && history) {
return (
<Button
type='link'
className='cvat-notification-link'
onClick={() => {
history.push(href);
}}
>
{children}
</Button>
);
}

return (<a href={href}>{children}</a>);
});

export default function CVATMarkdown(props: { history?: UseHistoryType, children: string }): JSX.Element {
const { children, history } = props;

return (
<ReactMarkdown
components={{
a: RouterLinkHOC(history),
}}
>
{children}
</ReactMarkdown>
);
}
Loading

0 comments on commit 3811aed

Please sign in to comment.