Skip to content

Commit

Permalink
Merge pull request #9016 from cvat-ai/release-2.26.1
Browse files Browse the repository at this point in the history
Release v2.26.1
  • Loading branch information
cvat-bot[bot] authored Jan 29, 2025
2 parents 3f03ee7 + 0a2ff48 commit 9c5ef99
Show file tree
Hide file tree
Showing 41 changed files with 262 additions and 156 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

<a id='changelog-2.26.1'></a>
## \[2.26.1\] - 2025-01-29

### Added

- A button to copy a filename of the image into the clipboard
(<https://github.com/cvat-ai/cvat/pull/8989>)

### Changed

- Changed location of events cache dir
(<https://github.com/cvat-ai/cvat/pull/9015>)

### Removed

- \[Helm\] Removed `disableDistinctCachePerService` settings
(<https://github.com/cvat-ai/cvat/pull/9008>)

### Fixed

- The backend now rejects invalid label types
(<https://github.com/cvat-ai/cvat/pull/8980>)

- \[Helm\] Impossible to download exported annotations
(<https://github.com/cvat-ai/cvat/pull/9008>)

<a id='changelog-2.26.0'></a>
## \[2.26.0\] - 2025-01-27

Expand Down
2 changes: 1 addition & 1 deletion cvat-cli/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cvat-sdk==2.26.0
cvat-sdk==2.26.1

attrs>=24.2.0
Pillow>=10.3.0
Expand Down
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.26.0"
VERSION = "2.26.1"
2 changes: 1 addition & 1 deletion cvat-sdk/cvat_sdk/auto_annotation/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def mask(label_id: int, points: Sequence[float], **kwargs) -> models.LabeledShap
"""
Helper factory function for LabeledShapeRequest with frame=0 and type="mask".
It's recommended to use the cvat.masks.encode_mask function to build the
It's recommended to use the cvat_sdk.masks.encode_mask function to build the
points argument.
"""
return shape(label_id, type="mask", points=points, **kwargs)
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.26.0"
VERSION="2.26.1"
LIB_NAME="cvat_sdk"
LAYER1_LIB_NAME="${LIB_NAME}/api_client"
DST_DIR="$(cd "$(dirname -- "$0")/.." && pwd)"
Expand Down
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": "2.26.0",
"version": "2.26.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
10 changes: 6 additions & 4 deletions cvat-ui/src/components/annotation-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@

.cvat-player-frame-url-icon,
.cvat-player-delete-frame,
.cvat-player-restore-frame {
.cvat-player-restore-frame,
.cvat-player-copy-frame-name-icon {
opacity: 0.7;
color: $objects-bar-icons-color;

Expand All @@ -199,9 +200,10 @@
}
}

.cvat-player-delete-frame,
.cvat-player-restore-frame {
margin-left: $grid-unit-size * 2;
.cvat-player-frame-actions {
span:not(:first-child) {
margin-left: $grid-unit-size;
}
}

.cvat-player-frame-selector {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
} from 'react';

import { Row, Col } from 'antd/lib/grid';
import Icon, { LinkOutlined, DeleteOutlined } from '@ant-design/icons';
import Icon, { LinkOutlined, DeleteOutlined, CopyOutlined } from '@ant-design/icons';
import Slider from 'antd/lib/slider';
import InputNumber from 'antd/lib/input-number';
import Text from 'antd/lib/typography/Text';
Expand Down Expand Up @@ -39,6 +39,7 @@ interface Props {
onSliderChange(value: number): void;
onInputChange(value: number): void;
onURLIconClick(): void;
onCopyFilenameIconClick(): void;
onDeleteFrame(): void;
onRestoreFrame(): void;
switchNavigationBlocked(blocked: boolean): void;
Expand Down Expand Up @@ -79,6 +80,7 @@ function PlayerNavigation(props: Props): JSX.Element {
onSliderChange,
onInputChange,
onURLIconClick,
onCopyFilenameIconClick,
onDeleteFrame,
onRestoreFrame,
switchNavigationBlocked,
Expand Down Expand Up @@ -186,7 +188,10 @@ function PlayerNavigation(props: Props): JSX.Element {
<Text type='secondary'>{frameFilename}</Text>
</CVATTooltip>
</Col>
<Col offset={1}>
<Col className='cvat-player-frame-actions' offset={1}>
<CVATTooltip title='Copy frame filename'>
<CopyOutlined className='cvat-player-copy-frame-name-icon' onClick={onCopyFilenameIconClick} />
</CVATTooltip>
<CVATTooltip title='Create frame URL'>
<LinkOutlined className='cvat-player-frame-url-icon' onClick={onURLIconClick} />
</CVATTooltip>
Expand Down
3 changes: 3 additions & 0 deletions cvat-ui/src/components/annotation-page/top-bar/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ interface Props {
onSliderChange(value: number): void;
onInputChange(value: number): void;
onURLIconClick(): void;
onCopyFilenameIconClick(): void;
onUndoClick(): void;
onRedoClick(): void;
onFinishDraw(): void;
Expand Down Expand Up @@ -117,6 +118,7 @@ export default function AnnotationTopBarComponent(props: Props): JSX.Element {
onSliderChange,
onInputChange,
onURLIconClick,
onCopyFilenameIconClick,
onUndoClick,
onRedoClick,
onFinishDraw,
Expand Down Expand Up @@ -171,6 +173,7 @@ export default function AnnotationTopBarComponent(props: Props): JSX.Element {
onSliderChange={onSliderChange}
onInputChange={onInputChange}
onURLIconClick={onURLIconClick}
onCopyFilenameIconClick={onCopyFilenameIconClick}
onDeleteFrame={onDeleteFrame}
onRestoreFrame={onRestoreFrame}
switchNavigationBlocked={switchNavigationBlocked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
import { Canvas, CanvasMode } from 'cvat-canvas-wrapper';
import { Canvas3d } from 'cvat-canvas3d-wrapper';
import { filterApplicableLabels } from 'utils/filter-applicable-labels';
import { toClipboard } from 'utils/to-clipboard';

interface OwnProps {
readonly: boolean;
Expand Down Expand Up @@ -233,16 +234,7 @@ class ObjectItemContainer extends React.PureComponent<Props, State> {
const search = `frame=${frameNumber}&type=${objectState.objectType}&serverID=${objectState.serverID}`;
const url = `${origin}${pathname}?${search}`;

const fallback = (): void => {
// eslint-disable-next-line
window.prompt('Browser Clipboard API not allowed, please copy manually', url);
};

if (window.isSecureContext) {
window.navigator.clipboard.writeText(url).catch(fallback);
} else {
fallback();
}
toClipboard(url);
};

private switchOrientation = (): void => {
Expand Down
17 changes: 8 additions & 9 deletions cvat-ui/src/containers/annotation-page/top-bar/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import isAbleToChangeFrame from 'utils/is-able-to-change-frame';
import { KeyMap } from 'utils/mousetrap-react';
import { switchToolsBlockerState } from 'actions/settings-actions';
import { writeLatestFrame } from 'utils/remember-latest-frame';
import { toClipboard } from 'utils/to-clipboard';

interface StateToProps {
jobInstance: Job;
Expand Down Expand Up @@ -567,16 +568,13 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
const { origin, pathname } = window.location;
const url = `${origin}${pathname}?frame=${frameNumber}`;

const fallback = (): void => {
// eslint-disable-next-line
window.prompt('Browser Clipboard API not allowed, please copy manually', url);
};
toClipboard(url);
};

if (window.isSecureContext) {
window.navigator.clipboard.writeText(url).catch(fallback);
} else {
fallback();
}
private onCopyFilenameIconClick = (): void => {
const { frameFilename } = this.props;

toClipboard(frameFilename);
};

private onDeleteFrame = (): void => {
Expand Down Expand Up @@ -670,6 +668,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
onSliderChange={this.onChangePlayerSliderValue}
onInputChange={this.onChangePlayerInputValue}
onURLIconClick={this.onURLIconClick}
onCopyFilenameIconClick={this.onCopyFilenameIconClick}
onDeleteFrame={this.onDeleteFrame}
onRestoreFrame={this.onRestoreFrame}
changeWorkspace={this.changeWorkspace}
Expand Down
16 changes: 16 additions & 0 deletions cvat-ui/src/utils/to-clipboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

export function toClipboard(text: string): void {
const fallback = (): void => {
// eslint-disable-next-line
window.prompt('Browser Clipboard API not allowed, please copy manually', text);
};

if (window.isSecureContext) {
window.navigator.clipboard.writeText(text).catch(fallback);
} else {
fallback();
}
}
2 changes: 1 addition & 1 deletion cvat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

from cvat.utils.version import get_version

VERSION = (2, 26, 0, "final", 0)
VERSION = (2, 26, 1, "final", 0)

__version__ = get_version(VERSION)
35 changes: 35 additions & 0 deletions cvat/apps/engine/migrations/0087_alter_label_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 4.2.17 on 2025-01-22 13:48

from django.db import migrations, models

import cvat.apps.engine.models


class Migration(migrations.Migration):

dependencies = [
("engine", "0086_profile_has_analytics_access"),
]

operations = [
migrations.AlterField(
model_name="label",
name="type",
field=models.CharField(
choices=[
("any", "ANY"),
("cuboid", "CUBOID"),
("ellipse", "ELLIPSE"),
("mask", "MASK"),
("points", "POINTS"),
("polygon", "POLYGON"),
("polyline", "POLYLINE"),
("rectangle", "RECTANGLE"),
("skeleton", "SKELETON"),
("tag", "TAG"),
],
default=cvat.apps.engine.models.LabelType["ANY"],
max_length=32,
),
),
]
12 changes: 6 additions & 6 deletions cvat/apps/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ def __str__(self):
return self.value

class LabelType(str, Enum):
BBOX = 'bbox'
ANY = 'any'
CUBOID = 'cuboid'
ELLIPSE = 'ellipse'
MASK = 'mask'
POINTS = 'points'
POLYGON = 'polygon'
POLYLINE = 'polyline'
POINTS = 'points'
CUBOID = 'cuboid'
CUBOID_3D = 'cuboid_3d'
RECTANGLE = 'rectangle'
SKELETON = 'skeleton'
TAG = 'tag'
ANY = 'any'

@classmethod
def choices(cls):
Expand Down Expand Up @@ -946,7 +946,7 @@ class Label(models.Model):
project = models.ForeignKey(Project, null=True, blank=True, on_delete=models.CASCADE)
name = SafeCharField(max_length=64)
color = models.CharField(default='', max_length=8)
type = models.CharField(max_length=32, null=True, choices=LabelType.choices(), default=LabelType.ANY)
type = models.CharField(max_length=32, choices=LabelType.choices(), default=LabelType.ANY)
parent = models.ForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name='sublabels')

def __str__(self):
Expand Down
4 changes: 2 additions & 2 deletions cvat/apps/engine/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class SublabelSerializer(serializers.ModelSerializer):
color = serializers.CharField(allow_blank=True, required=False,
help_text="The hex value for the RGB color. "
"Will be generated automatically, unless specified explicitly.")
type = serializers.CharField(allow_blank=True, required=False,
type = serializers.ChoiceField(choices=models.LabelType.choices(), required=False,
help_text="Associated annotation type for this label")
has_parent = serializers.BooleanField(source='has_parent_label', required=False)

Expand Down Expand Up @@ -418,7 +418,7 @@ def update_label(
try:
db_label = models.Label.create(
name=validated_data.get('name'),
type=validated_data.get('type'),
type=validated_data.get('type', models.LabelType.ANY),
parent=parent_label,
**parent_info
)
Expand Down
Loading

0 comments on commit 9c5ef99

Please sign in to comment.