-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathviz_struct.py
executable file
·32 lines (27 loc) · 943 Bytes
/
viz_struct.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
#!/usr/bin/env python3
from surveillant import *
import pickle
import cv2
def display_struct():
data = pickle.load(open('output/struct_storage/0509_1_A3_ELEVATOR_slice.pkl', 'rb'))
for _frame in data['frames']:
if _frame.identity is None:
continue
print('timestamp {} | bbox {} | id {} | idc {}'.format(_frame.timestamp, _frame.bbox, _frame.identity, _frame.id_candidates))
print('video dir {}'.format(data['video_fn']))
return data
def viz_struct():
data = pickle.load(open('output/struct_storage/0509_1_A3_ELEVATOR_slice.pkl', 'rb'))
cap = cv2.VideoCapture(data['video_fn'])
frame_idx = 0
while cap.isOpened():
frame_idx += 1
if frame_idx % data['detect_interval'] != 0:
continue
ret, frame = cap.read()
if frame is None:
print('No stream')
break
pass
if __name__ == '__main__':
display_struct()