From f11185f2d57d81aa566540b2478be24fb30c563e Mon Sep 17 00:00:00 2001 From: Ankit raj <113342181+ankit-v2-3@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:33:14 +0530 Subject: [PATCH] feat: add scene metadata --- videodb/__about__.py | 2 +- videodb/scene.py | 6 +++++- videodb/video.py | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/videodb/__about__.py b/videodb/__about__.py index 6a88c81..d152662 100644 --- a/videodb/__about__.py +++ b/videodb/__about__.py @@ -1,7 +1,7 @@ """ About information for videodb sdk""" -__version__ = "0.2.10" +__version__ = "0.2.11" __title__ = "videodb" __author__ = "videodb" __email__ = "contact@videodb.io" diff --git a/videodb/scene.py b/videodb/scene.py index 3bb1028..ebc1cf0 100644 --- a/videodb/scene.py +++ b/videodb/scene.py @@ -14,6 +14,7 @@ def __init__( description: str, id: str = None, frames: List[Frame] = [], + metadata: dict = {}, connection=None, ): self.id = id @@ -22,6 +23,7 @@ def __init__( self.end = end self.frames: List[Frame] = frames self.description = description + self.metadata = metadata self._connection = connection def __repr__(self) -> str: @@ -32,7 +34,8 @@ def __repr__(self) -> str: f"start={self.start}, " f"end={self.end}, " f"frames={self.frames}, " - f"description={self.description})" + f"description={self.description}), " + f"metadata={self.metadata})" ) def to_json(self): @@ -43,6 +46,7 @@ def to_json(self): "end": self.end, "frames": [frame.to_json() for frame in self.frames], "description": self.description, + "metadata": self.metadata, } def describe(self, prompt: str = None, model_name=None) -> None: diff --git a/videodb/video.py b/videodb/video.py index eee2c21..0e8dd98 100644 --- a/videodb/video.py +++ b/videodb/video.py @@ -241,6 +241,7 @@ def _format_scene_collection(self, scene_collection_data: dict) -> SceneCollecti description=scene.get("description"), id=scene.get("scene_id"), frames=frames, + metadata=scene.get("metadata", {}), connection=self._connection, ) scenes.append(scene)