def initial_error(self):
     r"""
     Returns the initial fitting error.
     """
     if self.gt_shape is not None:
         return compute_error(self.initial_shape.points,
                              self.gt_shape.points,
                              self.error_type)
     else:
         raise ValueError('Ground truth has not been set, final error '
                          'cannot be computed')
 def errors(self):
     r"""
     Returns a list containing the error at each fitting iteration.
     """
     if self.gt_shape is not None:
         return [compute_error(t, self.gt_shape.points,
                               self.error_type)
                 for t in self.shapes(as_points=True)]
     else:
         raise ValueError('Ground truth has not been set, errors cannot '
                          'be computed')
Beispiel #3
0
    def initial_error(self, error_type='me_norm'):
        r"""
        Returns the initial fitting error.

        Parameters
        -----------
        error_type : `str` ``{'me_norm', 'me', 'rmse'}``, optional
            Specifies the way in which the error between the fitted and
            ground truth shapes is to be computed.

        Returns
        -------
        initial_error : `float`
            The initial error at the start of the fitting procedure.
        """
        if self.gt_shape is not None:
            return compute_error(self.initial_shape, self.gt_shape, error_type)
        else:
            raise ValueError('Ground truth has not been set, final error '
                             'cannot be computed')
Beispiel #4
0
    def errors(self, error_type='me_norm'):
        r"""
        Returns a list containing the error at each fitting iteration.

        Parameters
        -----------
        error_type : `str` ``{'me_norm', 'me', 'rmse'}``, optional
            Specifies the way in which the error between the fitted and
            ground truth shapes is to be computed.

        Returns
        -------
        errors : `list` of `float`
            The errors at each iteration of the fitting process.
        """
        if self.gt_shape is not None:
            return [compute_error(t, self.gt_shape, error_type)
                    for t in self.shapes()]
        else:
            raise ValueError('Ground truth has not been set, errors cannot '
                             'be computed')