Skip to content

Commit

Permalink
Merge branch 'develop' into zm/prohibit-star-import
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Jan 9, 2025
2 parents aebfd97 + 2da1c9b commit 80ee15b
Show file tree
Hide file tree
Showing 234 changed files with 4,133 additions and 2,655 deletions.
30 changes: 3 additions & 27 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: files
uses: tj-actions/[email protected]
with:
files: |
cvat-sdk/**/*.py
cvat-cli/**/*.py
tests/python/**/*.py
cvat/apps/quality_control/**/*.py
cvat/apps/analytics_report/**/*.py
dir_names: true

- name: Run checks
run: |
# If different modules use different isort configs,
# we need to run isort for each python component group separately.
# Otherwise, they all will use the same config.
pipx install $(grep "^isort" ./dev/requirements.txt)
UPDATED_DIRS="${{steps.files.outputs.all_changed_files}}"
echo "isort version: $(isort --version-number)"
if [[ ! -z $UPDATED_DIRS ]]; then
pipx install $(grep "^isort" ./dev/requirements.txt)
echo "isort version: $(isort --version-number)"
echo "The dirs will be checked: $UPDATED_DIRS"
EXIT_CODE=0
for DIR in $UPDATED_DIRS; do
isort --check $DIR || EXIT_CODE=$(($? | $EXIT_CODE)) || true
done
exit $EXIT_CODE
else
echo "No files with the \"py\" extension found"
fi
isort --check --diff --resolve-all-configs .
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

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

<a id='changelog-2.25.0'></a>
## \[2.25.0\] - 2025-01-09

### Added

- \[CLI\] Added commands for working with native functions
(<https://github.com/cvat-ai/cvat/pull/8821>)

- Ultralytics YOLO formats now support tracks
(<https://github.com/cvat-ai/cvat/pull/8883>)

### Changed

- YOLOv8 formats renamed to Ultralytics YOLO formats
(<https://github.com/cvat-ai/cvat/pull/8863>)

- The `match_empty_frames` quality setting is changed to `empty_is_annotated`.
The updated option includes any empty frames in the final metrics instead of only
matching empty frames. This makes metrics such as Precision much more representative and useful.
(<https://github.com/cvat-ai/cvat/pull/8888>)

### Fixed

- Changing rotation after export/import in Ultralytics YOLO Oriented Boxes format
(<https://github.com/cvat-ai/cvat/pull/8891>)

- Export to yolo formats if both Train and default dataset are present
(<https://github.com/cvat-ai/cvat/pull/8884>)

- Issue with deleting frames
(<https://github.com/cvat-ai/cvat/pull/8872>)

<a id='changelog-2.24.0'></a>
## \[2.24.0\] - 2024-12-20

Expand Down
4 changes: 0 additions & 4 deletions changelog.d/20241212_193004_roman_cli_agent.md

This file was deleted.

This file was deleted.

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.24.1
cvat-sdk==2.25.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.24.1"
VERSION = "2.25.1"
14 changes: 7 additions & 7 deletions cvat-core/src/quality-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class QualitySettings {
#objectVisibilityThreshold: number;
#panopticComparison: boolean;
#compareAttributes: boolean;
#matchEmptyFrames: boolean;
#emptyIsAnnotated: boolean;
#descriptions: Record<string, string>;

constructor(initialData: SerializedQualitySettingsData) {
Expand All @@ -60,7 +60,7 @@ export default class QualitySettings {
this.#objectVisibilityThreshold = initialData.object_visibility_threshold;
this.#panopticComparison = initialData.panoptic_comparison;
this.#compareAttributes = initialData.compare_attributes;
this.#matchEmptyFrames = initialData.match_empty_frames;
this.#emptyIsAnnotated = initialData.empty_is_annotated;
this.#descriptions = initialData.descriptions;
}

Expand Down Expand Up @@ -200,12 +200,12 @@ export default class QualitySettings {
this.#maxValidationsPerJob = newVal;
}

get matchEmptyFrames(): boolean {
return this.#matchEmptyFrames;
get emptyIsAnnotated(): boolean {
return this.#emptyIsAnnotated;
}

set matchEmptyFrames(newVal: boolean) {
this.#matchEmptyFrames = newVal;
set emptyIsAnnotated(newVal: boolean) {
this.#emptyIsAnnotated = newVal;
}

get descriptions(): Record<string, string> {
Expand Down Expand Up @@ -236,7 +236,7 @@ export default class QualitySettings {
target_metric: this.#targetMetric,
target_metric_threshold: this.#targetMetricThreshold,
max_validations_per_job: this.#maxValidationsPerJob,
match_empty_frames: this.#matchEmptyFrames,
empty_is_annotated: this.#emptyIsAnnotated,
};

return result;
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/server-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export interface SerializedQualitySettingsData {
object_visibility_threshold?: number;
panoptic_comparison?: boolean;
compare_attributes?: boolean;
match_empty_frames?: boolean;
empty_is_annotated?: boolean;
descriptions?: Record<string, string>;
}

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.24.1"
VERSION="2.25.1"
LIB_NAME="cvat_sdk"
LAYER1_LIB_NAME="${LIB_NAME}/api_client"
DST_DIR="$(cd "$(dirname -- "$0")/.." && pwd)"
Expand Down
1 change: 1 addition & 0 deletions cvat-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ profile = "black"
forced_separate = ["tests"]
line_length = 100
skip_gitignore = true # align tool behavior with Black
known_first_party = ["cvat_sdk"]
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function QualityControlPage(): JSX.Element {
settings.lowOverlapThreshold = values.lowOverlapThreshold / 100;
settings.iouThreshold = values.iouThreshold / 100;
settings.compareAttributes = values.compareAttributes;
settings.matchEmptyFrames = values.matchEmptyFrames;
settings.emptyIsAnnotated = values.emptyIsAnnotated;

settings.oksSigma = values.oksSigma / 100;
settings.pointSizeBase = values.pointSizeBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function QualitySettingsForm(props: Readonly<Props>): JSX.Element
lowOverlapThreshold: settings.lowOverlapThreshold * 100,
iouThreshold: settings.iouThreshold * 100,
compareAttributes: settings.compareAttributes,
matchEmptyFrames: settings.matchEmptyFrames,
emptyIsAnnotated: settings.emptyIsAnnotated,

oksSigma: settings.oksSigma * 100,
pointSizeBase: settings.pointSizeBase,
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function QualitySettingsForm(props: Readonly<Props>): JSX.Element
{makeTooltipFragment('Target metric', targetMetricDescription)}
{makeTooltipFragment('Target metric threshold', settings.descriptions.targetMetricThreshold)}
{makeTooltipFragment('Compare attributes', settings.descriptions.compareAttributes)}
{makeTooltipFragment('Match empty frames', settings.descriptions.matchEmptyFrames)}
{makeTooltipFragment('Empty frames are annotated', settings.descriptions.emptyIsAnnotated)}
</>,
);

Expand Down Expand Up @@ -198,12 +198,12 @@ export default function QualitySettingsForm(props: Readonly<Props>): JSX.Element
</Col>
<Col span={12}>
<Form.Item
name='matchEmptyFrames'
name='emptyIsAnnotated'
valuePropName='checked'
rules={[{ required: true }]}
>
<Checkbox>
<Text className='cvat-text-color'>Match empty frames</Text>
<Text className='cvat-text-color'>Empty frames are annotated</Text>
</Checkbox>
</Form.Item>
</Col>
Expand Down
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, 24, 1, "alpha", 0)
VERSION = (2, 25, 1, "alpha", 0)

__version__ = get_version(VERSION)
10 changes: 5 additions & 5 deletions cvat/apps/dataset_manager/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
#
# SPDX-License-Identifier: MIT

from copy import copy, deepcopy

import math
from collections.abc import Container, Sequence
from copy import copy, deepcopy
from itertools import chain
from typing import Optional

import numpy as np
from itertools import chain
from scipy.optimize import linear_sum_assignment
from shapely import geometry

from cvat.apps.engine.models import ShapeType, DimensionType
from cvat.apps.engine.serializers import LabeledDataSerializer
from cvat.apps.dataset_manager.util import faster_deepcopy
from cvat.apps.engine.models import DimensionType, ShapeType
from cvat.apps.engine.serializers import LabeledDataSerializer


class AnnotationIR:
Expand Down
34 changes: 24 additions & 10 deletions cvat/apps/dataset_manager/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,39 @@
from types import SimpleNamespace
from typing import Any, Callable, Literal, NamedTuple, Optional, Union

from attrs.converters import to_bool
import datumaro as dm
import defusedxml.ElementTree as ET
import rq
from attr import attrib, attrs
from attrs.converters import to_bool
from datumaro.components.format_detection import RejectionReason
from django.conf import settings
from django.db.models import Prefetch, QuerySet
from django.utils import timezone
from django.conf import settings

from cvat.apps.dataset_manager.formats.utils import get_label_color
from cvat.apps.dataset_manager.util import add_prefetch_fields
from cvat.apps.engine import models
from cvat.apps.engine.frame_provider import TaskFrameProvider, FrameQuality, FrameOutputType
from cvat.apps.engine.models import (AttributeSpec, AttributeType, DimensionType, Job,
JobType, Label, LabelType, Project, SegmentType, ShapeType,
Task)
from cvat.apps.engine.rq_job_handler import RQJobMetaField
from cvat.apps.engine.frame_provider import FrameOutputType, FrameQuality, TaskFrameProvider
from cvat.apps.engine.lazy_list import LazyList
from cvat.apps.engine.models import (
AttributeSpec,
AttributeType,
DimensionType,
Job,
JobType,
Label,
LabelType,
Project,
SegmentType,
ShapeType,
Task,
)
from cvat.apps.engine.rq_job_handler import RQJobMetaField

from .annotation import AnnotationIR, AnnotationManager, TrackManager
from .formats.transformations import MaskConverter, EllipsesToMasks
from ..engine.log import ServerLogManager
from .annotation import AnnotationIR, AnnotationManager, TrackManager
from .formats.transformations import EllipsesToMasks, MaskConverter

slogger = ServerLogManager(__name__)

Expand Down Expand Up @@ -2175,7 +2185,11 @@ def import_dm_annotations(dm_dataset: dm.Dataset, instance_data: Union[ProjectDa
'coco',
'coco_instances',
'coco_person_keypoints',
'voc'
'voc',
'yolo_ultralytics_detection',
'yolo_ultralytics_segmentation',
'yolo_ultralytics_oriented_boxes',
'yolo_ultralytics_pose',
]

label_cat = dm_dataset.categories()[dm.AnnotationType.label]
Expand Down
5 changes: 2 additions & 3 deletions cvat/apps/dataset_manager/formats/camvid.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
from datumaro.components.dataset import Dataset
from pyunpack import Archive

from cvat.apps.dataset_manager.bindings import (GetCVATDataExtractor,
import_dm_annotations)
from cvat.apps.dataset_manager.bindings import GetCVATDataExtractor, import_dm_annotations
from cvat.apps.dataset_manager.util import make_zip_archive

from .transformations import MaskToPolygonTransformation, RotatedBoxesToPolygons
from .registry import dm_env, exporter, importer
from .transformations import MaskToPolygonTransformation, RotatedBoxesToPolygons
from .utils import make_colormap


Expand Down
11 changes: 7 additions & 4 deletions cvat/apps/dataset_manager/formats/cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
import os.path as osp

from datumaro.components.dataset import Dataset
from datumaro.plugins.cityscapes_format import write_label_map
from datumaro.plugins.data_formats.cityscapes import write_label_map
from pyunpack import Archive

from cvat.apps.dataset_manager.bindings import (GetCVATDataExtractor, detect_dataset,
import_dm_annotations)
from cvat.apps.dataset_manager.bindings import (
GetCVATDataExtractor,
detect_dataset,
import_dm_annotations,
)
from cvat.apps.dataset_manager.util import make_zip_archive

from .transformations import MaskToPolygonTransformation, RotatedBoxesToPolygons
from .registry import dm_env, exporter, importer
from .transformations import MaskToPolygonTransformation, RotatedBoxesToPolygons
from .utils import make_colormap


Expand Down
10 changes: 7 additions & 3 deletions cvat/apps/dataset_manager/formats/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@

import zipfile

from datumaro.components.dataset import Dataset
from datumaro.components.annotation import AnnotationType
from datumaro.plugins.coco_format.importer import CocoImporter
from datumaro.components.dataset import Dataset
from datumaro.plugins.data_formats.coco.importer import CocoImporter

from cvat.apps.dataset_manager.bindings import (
GetCVATDataExtractor, NoMediaInAnnotationFileError, import_dm_annotations, detect_dataset
GetCVATDataExtractor,
NoMediaInAnnotationFileError,
detect_dataset,
import_dm_annotations,
)
from cvat.apps.dataset_manager.util import make_zip_archive

from .registry import dm_env, exporter, importer


@exporter(name='COCO', ext='ZIP', version='1.0')
def _export(dst_file, temp_dir, instance_data, save_images=False):
with GetCVATDataExtractor(instance_data, include_images=save_images) as extractor:
Expand Down
Loading

0 comments on commit 80ee15b

Please sign in to comment.