diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fdfc720bbb6..f19dbace3a98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 + +## \[2.26.1\] - 2025-01-29 + +### Added + +- A button to copy a filename of the image into the clipboard + () + +### Changed + +- Changed location of events cache dir + () + +### Removed + +- \[Helm\] Removed `disableDistinctCachePerService` settings + () + +### Fixed + +- The backend now rejects invalid label types + () + +- \[Helm\] Impossible to download exported annotations + () + ## \[2.26.0\] - 2025-01-27 diff --git a/cvat-cli/requirements/base.txt b/cvat-cli/requirements/base.txt index 250770926d6a..bea402979e5b 100644 --- a/cvat-cli/requirements/base.txt +++ b/cvat-cli/requirements/base.txt @@ -1,4 +1,4 @@ -cvat-sdk==2.26.0 +cvat-sdk==2.26.1 attrs>=24.2.0 Pillow>=10.3.0 diff --git a/cvat-cli/src/cvat_cli/version.py b/cvat-cli/src/cvat_cli/version.py index 2933bf50fe86..d4640239b8ee 100644 --- a/cvat-cli/src/cvat_cli/version.py +++ b/cvat-cli/src/cvat_cli/version.py @@ -1 +1 @@ -VERSION = "2.26.0" +VERSION = "2.26.1" diff --git a/cvat-sdk/cvat_sdk/auto_annotation/interface.py b/cvat-sdk/cvat_sdk/auto_annotation/interface.py index 81c8e488c5a1..28275b83b346 100644 --- a/cvat-sdk/cvat_sdk/auto_annotation/interface.py +++ b/cvat-sdk/cvat_sdk/auto_annotation/interface.py @@ -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) diff --git a/cvat-sdk/gen/generate.sh b/cvat-sdk/gen/generate.sh index 8bd1e827cd0c..52a32e9155a4 100755 --- a/cvat-sdk/gen/generate.sh +++ b/cvat-sdk/gen/generate.sh @@ -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)" diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 5b6fb12aa699..fb7cf38d9611 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -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": { diff --git a/cvat-ui/src/components/annotation-page/styles.scss b/cvat-ui/src/components/annotation-page/styles.scss index 42583c1121ec..daebce15aa7d 100644 --- a/cvat-ui/src/components/annotation-page/styles.scss +++ b/cvat-ui/src/components/annotation-page/styles.scss @@ -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; @@ -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 { diff --git a/cvat-ui/src/components/annotation-page/top-bar/player-navigation.tsx b/cvat-ui/src/components/annotation-page/top-bar/player-navigation.tsx index 8c72a2ce6e4f..7b74ca2a5c07 100644 --- a/cvat-ui/src/components/annotation-page/top-bar/player-navigation.tsx +++ b/cvat-ui/src/components/annotation-page/top-bar/player-navigation.tsx @@ -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'; @@ -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; @@ -79,6 +80,7 @@ function PlayerNavigation(props: Props): JSX.Element { onSliderChange, onInputChange, onURLIconClick, + onCopyFilenameIconClick, onDeleteFrame, onRestoreFrame, switchNavigationBlocked, @@ -186,7 +188,10 @@ function PlayerNavigation(props: Props): JSX.Element { {frameFilename} - + + + + diff --git a/cvat-ui/src/components/annotation-page/top-bar/top-bar.tsx b/cvat-ui/src/components/annotation-page/top-bar/top-bar.tsx index a50af9299d37..aabdaaef1626 100644 --- a/cvat-ui/src/components/annotation-page/top-bar/top-bar.tsx +++ b/cvat-ui/src/components/annotation-page/top-bar/top-bar.tsx @@ -61,6 +61,7 @@ interface Props { onSliderChange(value: number): void; onInputChange(value: number): void; onURLIconClick(): void; + onCopyFilenameIconClick(): void; onUndoClick(): void; onRedoClick(): void; onFinishDraw(): void; @@ -117,6 +118,7 @@ export default function AnnotationTopBarComponent(props: Props): JSX.Element { onSliderChange, onInputChange, onURLIconClick, + onCopyFilenameIconClick, onUndoClick, onRedoClick, onFinishDraw, @@ -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} diff --git a/cvat-ui/src/containers/annotation-page/standard-workspace/objects-side-bar/object-item.tsx b/cvat-ui/src/containers/annotation-page/standard-workspace/objects-side-bar/object-item.tsx index c31b9d2804bd..39a8909bf539 100644 --- a/cvat-ui/src/containers/annotation-page/standard-workspace/objects-side-bar/object-item.tsx +++ b/cvat-ui/src/containers/annotation-page/standard-workspace/objects-side-bar/object-item.tsx @@ -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; @@ -233,16 +234,7 @@ class ObjectItemContainer extends React.PureComponent { 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 => { diff --git a/cvat-ui/src/containers/annotation-page/top-bar/top-bar.tsx b/cvat-ui/src/containers/annotation-page/top-bar/top-bar.tsx index 5c1c971beb5b..354e88b0ad42 100644 --- a/cvat-ui/src/containers/annotation-page/top-bar/top-bar.tsx +++ b/cvat-ui/src/containers/annotation-page/top-bar/top-bar.tsx @@ -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; @@ -567,16 +568,13 @@ class AnnotationTopBarContainer extends React.PureComponent { 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 => { @@ -670,6 +668,7 @@ class AnnotationTopBarContainer extends React.PureComponent { onSliderChange={this.onChangePlayerSliderValue} onInputChange={this.onChangePlayerInputValue} onURLIconClick={this.onURLIconClick} + onCopyFilenameIconClick={this.onCopyFilenameIconClick} onDeleteFrame={this.onDeleteFrame} onRestoreFrame={this.onRestoreFrame} changeWorkspace={this.changeWorkspace} diff --git a/cvat-ui/src/utils/to-clipboard.ts b/cvat-ui/src/utils/to-clipboard.ts new file mode 100644 index 000000000000..bc2a125577ef --- /dev/null +++ b/cvat-ui/src/utils/to-clipboard.ts @@ -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(); + } +} diff --git a/cvat/__init__.py b/cvat/__init__.py index cbd559556988..c5f4f83e5cd5 100644 --- a/cvat/__init__.py +++ b/cvat/__init__.py @@ -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) diff --git a/cvat/apps/engine/migrations/0087_alter_label_type.py b/cvat/apps/engine/migrations/0087_alter_label_type.py new file mode 100644 index 000000000000..fc55e7bc2c23 --- /dev/null +++ b/cvat/apps/engine/migrations/0087_alter_label_type.py @@ -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, + ), + ), + ] diff --git a/cvat/apps/engine/models.py b/cvat/apps/engine/models.py index 375e608d3b82..ff4213bc5da8 100644 --- a/cvat/apps/engine/models.py +++ b/cvat/apps/engine/models.py @@ -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): @@ -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): diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index af8bfc759f2b..bf5dbdc7b363 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -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) @@ -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 ) diff --git a/cvat/schema.yml b/cvat/schema.yml index 3524c606674d..4bbc544d86c8 100644 --- a/cvat/schema.yml +++ b/cvat/schema.yml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: CVAT REST API - version: 2.26.0 + version: 2.26.1 description: REST API for Computer Vision Annotation Tool (CVAT) termsOfService: https://www.google.com/policies/terms/ contact: @@ -2809,16 +2809,16 @@ paths: schema: type: string enum: - - bbox + - any + - cuboid - ellipse + - mask + - points - polygon - polyline - - points - - cuboid - - cuboid_3d + - rectangle - skeleton - tag - - any tags: - labels security: @@ -8487,8 +8487,21 @@ components: description: The list of attributes. If you want to remove an attribute, you need to recreate the label and specify the remaining attributes. type: - type: string - description: Associated annotation type for this label + allOf: + - $ref: '#/components/schemas/LabelType' + description: |- + Associated annotation type for this label + + * `any` - ANY + * `cuboid` - CUBOID + * `ellipse` - ELLIPSE + * `mask` - MASK + * `points` - POINTS + * `polygon` - POLYGON + * `polyline` - POLYLINE + * `rectangle` - RECTANGLE + * `skeleton` - SKELETON + * `tag` - TAG svg: type: string sublabels: @@ -8531,6 +8544,30 @@ components: a parent label required: - name + LabelType: + enum: + - any + - cuboid + - ellipse + - mask + - points + - polygon + - polyline + - rectangle + - skeleton + - tag + type: string + description: |- + * `any` - ANY + * `cuboid` - CUBOID + * `ellipse` - ELLIPSE + * `mask` - MASK + * `points` - POINTS + * `polygon` - POLYGON + * `polyline` - POLYLINE + * `rectangle` - RECTANGLE + * `skeleton` - SKELETON + * `tag` - TAG LabeledData: type: object properties: @@ -9589,8 +9626,21 @@ components: description: Delete the label. Only applicable in the PATCH methods of a project or a task. type: - type: string - description: Associated annotation type for this label + allOf: + - $ref: '#/components/schemas/LabelType' + description: |- + Associated annotation type for this label + + * `any` - ANY + * `cuboid` - CUBOID + * `ellipse` - ELLIPSE + * `mask` - MASK + * `points` - POINTS + * `polygon` - POLYGON + * `polyline` - POLYLINE + * `rectangle` - RECTANGLE + * `skeleton` - SKELETON + * `tag` - TAG svg: type: string sublabels: @@ -10764,8 +10814,21 @@ components: description: The list of attributes. If you want to remove an attribute, you need to recreate the label and specify the remaining attributes. type: - type: string - description: Associated annotation type for this label + allOf: + - $ref: '#/components/schemas/LabelType' + description: |- + Associated annotation type for this label + + * `any` - ANY + * `cuboid` - CUBOID + * `ellipse` - ELLIPSE + * `mask` - MASK + * `points` - POINTS + * `polygon` - POLYGON + * `polyline` - POLYLINE + * `rectangle` - RECTANGLE + * `skeleton` - SKELETON + * `tag` - TAG has_parent: type: boolean required: @@ -10804,8 +10867,21 @@ components: description: The list of attributes. If you want to remove an attribute, you need to recreate the label and specify the remaining attributes. type: - type: string - description: Associated annotation type for this label + allOf: + - $ref: '#/components/schemas/LabelType' + description: |- + Associated annotation type for this label + + * `any` - ANY + * `cuboid` - CUBOID + * `ellipse` - ELLIPSE + * `mask` - MASK + * `points` - POINTS + * `polygon` - POLYGON + * `polyline` - POLYLINE + * `rectangle` - RECTANGLE + * `skeleton` - SKELETON + * `tag` - TAG has_parent: type: boolean required: diff --git a/cvat/settings/base.py b/cvat/settings/base.py index ffb67869083a..03aaa1a27c03 100644 --- a/cvat/settings/base.py +++ b/cvat/settings/base.py @@ -432,7 +432,7 @@ class CVAT_QUEUES(Enum): EXPORT_CACHE_ROOT = os.path.join(CACHE_ROOT, 'export') os.makedirs(EXPORT_CACHE_ROOT, exist_ok=True) -EVENTS_LOCAL_DB_ROOT = os.path.join(CACHE_ROOT, 'events') +EVENTS_LOCAL_DB_ROOT = os.path.join(BASE_DIR, 'events') os.makedirs(EVENTS_LOCAL_DB_ROOT, exist_ok=True) EVENTS_LOCAL_DB_FILE = os.path.join( EVENTS_LOCAL_DB_ROOT, @@ -662,6 +662,7 @@ class CVAT_QUEUES(Enum): 'COMPONENT_SPLIT_REQUEST': True, 'ENUM_NAME_OVERRIDES': { + 'LabelType': 'cvat.apps.engine.models.LabelType', 'ShapeType': 'cvat.apps.engine.models.ShapeType', 'OperationStatus': 'cvat.apps.engine.models.StateChoice', 'ChunkType': 'cvat.apps.engine.models.DataChoice', diff --git a/docker-compose.yml b/docker-compose.yml index bda501c46def..e48a59ba4463 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,7 +81,7 @@ services: cvat_server: container_name: cvat_server - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: <<: *backend-deps @@ -115,7 +115,7 @@ services: cvat_utils: container_name: cvat_utils - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -132,7 +132,7 @@ services: cvat_worker_import: container_name: cvat_worker_import - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -148,7 +148,7 @@ services: cvat_worker_export: container_name: cvat_worker_export - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -164,7 +164,7 @@ services: cvat_worker_annotation: container_name: cvat_worker_annotation - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -180,7 +180,7 @@ services: cvat_worker_webhooks: container_name: cvat_worker_webhooks - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -196,7 +196,7 @@ services: cvat_worker_quality_reports: container_name: cvat_worker_quality_reports - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -212,7 +212,7 @@ services: cvat_worker_analytics_reports: container_name: cvat_worker_analytics_reports - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -228,7 +228,7 @@ services: cvat_worker_chunks: container_name: cvat_worker_chunks - image: cvat/server:${CVAT_VERSION:-v2.26.0} + image: cvat/server:${CVAT_VERSION:-v2.26.1} restart: always depends_on: *backend-deps environment: @@ -244,7 +244,7 @@ services: cvat_ui: container_name: cvat_ui - image: cvat/ui:${CVAT_VERSION:-v2.26.0} + image: cvat/ui:${CVAT_VERSION:-v2.26.1} restart: always depends_on: - cvat_server diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index 2f45438dd4f6..90c12f3ce4cb 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.14.1 +version: 0.14.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm-chart/templates/cvat_backend/server/deployment.yml b/helm-chart/templates/cvat_backend/server/deployment.yml index b94c6de19f88..28daf0da7cb7 100644 --- a/helm-chart/templates/cvat_backend/server/deployment.yml +++ b/helm-chart/templates/cvat_backend/server/deployment.yml @@ -80,10 +80,6 @@ spec: {{- toYaml (omit $localValues.livenessProbe "enabled") | nindent 12 }} {{- end }} volumeMounts: - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -110,10 +106,6 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -144,10 +136,6 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - name: cvat-backend-per-service-cache - emptyDir: {} - {{- end }} {{- end }} {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/utils/deployment.yml b/helm-chart/templates/cvat_backend/utils/deployment.yml index 434366fecebe..440f994b8b5a 100644 --- a/helm-chart/templates/cvat_backend/utils/deployment.yml +++ b/helm-chart/templates/cvat_backend/utils/deployment.yml @@ -64,10 +64,6 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -94,10 +90,6 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -128,10 +120,6 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - name: cvat-backend-per-service-cache - emptyDir: {} - {{- end }} {{- end }} {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml index 2ccfdfcbb5d7..a2439325ca45 100644 --- a/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_annotation/deployment.yml @@ -64,10 +64,6 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -97,10 +93,6 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -131,10 +123,6 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - name: cvat-backend-per-service-cache - emptyDir: {} - {{- end }} {{- end }} {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_export/deployment.yml b/helm-chart/templates/cvat_backend/worker_export/deployment.yml index 06211e7b2bf3..6cb755dbd01b 100644 --- a/helm-chart/templates/cvat_backend/worker_export/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_export/deployment.yml @@ -65,10 +65,6 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -98,10 +94,6 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -132,10 +124,6 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - name: cvat-backend-per-service-cache - emptyDir: {} - {{- end }} {{- end }} {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/templates/cvat_backend/worker_import/deployment.yml b/helm-chart/templates/cvat_backend/worker_import/deployment.yml index 6172e11ff0af..9124fe70c52a 100644 --- a/helm-chart/templates/cvat_backend/worker_import/deployment.yml +++ b/helm-chart/templates/cvat_backend/worker_import/deployment.yml @@ -64,10 +64,6 @@ spec: {{- $probeConfig := dict "args" $probeArgs "livenessProbe" $.Values.cvat.backend.worker.livenessProbe -}} {{ include "cvat.backend.worker.livenessProbe" $probeConfig | indent 10 }} volumeMounts: - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -97,10 +93,6 @@ spec: {{- end }} volumeMounts: {{- if .Values.cvat.backend.defaultStorage.enabled }} - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - mountPath: /home/django/data/cache - name: cvat-backend-per-service-cache - {{- end }} - mountPath: /home/django/data name: cvat-backend-data subPath: data @@ -131,10 +123,6 @@ spec: - name: cvat-backend-data persistentVolumeClaim: claimName: "{{ .Release.Name }}-backend-data" - {{- if not .Values.cvat.backend.disableDistinctCachePerService }} - - name: cvat-backend-per-service-cache - emptyDir: {} - {{- end }} {{- end }} {{- with concat .Values.cvat.backend.additionalVolumes $localValues.additionalVolumes }} {{- toYaml . | nindent 8 }} diff --git a/helm-chart/test.values.yaml b/helm-chart/test.values.yaml index 350cc384c178..bbdd843e9a22 100644 --- a/helm-chart/test.values.yaml +++ b/helm-chart/test.values.yaml @@ -3,7 +3,6 @@ cvat: defaultStorage: accessModes: - ReadWriteOnce - disableDistinctCachePerService: true server: additionalVolumeMounts: - mountPath: /home/django/share diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index cb6bef3f2515..329f74fe5aef 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -139,7 +139,7 @@ cvat: additionalVolumeMounts: [] replicas: 1 image: cvat/server - tag: v2.26.0 + tag: v2.26.1 imagePullPolicy: Always permissionFix: enabled: true @@ -158,11 +158,10 @@ cvat: # accessModes: # - ReadWriteMany size: 20Gi - disableDistinctCachePerService: false frontend: replicas: 1 image: cvat/ui - tag: v2.26.0 + tag: v2.26.1 imagePullPolicy: Always labels: {} # test: test diff --git a/serverless/pytorch/dschoerk/transt/nuclio/model_handler.py b/serverless/pytorch/dschoerk/transt/nuclio/model_handler.py index 826cdef55431..43c8ce37e739 100644 --- a/serverless/pytorch/dschoerk/transt/nuclio/model_handler.py +++ b/serverless/pytorch/dschoerk/transt/nuclio/model_handler.py @@ -18,20 +18,24 @@ def __init__(self): self.tracker = Tracker(name='transt', net=net, window_penalty=0.49, exemplar_size=128, instance_size=256) def decode_state(self, state): - self.tracker.net.net.zf = jsonpickle.decode(state['model.net.net.zf']) - self.tracker.net.net.pos_template = jsonpickle.decode(state['model.net.net.pos_template']) + # The server ensures that `state` is one of the values that the function itself + # has previously output. Therefore it should be safe to use jsonpickle. + decode = jsonpickle.decode # nosec: B301 - self.tracker.window = jsonpickle.decode(state['model.window']) - self.tracker.center_pos = jsonpickle.decode(state['model.center_pos']) - self.tracker.size = jsonpickle.decode(state['model.size']) - self.tracker.channel_average = jsonpickle.decode(state['model.channel_average']) - self.tracker.mean = jsonpickle.decode(state['model.mean']) - self.tracker.std = jsonpickle.decode(state['model.std']) - self.tracker.inplace = jsonpickle.decode(state['model.inplace']) + self.tracker.net.net.zf = decode(state['model.net.net.zf']) + self.tracker.net.net.pos_template = decode(state['model.net.net.pos_template']) + + self.tracker.window = decode(state['model.window']) + self.tracker.center_pos = decode(state['model.center_pos']) + self.tracker.size = decode(state['model.size']) + self.tracker.channel_average = decode(state['model.channel_average']) + self.tracker.mean = decode(state['model.mean']) + self.tracker.std = decode(state['model.std']) + self.tracker.inplace = decode(state['model.inplace']) self.tracker.features_initialized = False if 'model.features_initialized' in state: - self.tracker.features_initialized = jsonpickle.decode(state['model.features_initialized']) + self.tracker.features_initialized = decode(state['model.features_initialized']) def encode_state(self): state = {} diff --git a/serverless/pytorch/foolwood/siammask/nuclio/model_handler.py b/serverless/pytorch/foolwood/siammask/nuclio/model_handler.py index 4c97c20cf9d9..70c411b3fbe6 100644 --- a/serverless/pytorch/foolwood/siammask/nuclio/model_handler.py +++ b/serverless/pytorch/foolwood/siammask/nuclio/model_handler.py @@ -2,11 +2,16 @@ # # SPDX-License-Identifier: MIT -from tools.test import * import os from copy import copy + import jsonpickle import numpy as np +import torch + +from tools.test import siamese_init, siamese_track +from utils.config_helper import load_config +from utils.load_helper import load_pretrain class ModelHandler: def __init__(self): @@ -37,7 +42,9 @@ def encode_state(self, state): def decode_state(self, state): for k,v in state.items(): - state[k] = jsonpickle.decode(v) + # The server ensures that `state` is one of the values that the function itself + # has previously output. Therefore it should be safe to use jsonpickle. + state[k] = jsonpickle.decode(v) # nosec: B301 state['net'] = copy(self.siammask) state['net'].zf = state['net.zf'] diff --git a/site/content/en/docs/api_sdk/sdk/auto-annotation.md b/site/content/en/docs/api_sdk/sdk/auto-annotation.md index b50a680c7364..49fc192a801c 100644 --- a/site/content/en/docs/api_sdk/sdk/auto-annotation.md +++ b/site/content/en/docs/api_sdk/sdk/auto-annotation.md @@ -188,7 +188,7 @@ The following helpers are available for use in `detect`: | `keypoint` | `SubLabeledShapeRequest` | `frame=0`, `type="points"` | For `mask`, it is recommended to create the points list using -the `cvat.masks.encode_mask` function, which will convert a bitmap into a +the `cvat_sdk.masks.encode_mask` function, which will convert a bitmap into a list in the format that CVAT expects. For example: ```python diff --git a/site/content/en/docs/manual/advanced/xml_format.md b/site/content/en/docs/manual/advanced/xml_format.md index 8d08d8c154dc..d6a08e88c16e 100644 --- a/site/content/en/docs/manual/advanced/xml_format.md +++ b/site/content/en/docs/manual/advanced/xml_format.md @@ -40,7 +40,7 @@ For what is `rle`, see [Run-length encoding](https://en.wikipedia.org/wiki/Run-l