Skip to content

Commit

Permalink
Fixed using initial frame from query parameter (cvat-ai#6506)
Browse files Browse the repository at this point in the history
<!-- 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 cvat-ai#6505 

### 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.
  • Loading branch information
bsekachev authored Jul 19, 2023
1 parent 19fefc5 commit 8de7722
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- \[SDK\] SDK should not change input data in models (<https://github.com/opencv/cvat/pull/6455>)
- 3D job can not be opened in validation mode (<https://github.com/opencv/cvat/pull/6507>)
- 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>)

### Security
- TDB
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.53.1",
"version": "1.53.3",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
9 changes: 5 additions & 4 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,10 +942,11 @@ export function getJobAsync(
if (report) conflicts = await cvat.analytics.quality.conflicts({ reportId: report.id });
}

// navigate to correct first frame according to setup
const frameNumber = (await job.frames.search(
{ notDeleted: !showDeletedFrames }, job.startFrame, job.stopFrame,
)) || job.startFrame;
// frame query parameter does not work for GT job
const frameNumber = Number.isInteger(initialFrame) && groundTruthJobId !== job.id ?
initialFrame : (await job.frames.search(
{ notDeleted: !showDeletedFrames }, job.startFrame, job.stopFrame,
)) || job.startFrame;

const frameData = await job.frames.get(frameNumber);
// call first getting of frame data before rendering interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

context('Paste labels from one task to another.', { browser: '!firefox' }, () => {
const task = {
name: 'Test "Continue frame N"',
name: 'Test "Continue/open frame N"',
label: 'Test label',
attrName: 'Test attribute',
attrValue: 'Test attribute value',
Expand Down Expand Up @@ -54,5 +54,15 @@ context('Paste labels from one task to another.', { browser: '!firefox' }, () =>
cy.get('.cvat-notification-continue-job-button').click();
cy.checkFrameNum(2);
});

it('Trying to open a frame using query parameter', () => {
cy.url().then(($url) => {
cy.visit('/projects');
cy.get('.cvat-projects-page').should('exist');
cy.visit($url, { qs: { frame: 2 } });
cy.get('.cvat-canvas-container').should('exist').and('be.visible');
cy.checkFrameNum(2);
});
});
});
});

0 comments on commit 8de7722

Please sign in to comment.