-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path03_temporal.py
39 lines (32 loc) · 952 Bytes
/
03_temporal.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'''
This example shows how to display temporal data.
'''
# Rekall imports
from rekall import Interval, IntervalSet, IntervalSetMapping, Bounds3D
# Vgrid imports
from vgrid import VGridSpec, VideoMetadata, VideoBlockFormat
from vgrid import SpatialType_Temporal
# This example assumes a 1920x1080 video at 59.94 FPS, with 20,696 frames.
# You should modify it for your own examples.
video_metadata = [
VideoMetadata('http://localhost:8000/test.mp4', 0, 59.94, 20696, 1920, 1080)
]
ism = IntervalSetMapping({
0: IntervalSet([
Interval(
Bounds3D(0, 10),
{
'spatial_type': SpatialType_Temporal(),
'metadata': {}
}
)
])
})
vgrid_spec = VGridSpec(
video_meta = video_metadata,
vis_format = VideoBlockFormat(imaps = [
('bboxes', ism)
])
)
# Pass this to your Javascript application somehow
json_for_js = vgrid_spec.to_json_compressed()