Skip to content

Commit

Permalink
Merge branch 'develop' into zm/clean-download-filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max authored Jul 21, 2023
2 parents aa334ba + ded24ad commit eef60f7
Show file tree
Hide file tree
Showing 46 changed files with 685 additions and 352 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ 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).

## \[Unreleased]
## \[Unreleased\]
### Added
- Multi-line text attributes supported (<https://github.com/opencv/cvat/pull/6458>)
- Now you can configure default attribute value for SELECT, RADIO types on UI
(<https://github.com/opencv/cvat/pull/6474>)
- \{SDK\] `cvat_sdk.datasets`, a framework-agnostic equivalent of `cvat_sdk.pytorch`
- \[SDK\] `cvat_sdk.datasets`, a framework-agnostic equivalent of `cvat_sdk.pytorch`
(<https://github.com/opencv/cvat/pull/6428>)

### Changed
Expand All @@ -28,16 +28,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- \[SDK\] Ability to create attributes with blank default values
(<https://github.com/opencv/cvat/pull/6454>)
- \[SDK\] SDK should not change input data in models (<https://github.com/opencv/cvat/pull/6455>)
- Export hash for shapes and tags in a corner case (<https://github.com/opencv/cvat/pull/6517>)
- 3D job can not be opened in validation mode (<https://github.com/opencv/cvat/pull/6507>)
- Fixed SAM plugin (403 code for workers in organizations) (<https://github.com/opencv/cvat/pull/6514>)
- Memory leak related to unclosed av container (<https://github.com/opencv/cvat/pull/6501>)
- Using initial frame from query parameter to open specific frame in a job
(<https://github.com/opencv/cvat/pull/6506>)
- Server-side validation for attribute specifications
(<https://github.com/opencv/cvat/pull/6447>)
- \[API\] File downloading failures for filenames with special characters l(<https://github.com/opencv/cvat/pull/6492>)

### Security
- TDB

## \[2.5.1\] - 2023-07-19
### Fixed
- Memory leak related to unclosed av container (<https://github.com/opencv/cvat/pull/6501>)

## \[2.5.0] - 2023-07-05
### Added
- Now CVAT supports project/task markdown description with additional assets
Expand Down
4 changes: 3 additions & 1 deletion cvat-core/src/annotations-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ export default class Collection {
frame: state.frame,
label_id: state.label.id,
group: 0,
source: state.source,
});
} else {
checkObjectType('state occluded', state.occluded, 'boolean', null);
Expand All @@ -839,6 +840,7 @@ export default class Collection {
frame: state.frame,
group: 0,
label_id: state.label.id,
outside: state.outside || false,
occluded: state.occluded || false,
points: state.shapeType === 'mask' ? (() => {
const { width, height } = this.frameMeta[state.frame];
Expand Down Expand Up @@ -903,7 +905,7 @@ export default class Collection {
frame: state.frame,
type: element.shapeType,
points: [...element.points],
zOrder: state.zOrder,
z_order: state.zOrder,
outside: element.outside || false,
occluded: element.occluded || false,
rotation: element.rotation || 0,
Expand Down
20 changes: 19 additions & 1 deletion cvat-core/src/annotations-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@ export class SkeletonShape extends Shape {
group: this.group,
z_order: this.zOrder,
rotation: 0,
elements: undefined,
}));

const result: RawShapeData = {
Expand Down Expand Up @@ -2891,7 +2892,24 @@ export class SkeletonTrack extends Track {
// Method is used to export data to the server
public toJSON(): RawTrackData {
const result: RawTrackData = Track.prototype.toJSON.call(this);
result.elements = this.elements.map((el) => el.toJSON());
result.elements = this.elements.map((el) => ({
...el.toJSON(),
elements: undefined,
source: this.source,
group: this.group,
}));
result.elements.forEach((element) => {
element.shapes.forEach((shape) => {
shape.rotation = 0;
const { frame } = shape;
const skeletonShape = result.shapes
.find((_skeletonShape) => _skeletonShape.frame === frame);
if (skeletonShape) {
shape.z_order = skeletonShape.z_order;
}
});
});

return result;
}

Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/plugins/sam_plugin/src/ts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ const samPlugin: SAMPlugin = {

const SAMModelPlugin: ComponentBuilder = ({ core }) => {
samPlugin.data.core = core;
core.plugins.register(samPlugin);
InferenceSession.create(samPlugin.data.modelURL).then((session) => {
samPlugin.data.session = session;
core.plugins.register(samPlugin);
});

return {
Expand Down
9 changes: 6 additions & 3 deletions cvat/apps/dataset_manager/tests/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ def _generate_task(self, images, **overrides):
"name": "parked",
"mutable": True,
"input_type": "checkbox",
"default_value": False
"default_value": "false",
"values": [],
},
]
},
Expand Down Expand Up @@ -561,7 +562,8 @@ def _generate_task(self, images):
"name": "parked",
"mutable": True,
"input_type": "checkbox",
"default_value": False
"default_value": "false",
"values": [],
},
]
},
Expand Down Expand Up @@ -723,7 +725,8 @@ def _generate_task(self, images, annotation_format, **overrides):
"name": "parked",
"mutable": True,
"input_type": "checkbox",
"default_value": False
"default_value": "false",
"values": [],
}
]
},
Expand Down
24 changes: 8 additions & 16 deletions cvat/apps/engine/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,30 +212,22 @@ class Meta:
'last_login': { 'allow_null': True }
}

class DelimitedStringListField(serializers.ListField):
def to_representation(self, value):
return super().to_representation(value.split('\n'))

def to_internal_value(self, data):
return '\n'.join(super().to_internal_value(data))

class AttributeSerializer(serializers.ModelSerializer):
values = serializers.ListField(allow_empty=True,
values = DelimitedStringListField(allow_empty=True,
child=serializers.CharField(allow_blank=True, max_length=200),
)

class Meta:
model = models.AttributeSpec
fields = ('id', 'name', 'mutable', 'input_type', 'default_value', 'values')

# pylint: disable=no-self-use
def to_internal_value(self, data):
attribute = data.copy()
attribute['values'] = '\n'.join(data.get('values', []))
return attribute

def to_representation(self, instance):
if instance:
rep = super().to_representation(instance)
rep['values'] = instance.values.split('\n')
else:
rep = instance

return rep

class SublabelSerializer(serializers.ModelSerializer):
id = serializers.IntegerField(required=False)
attributes = AttributeSerializer(many=True, source='attributespec_set', default=[],
Expand Down
15 changes: 10 additions & 5 deletions cvat/apps/engine/tests/test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,8 @@ def _create_project(project_data):
"name": "bool_attribute",
"mutable": True,
"input_type": AttributeType.CHECKBOX,
"default_value": "true"
"default_value": "true",
"values": [],
}],
}, {
"name": "person",
Expand Down Expand Up @@ -2572,7 +2573,8 @@ def test_api_v2_tasks_admin(self):
"name": "my_attribute",
"mutable": True,
"input_type": AttributeType.CHECKBOX,
"default_value": "true"
"default_value": "true",
"values": [],
}]
}]
}
Expand Down Expand Up @@ -2895,7 +2897,8 @@ def _create_task(task_data, media_data):
"name": "bool_attribute",
"mutable": True,
"input_type": AttributeType.CHECKBOX,
"default_value": "true"
"default_value": "true",
"values": [],
}],
}, {
"name": "person",
Expand All @@ -2915,7 +2918,8 @@ def _create_task(task_data, media_data):
"name": "bool_attribute",
"mutable": True,
"input_type": AttributeType.CHECKBOX,
"default_value": "true"
"default_value": "true",
"values": [],
}],
}, {
"name": "person",
Expand Down Expand Up @@ -4649,7 +4653,8 @@ def _create_task(self, owner, assignee, annotation_format=""):
"name": "parked",
"mutable": True,
"input_type": "checkbox",
"default_value": "false"
"default_value": "false",
"values": [],
},
]
},
Expand Down
6 changes: 4 additions & 2 deletions cvat/apps/lambda_manager/tests/assets/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"name": "parked",
"mutable": true,
"input_type": "checkbox",
"default_value": false
"default_value": "false",
"values": []
}
]
},
Expand Down Expand Up @@ -47,7 +48,8 @@
"name": "parked",
"mutable": true,
"input_type": "checkbox",
"default_value": false
"default_value": "false",
"values": []
}
]
},
Expand Down
4 changes: 4 additions & 0 deletions cvat/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ def __init__(self, *args, **kwargs):
config["ASYNC"] = False

super().__init__(*args, **kwargs)

# No need to profile unit tests
INSTALLED_APPS.remove('silk')
MIDDLEWARE.remove('silk.middleware.SilkyMiddleware')
6 changes: 6 additions & 0 deletions cvat/settings/testing_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@
QUALITY_CHECK_JOB_DELAY = 10000

IMPORT_CACHE_CLEAN_DELAY = timedelta(seconds=30)

# The tests should not fail due to high disk utilization of CI infrastructure that we have no control over
# But let's keep this check enabled
HEALTH_CHECK = {
'DISK_USAGE_MAX': 100, # percent
}
8 changes: 4 additions & 4 deletions tests/cypress/e2e/actions_objects/case_37_object_make_copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ context('Object make a copy.', () => {
const createEllipseShape = {
type: 'Shape',
labelName,
cx: 550,
cy: 100,
rightX: 600,
topY: 150,
firstX: 550,
firstY: 100,
secondX: 600,
secondY: 150,
};
const countObject = 6;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (C) 2021-2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -26,7 +27,7 @@ context('Save filtered object in AAM.', () => {
// Getting list of labels and create a label if neccessary
const labelsList = Array.from(doc.querySelectorAll('.cvat-constructor-viewer-item'));
if (labelsList.length < 2) {
cy.addNewLabel(newLabelName);
cy.addNewLabel({ name: newLabelName });
}
});
cy.document().then((doc) => {
Expand Down
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 @@ -80,7 +81,7 @@ context('Actions on polygon.', () => {

before(() => {
cy.openTask(taskName);
cy.addNewLabel(newLabelName);
cy.addNewLabel({ name: newLabelName });
cy.openJob();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (C) 2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -13,34 +14,34 @@ context('Actions on ellipse.', () => {
const createEllipseShape = {
type: 'Shape',
labelName,
cx: 250,
cy: 350,
rightX: 450,
topY: 280,
firstX: 250,
firstY: 350,
secondX: 450,
secondY: 280,
};
const createEllipseTrack = {
type: 'Track',
labelName,
cx: createEllipseShape.cx,
cy: createEllipseShape.cy - 150,
rightX: createEllipseShape.rightX,
topY: createEllipseShape.topY - 150,
firstX: createEllipseShape.firstX,
firstY: createEllipseShape.firstY - 150,
secondX: createEllipseShape.secondX,
secondY: createEllipseShape.secondY - 150,
};
const createEllipseShapeSwitchLabel = {
type: 'Shape',
labelName: newLabelName,
cx: createEllipseShape.cx + 250,
cy: createEllipseShape.cy,
rightX: createEllipseShape.rightX + 250,
topY: createEllipseShape.topY,
firstX: createEllipseShape.firstX + 250,
firstY: createEllipseShape.firstY,
secondX: createEllipseShape.secondX + 250,
secondY: createEllipseShape.secondY,
};
const createEllipseTrackSwitchLabel = {
type: 'Track',
labelName: newLabelName,
cx: createEllipseShape.cx + 250,
cy: createEllipseShape.cy - 150,
rightX: createEllipseShape.rightX + 250,
topY: createEllipseShape.topY - 150,
firstX: createEllipseShape.firstX + 250,
firstY: createEllipseShape.firstY - 150,
secondX: createEllipseShape.secondX + 250,
secondY: createEllipseShape.secondY - 150,
};

function testCompareRotate(shape, toFrame) {
Expand All @@ -58,7 +59,7 @@ context('Actions on ellipse.', () => {

before(() => {
cy.openTask(taskName);
cy.addNewLabel(newLabelName);
cy.addNewLabel({ name: newLabelName });
cy.openJob();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2020-2022 Intel Corporation
//
// Copyright (C) 2023 CVAT.ai Corporation
// SPDX-License-Identifier: MIT

/// <reference types="cypress" />
Expand Down Expand Up @@ -74,7 +74,7 @@ context('Actions on polylines.', () => {

before(() => {
cy.openTask(taskName);
cy.addNewLabel(newLabelName);
cy.addNewLabel({ name: newLabelName });
cy.openJob();
});

Expand Down
Loading

0 comments on commit eef60f7

Please sign in to comment.