未验证 提交 c49ca710 编写于 作者: B Boris Sekachev 提交者: GitHub

Fixed rotation is lost during changing a mutable attribute (#5968)

<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
Resolved #5966 

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [x] I have added a description of my changes into the
[CHANGELOG](https://github.com/opencv/cvat/blob/develop/CHANGELOG.md)
file
- [ ] I have updated the documentation accordingly
- [x] I have added tests to cover my changes
- [x] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [x] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.

---------
Co-authored-by: NNikita Manovich <nikita@cvat.ai>
上级 791d93f0
......@@ -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
......
......@@ -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 = {
......@@ -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);
}
}
......
{
"name": "cvat-ui",
"version": "1.50.6",
"version": "1.50.7",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
......
// Copyright (C) 2021-2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
......@@ -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,
......@@ -18,7 +18,7 @@ context('Mutable attribute.', () => {
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
labelName: labelTrack,
labelName,
firstX: 260,
firstY: 200,
secondX: 360,
......@@ -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);
});
......@@ -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');
});
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册