Skip to content

feature: shows number of annotated frames#6076

Merged
camiloHimura merged 7 commits intodevelopfrom
ccolora11/5903-number-annotated-frames
Apr 15, 2026
Merged

feature: shows number of annotated frames#6076
camiloHimura merged 7 commits intodevelopfrom
ccolora11/5903-number-annotated-frames

Conversation

@camiloHimura
Copy link
Copy Markdown
Contributor

@camiloHimura camiloHimura commented Apr 10, 2026

Summary

#5903 Dataset - for videos, the review status icon on the thumbnail should display the number of annotated frames out of the total (e.g. "44 / 350").

Gallery Sidebar
image image

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

Copilot AI review requested due to automatic review settings April 10, 2026 12:44
@camiloHimura camiloHimura added the Geti UI Issues related to Geti application frontend label Apr 10, 2026
@camiloHimura camiloHimura requested a review from a team as a code owner April 10, 2026 12:44
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

🐳 Docker image sizes

Device Size
xpu 10572.7 MB (10.32 GB)
cuda 10219.1 MB (9.98 GB)
cpu 3604.1 MB (3.52 GB)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds UI support for displaying “annotated frames / total frames” for video media items, and ensures relevant dataset media queries are refreshed after annotation updates so counts stay in sync.

Changes:

  • Update the video thumbnail indicator to show annotated_frame_count / frame_count.
  • Invalidate the dataset media listing query after saving annotations to refresh annotated frame counts.
  • Minor cleanup of $api params object formatting.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
application/ui/src/shared/annotator/annotation-actions-provider.component.tsx Adds invalidation for /dataset/media so media list data (incl. counts) refreshes after annotation saves.
application/ui/src/hooks/use-get-dataset-media-items.hook.ts Refactors the query params object formatting for the infinite media query.
application/ui/src/components/media-thumbnail/media-thumbnail.component.tsx Updates the video overlay label to display “annotated / total frames”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread application/ui/src/components/media-thumbnail/media-thumbnail.component.tsx Outdated
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

📊 Test coverage report

Metric Coverage
Lines 57.4%
Functions 79.0%
Branches 87.9%
Statements 57.4%

Comment thread application/ui/src/components/media-thumbnail/media-thumbnail.component.tsx Outdated
Comment thread application/ui/src/shared/annotator/annotation-actions-provider.component.tsx Outdated
Comment thread application/ui/src/shared/annotator/util.test.ts Outdated
incrementCachedAnnotatedFrameCount(queryClient, video2);

const data = getMediaQueryData(queryClient);
expect(data?.pages[0].items[0]).toEqual(expect.objectContaining({ annotated_frame_count: 2 }));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

video1.annotated_frame_count

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this being updated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that commit didn't go through but it is on now

Comment thread application/ui/src/shared/annotator/util.ts Outdated
@camiloHimura camiloHimura force-pushed the ccolora11/5903-number-annotated-frames branch from 5f8fe1b to 56a10d5 Compare April 14, 2026 15:10

import { InfiniteData, QueryClient } from '@tanstack/react-query';

import { SchemaMediaWithPagination } from '../../api/openapi-spec';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new type to shared-types and import that here instead of importing from openapi directly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -75,9 +78,7 @@ export const AnnotationActionsProvider = ({
[
'get',
'/api/projects/{project_id}/dataset/media/{media_id}/frames',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why dont we invalidate '/api/projects/{project_id}/dataset/media' and avoid doing the optimistic update with the new util?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my initial approach, but Copilot pointed out that for large datasets it would require refetching multiple pages, which could lead to performance degradation. #6076 (comment)

aria-label='annotated frames'
>
<Content>
<Text>Total frames: {frameCount}</Text>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the order should be reverted to stay consisted with the flow number of annotated / number of total

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

params: { path: { media_id: mediaItem.id, project_id: projectId }, query },
body: { annotations: annotationsDTO, subset: subset ?? undefined },
});
await saveMutation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For later: use try catch and move incrementCachedAnnotatedFrameCount and undoRedoActions.reset to the try block.

@camiloHimura camiloHimura force-pushed the ccolora11/5903-number-annotated-frames branch from abde538 to 18b45d3 Compare April 15, 2026 13:02
alignItems={'center'}
UNSAFE_className={classes.videoIndicator}
>
{formatDurationText(duration)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC Mariusz wants display the following:
45s = 0:45, not 00:00:45,
1h 45 min 30 s= 1:45:30, not 01:45:30

Could you please make sure that we can reuse formatDurationText?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a dedicated Pr for it

@camiloHimura camiloHimura added this pull request to the merge queue Apr 15, 2026
Merged via the queue into develop with commit 10dd0b0 Apr 15, 2026
37 checks passed
@camiloHimura camiloHimura deleted the ccolora11/5903-number-annotated-frames branch April 15, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti UI Issues related to Geti application frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants