def get_boxes_parameters(self, index, select_size): # index_start = int(max(0, index - select_size*config["parameter_frame_scale"])) # index_end = int(min(index_start + select_size * (1 + config["parameter_frame_scale"]*2), self.max_frame)) index_start = index index_end = int(min(index_start + select_size, self.max_frame)) boxes = self.ua_data[index_start:index_end, :, :] times = np.arange(index_start, index_end) - index ret = MotionModel.get_parameters(boxes, times/config["video_fps"], config['min_valid_node_rate'] / 3.0) return ret[0]
def __call__(self, items): if items is None: return None # re-calcuate the curve parameters parameters = MotionModel.get_parameters( bboxes=items[2], times=items[4], invalid_node_rate=config['min_valid_node_rate']) items += [parameters] return items