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

Fix included frames handling on UI #9155

Merged
merged 3 commits into from
Mar 3, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Invalid display of images in simple GT jobs
(<https://github.com/cvat-ai/cvat/pull/9155>)
8 changes: 8 additions & 0 deletions cvat-core/src/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ export class FramesMetaData {
if (initialData.frames.length === 1) {
// it may be a videofile or one image
framesInfo = frameNumbers.map(() => initialData.frames[0]);
} else if (this.includedFrames?.length) {
// Only simple GT jobs have includedFrames, so this condition works only for them
const framesNumbers = new Set(this.includedFrames.map((dataFrameNumber: number) => (
Math.floor((dataFrameNumber - this.startFrame) / this.frameStep)
)));
// Frames must contain placeholders on positions out of includedFrames.
// That is, we can use frames with indices corresponding to frame numbers
framesInfo = initialData.frames.filter((frame, idx) => framesNumbers.has(idx));
} else {
framesInfo = initialData.frames;
}
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/server-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export interface SerializedCloudStorage {
export interface SerializedFramesMetaData {
chunk_size: number;
deleted_frames: number[];
included_frames: number[];
included_frames: number[] | null;
frame_filter: string;
chunks_updated_date: string;
frames: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
} from 'cvat-core-wrapper';
import CVATTooltip from 'components/common/cvat-tooltip';
import { sorter, tablePaginationPageSize } from 'utils/quality';
import { ValidationMode } from 'components/create-task-page/quality-configuration-form';
import QualityTableHeader from './quality-table-header';

interface Props {
Expand Down Expand Up @@ -55,11 +54,8 @@ function AllocationTable(props: Readonly<Props>): JSX.Element | null {
const data = validationLayout.validationFrames.map((frame: number, index: number) => ({
key: frame,
frame,
name: gtJobMeta.frames[
// - gt job meta starts from the 0 task frame;
// - honeypot gt job meta starts from the job start frame;
(validationLayout.mode === ValidationMode.GT) ? frame : index
]?.name ?? gtJobMeta.frames[0].name,
// videos have only 1 frame in meta
name: gtJobMeta.frames[index]?.name ?? gtJobMeta.frames[0].name,
active: !disabledFrames.includes(frame),
}));

Expand Down
Loading