Beispiel #1
0
 def load_file(self, fname):
     """
     Load data from a .txt file.
     """
     filename = os.path.join(self.data_path, 'ucfTrainTestlist', fname)
     data = load_txt(filename)
     return [row_str.split(' ')[0] for row_str in data if any(row_str)]
 def load_annotation(self, fname):
     """
     Load the annotations from a file.
     """
     data = load_txt(fname)
     data = data[0].split('\t')[:-1]  # discard the last element
     return [int(s) for s in data]
Beispiel #3
0
 def load_classes(self):
     """
     Load action classes from the annotation files.
     """
     filename = os.path.join(self.data_path, 'ucfTrainTestlist', 'classInd.txt')
     data = load_txt(filename)
     return [row_str.split(' ')[1] for row_str in data if any(row_str)]
Beispiel #4
0
 def load_annotations_groundtruth(self):
     """
     Load ILSVRC2012 ground truth indexes.
     """
     return load_txt(self.get_file_path('ILSVRC2012_validation_ground_truth.txt'))