Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed rotation is lost during changing a mutable attribute #5968

Merged
merged 6 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Points missing when exporting tracked skeleton (<https://github.com/opencv/cvat/issues/5497>)
- Escaping in the `filter` parameter in generated URLs
(<https://github.com/opencv/cvat/issues/5566>)
- Rotation property lost during saving a mutable attribute (<https://github.com/opencv/cvat/pull/5968>)
- Incorrect calculation of working time in analytics (<https://github.com/opencv/cvat/pull/5973>)

### Security
Expand Down
11 changes: 2 additions & 9 deletions cvat-core/src/annotations-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ export class Track extends Drawn {
this.shapes[frame].attributes[attrID] !== attributes[attrID];
}
}
let redoShape;
let redoShape: TrackedShape | undefined;
if (mutableAttributesUpdated) {
if (wasKeyframe) {
redoShape = {
Expand All @@ -1112,14 +1112,7 @@ export class Track extends Drawn {
},
};
} else {
redoShape = {
frame,
zOrder: current.zOrder,
points: current.points,
outside: current.outside,
occluded: current.occluded,
attributes: {},
};
redoShape = copyShape(current);
}
}

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": "1.50.6",
"version": "1.50.7",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
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 All @@ -7,8 +8,7 @@
import { taskName } from '../../support/const';

context('Mutable attribute.', () => {
const caseId = '70';
const labelTrack = `Case ${caseId}`;
const labelName = 'car';
const additionalAttrsLabelShape = [
{
additionalAttrName: 'tree', additionalValue: 'birch tree', typeAttribute: 'Text', mutable: true,
Expand All @@ -18,7 +18,7 @@ context('Mutable attribute.', () => {
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
labelName: labelTrack,
labelName,
firstX: 260,
firstY: 200,
secondX: 360,
Expand All @@ -45,15 +45,15 @@ context('Mutable attribute.', () => {

before(() => {
cy.openTask(taskName);
cy.addNewLabel(labelTrack, additionalAttrsLabelShape);
cy.addNewLabel(labelName, additionalAttrsLabelShape);
cy.openJob();
cy.createRectangle(createRectangleTrack2Points);
});

describe(`Testing case "${caseId}"`, () => {
describe('Check different use-cases with mutable attributes', () => {
it('Go to AAM. For the 2nd and 3rd frames, change the attribute value.', () => {
cy.changeWorkspace('Attribute annotation');
cy.changeLabelAAM(labelTrack);
cy.changeLabelAAM(labelName);
testChangingAttributeValue(additionalAttrsLabelShape[0].additionalValue, attrValueSecondFrame);
testChangingAttributeValue(attrValueSecondFrame, attrValueThirdFrame);
});
Expand All @@ -76,5 +76,32 @@ context('Mutable attribute.', () => {
checkObjectDetailValue(num, val);
});
});

it('Test attribute can be changed between two keyframes and can be selected after', () => {
cy.goCheckFrameNumber(0);
cy.removeAnnotations();
cy.createRectangle(createRectangleTrack2Points);
cy.goCheckFrameNumber(2);

cy.get('#cvat-objects-sidebar-state-item-1')
.within(() => {
cy.get('.cvat-object-item-button-keyframe').click();
cy.get('span').contains('DETAILS').click();
});

cy.goCheckFrameNumber(1);

cy.get('#cvat-objects-sidebar-state-item-1')
.within(() => {
cy.get('.cvat-object-item-text-attribute').should('exist').and('be.visible').clear();
cy.get('.cvat-object-item-text-attribute').type('new attribute value');
});

cy.get('body').click(); // deactivate
cy.get('#cvat_canvas_shape_1')
.trigger('mousemove')
.trigger('mouseover')
.should('have.class', 'cvat_canvas_shape_activated');
});
klakhov marked this conversation as resolved.
Show resolved Hide resolved
});
});