-
Notifications
You must be signed in to change notification settings - Fork 4
/
data_loader.py
46 lines (39 loc) · 1.13 KB
/
data_loader.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
39
40
41
42
43
44
45
46
from abc import ABCMeta, abstractmethod
class DataLoader(object):
__metaclass__ = ABCMeta
@abstractmethod
def get_video(self, video_name):
"""
Returns:
video_path (Path): Path to video file.
"""
pass
@abstractmethod
def video_list(self):
"""
Returns:
videos (list): List containing video names as strings.
"""
pass
@abstractmethod
def video_groundtruth(self, video_name):
"""
Args:
video_name (str): One video name from the list returned by
video_list.
Returns:
groundtruth (list): Each element is a tuple of the form
(start_sec, end_sec, label)
"""
pass
@abstractmethod
def video_predictions(self, video_name):
"""
Args:
video_name (str): One video name from the list returned by
video_list.
Returns:
predictions (dict): Maps label name to list of floats representing
confidences. The list spans the length of the video.
"""
pass