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 using initial frame from query parameter #6506

Merged
merged 5 commits into from
Jul 19, 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
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);
});
});
});
});