videodb
VideoDB Documentation
videodb
VideoDB Documentation
Scene Index Guide

icon picker
Custom Annotations

Enhance your understanding of videos by using our simple annotation and tagging pipeline. To enable this, you can create a new Scene object. Then, pass your annotations in the description field and index them using index_scenes() function.
Screenshot 2024-07-04 at 12.23.02 PM.jpg

light
VideoDB allows multiple indexes on video objects. This is advantageous as it allows you to attach additional context to each scene, enhancing the search functionality.

Scene:

info
A Scene object describes a unique event in the video. From a timeline perspective it’s a timestamp range.
video_id : id of the video object
start : seconds
end : seconds
description : string description
Each scene object has another attribute, frames, which contains a list of objects. However, we don't need them here for custom annotation pipelines because we are bringing the description from outside.

Create a new Scene

Create new Scene objects and add your custom annotation as description.
from videodb.scene import Scene

# create scene object and patch your description
scene1 = Scene(
video_id=video.id,
start=0,
end=100,
description="Detective Martin is being interviewed by the police.",)


scene2 = Scene(
video_id=video.id,
start=600,
end=900,
description="A religious gathering. People are praying and singing")

# create a list of scene objects
scenes = [scene1, scene2]



Index and search scenes

Index using the list of scene objects and use the index_id for search
from videodb import IndexType

#create new index and assign it a name
index_id = video.index_scenes(scenes=scenes, name="My Custom Annotations#1")

# search using the index_id
res = video.search(query="religious gathering", index_type=IndexType.scene, index_id=index_id)

res.play()

ok
Custom annotations unlock additional features
Adding application context into the search pipeline.
Generate unique descriptions from your own custom vision model.
Index manual annotations.
Read more about Scene object in

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.