8000 Merge pull request #33 from video-db/ankit/add-scene-metadata · video-db/videodb-python@1ab1e40 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ab1e40

Browse files
authored
Merge pull request #33 from video-db/ankit/add-scene-metadata
feat: add scene metadata
2 parents fbc857b + f11185f commit 1ab1e40

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

videodb/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" About information for videodb sdk"""
22

33

4-
__version__ = "0.2.10"
4+
__version__ = "0.2.11"
55
__title__ = "videodb"
66
__author__ = "videodb"
77
__email__ = "contact@videodb.io"

videodb/scene.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def __init__(
1414
description: str,
1515
id: str = None,
1616
frames: List[Frame] = [],
17+
metadata: dict = {},
1718
connection=None,
1819
):
1920
self.id = id
@@ -22,6 +23,7 @@ def __init__(
2223
self.end = end
2324
self.frames: List[Frame] = frames
2425
self.description = description
26+
self.metadata = metadata
2527
self._connection = connection
2628

2729
def __repr__(self) -> str:
@@ -32,7 +34,8 @@ def __repr__(self) -> str:
3234
f"start={self.start}, "
3335
f"end={self.end}, "
3436
f"frames={self.frames}, "
35-
f"description={self.description})"
37+
f"description={self.description}), "
38+
f"metadata={self.metadata})"
3639
)
3740

3841
def to_json(self):
@@ -43,6 +46,7 @@ def to_json(self):
4346
"end": self.end,
4447
"frames": [frame.to_json() for frame in self.frames],
4548
"description": self.description,
49+
"metadata": self.metadata,
4650
}
4751

4852
def describe(self, prompt: str = None, model_name=None) -> None:

videodb/video.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ def _format_scene_collection(self, scene_collection_data: dict) -> SceneCollecti
241241
description=scene.get("description"),
242242
id=scene.get("scene_id"),
243243
frames=frames,
244+
metadata=scene.get("metadata", {}),
244245
connection=self._connection,
245246
)
246247
scenes.append(scene)

0 commit comments

Comments
 (0)
0