def _increment_shape_model(self, shapes, scale_index, forgetting_factor=1.0): aligned_shapes = align_shapes(shapes) dense_shapes = densify_shapes(aligned_shapes, self.reference_frame, self.transform) # Increment shape model self.shape_models[scale_index].increment( dense_shapes, forgetting_factor=forgetting_factor, max_n_components=self.max_shape_components[scale_index] )
def _increment_shape_model(self, shapes, shape_model, forgetting_factor=1.0): aligned_shapes = align_shapes(shapes) dense_shapes = densify_shapes(aligned_shapes, self.reference_frame, self.transform) # Increment shape model shape_model.increment(dense_shapes, forgetting_factor=forgetting_factor)
def _build_shape_model(self, shapes, scale_index): mean_aligned_shape = mean_pointcloud(align_shapes(shapes)) self.n_landmarks = mean_aligned_shape.n_points self.reference_frame = build_reference_frame(mean_aligned_shape) dense_shapes = densify_shapes(shapes, self.reference_frame, self.transform) # build dense shape model shape_model = build_shape_model(dense_shapes) return shape_model
def _build_shape_model(self, shapes, scale_index): mean_aligned_shape = mean_pointcloud(align_shapes(shapes)) self.n_landmarks = mean_aligned_shape.n_points self.reference_frame = build_reference_frame(mean_aligned_shape) dense_shapes = densify_shapes(shapes, self.reference_frame, self.transform) # Build dense shape model max_sc = self.max_shape_components[scale_index] return self._shape_model_cls[scale_index](dense_shapes, max_n_components=max_sc)
def _increment_shape_model(self, shapes, scale_index, forgetting_factor=1.0): aligned_shapes = align_shapes(shapes) dense_shapes = densify_shapes(aligned_shapes, self.reference_frame, self.transform) # Increment shape model self.shape_models[scale_index].increment( dense_shapes, forgetting_factor=forgetting_factor, max_n_components=self.max_shape_components[scale_index])
def _build_shape_model(self, shapes, scale_index): mean_aligned_shape = mean_pointcloud(align_shapes(shapes)) self.n_landmarks = mean_aligned_shape.n_points self.reference_frame = build_patch_reference_frame( mean_aligned_shape, patch_shape=self.patch_shape[scale_index]) dense_shapes = densify_shapes(shapes, self.reference_frame, self.transform) # Build dense shape model max_sc = self.max_shape_components[scale_index] return self._shape_model_cls[scale_index](dense_shapes, max_n_components=max_sc)