Skip to content

Video: whole frame level classification tool - #389

Merged
jblake42 merged 24 commits into
devfrom
video/frame-label
Aug 28, 2026
Merged

Video: whole frame level classification tool#389
jblake42 merged 24 commits into
devfrom
video/frame-label

Conversation

@abdullah-ukaea

@abdullah-ukaea abdullah-ukaea commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Adds a new Frame Label tool to the video annotation UI for whole frame classification, so you can tag an entire frame with a class (e.g. UFO / no UFO) instead of drawing a bounding box.

  • Added a Frame Label tool to the annotation toolbar (use ctrl + click like other tools to draw)
  • Shows a small badge when the current frame has a label on the top left of the frame
  • Added the new video_frame_label annotation type
  • Reorganised the backend and frontend video annotation schemas around shared base types
  • Allows whole-frame classifier models (like ENEJETIC) save predictions directly, instead of faking a bounding box for a class with no location

Closes issue #225

whole frame label final ui

@abdullah-ukaea
abdullah-ukaea requested a review from wk9874 August 25, 2026 12:29
@abdullah-ukaea abdullah-ukaea self-assigned this Aug 25, 2026
@abdullah-ukaea

Copy link
Copy Markdown
Collaborator Author

Hi @wk9874 @praksharma please give this PR a go and let me know what you think

@abdullah-ukaea abdullah-ukaea added enhancement New feature or request UI labels Aug 25, 2026
@abdullah-ukaea
abdullah-ukaea marked this pull request as ready for review August 26, 2026 13:18
@abdullah-ukaea
abdullah-ukaea removed the request for review from wk9874 August 26, 2026 13:18
@abdullah-ukaea abdullah-ukaea changed the title [WIP] Video: whole frame level classification tool Video: whole frame level classification tool Aug 26, 2026
@abdullah-ukaea
abdullah-ukaea marked this pull request as draft August 27, 2026 09:48
@abdullah-ukaea
abdullah-ukaea marked this pull request as ready for review August 27, 2026 12:02
@abdullah-ukaea

Copy link
Copy Markdown
Collaborator Author

Ready for review now @jblake42

@jblake42

Copy link
Copy Markdown
Collaborator

From a functionality point of view this does not work in light mode I haven't looked at the code yet but my guess is it doesn't use spectrum correctly as this normally handles this.

I think having the actual image being annotated able to be moved underneath the label is not ideal as it can mask the label - I would say a more obvious position and size for the label is required

@jblake42

Copy link
Copy Markdown
Collaborator

I think having each added label as a separate badge would be cleaner and easier to parse as a user and also easier to manage from a UI perspective than a constantly growing and shrinking width single badge

@jblake42 jblake42 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please see the comments left in the main thread.

There are no specific code issue per-se here - I am starting to get concerns relating to extensibility as I can see this code getting a little messy again with various tool specific logic in the contexts. At some point I think we should have a freeze of functionality in the video section and see if there is anything we can do to standardise how tooling can be added (similar to what was done for plotly).

We have added a couple of non-annotorious tools now and there are still huge changes happening in the shared contexts etc.

Non of this is blocking for this functionality but I would like this to be a reasonable priority as it seems to be growing tech debt IMO

tool: DrawingTool,
): AnnotoriousDrawingTool {
return tool === "point" ? "rectangle" : tool;
return tool === "point" || tool === "frame" ? "rectangle" : tool;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I raised this last time as a risk and it has happened in the next PR - I worry about the architecture when we are having to tack on extra bits in logic to handle new tooling. I personally think from an extensibility point of view we have to consider how tooling is abstracted and how that can interface with the base tooling annotorious provides.

Otherwise I think we are going to get to the point where the video code gets very messy. I do understand this is hard when trying to interface with existing frameworks

Comment thread toktagger/ui/src/app/video/components/frame-annotator-host.tsx Outdated
left={frameLabelPopupPoint.x}
top={frameLabelPopupPoint.y}
>
{frameLabels.map((frameLabel) => (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Another benefit of having multiple badges (as per my comment on the PR) is that clicking on one badge with just bring up that popup which I think is more intuitve

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

agreed, the new functionality should have removed this now.

export type DrawingTool = "rectangle" | "polygon" | "point" | "frame";
export type ActiveDrawingTool = DrawingTool | null;
export type AnnotoriousDrawingTool = Exclude<DrawingTool, "point">;
export type AnnotoriousDrawingTool = Exclude<DrawingTool, "point" | "frame">;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

More places where little bits of extra logic has to be added whenever a tool is added - the concern is all of this has to be remembered when a dev adds functionality.

Comment thread toktagger/ui/src/app/video/components/video-session.tsx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Apologies for bringing this up again but I think it is important.

There are a huge amount of changes to the session context (preferably should be fairly tool agnostic) for the addition of another tool. This again rings some alarm bells for me about extensibility - I would expect us to be getting to the point where our contexts are pretty locked in now and the tooling logic can be handled more locally. I would say we are pretty close to that point with the plotly tooling almost all logic can now be contained within the actual tool specific file.

@abdullah-ukaea abdullah-ukaea linked an issue Aug 28, 2026 that may be closed by this pull request

@jblake42 jblake42 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am happy with this following our discussion relating to planning for an attempt to refactor. The changes made to the UI styling make it much clearer

@jblake42
jblake42 merged commit 97310ce into dev Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image Annotation: Support 'frame' labelling

2 participants