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

Update Video data model with annotation statistics #391

Merged
merged 1 commit into from
Apr 22, 2024
Merged
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
19 changes: 19 additions & 0 deletions geti_sdk/data_models/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ def numpy(self) -> Optional[np.ndarray]:
return self._data


@attr.define(slots=False)
class VideoAnnotationStatistics:
"""
Annotation statistics for a video in Intel® Geti™.

:var annotated: Number of frames in the video that have been fully annotated
:var partially_annotated: Number of frames in the video that have been partially
annotated, meaning that one task in the task chain is still missing annotations
:var unannotated: Number of frames in the video that have not yet been annotated
"""

annotated: int
partially_annotated: int
unannotated: int


@attr.define(slots=False)
class Video(MediaItem):
"""
Expand All @@ -284,6 +300,9 @@ class Video(MediaItem):

media_information: VideoInformation = attr.field(kw_only=True)
matched_frames: Optional[int] = attr.field(kw_only=True, default=None, repr=False)
annotation_statistics: Optional[VideoAnnotationStatistics] = attr.field(
kw_only=True, default=None, repr=False
)

def __attrs_post_init__(self):
"""
Expand Down
Loading