def load_annotations(self, file_name): annotation_pldata = fm.load_pldata_file(self.g_pool.rec_dir, file_name) annotations = pm.Mutable_Bisector(annotation_pldata.data, annotation_pldata.timestamps) logger.info("Loaded {} annotations from {}.pldata".format( len(annotations), file_name)) return annotations
def _load_from_file(self): directory = self._offline_data_folder_path file_name = self._pldata_file_name pldata = fm.load_pldata_file(directory, file_name) self.markers_bisector = pm.Mutable_Bisector(pldata.data, pldata.timestamps) for topic in set(pldata.topics): frame_index, num_markers = topic.split(".") self.frame_index_to_num_markers[int(frame_index)] = int(num_markers)
def extract_annotations_from_recorded_notifications(self): notifications = fm.load_pldata_file(self.g_pool.rec_dir, 'notify') annotation_ts = [] annotation_data = [] for idx, topic in enumerate(notifications.topics): if topic == 'notify.annotation': annotation_ts.append(notifications.timestamps[idx]) annotation_data.append(notifications.data[idx]) self.annotations = pm.Mutable_Bisector(annotation_data, annotation_ts) logger.info('Extracted {} annotations from recording.'.format( len(self.annotations)))
def _load_from_file(self): directory = self._offline_data_folder_path file_name = self._pldata_file_name pldata = fm.load_pldata_file(directory, file_name) self.markers_bisector = pm.Mutable_Bisector(pldata.data, pldata.timestamps) if pldata.topics and pldata.topics[0] == "": self._load_frame_index_to_num_markers() else: # for backward compatibility for topic in set(pldata.topics): frame_index, num_markers = topic.split(".") self.frame_index_to_num_markers[int(frame_index)] = int(num_markers)
def load_cached_annotations(self): annotations = fm.load_pldata_file(self.cache_dir, 'annotations') self.annotations = pm.Mutable_Bisector(annotations.data, annotations.timestamps) logger.info('Loaded {} annotations from cache.'.format( len(self.annotations)))
def __init__(self, get_current_frame_index, get_current_frame_window): self._get_current_frame_index = get_current_frame_index self._get_current_frame_window = get_current_frame_window self.markers_bisector = pm.Mutable_Bisector() self.frame_index_to_num_markers = {}
def set_to_default_values(self): super().set_to_default_values() self.pose_bisector = pm.Mutable_Bisector()
def _load_from_file(self): directory = self._offline_data_folder_path file_name = self._pldata_file_name pldata = fm.load_pldata_file(directory, file_name) self.pose_bisector = pm.Mutable_Bisector(pldata.data, pldata.timestamps)