コード例 #1
0
    def view_expert_ensemble_widget(self, figure_size=(7, 7)):
        r"""
        Visualizes the ensemble of experts of the CLM object using an
        interactive widget.

        Parameters
        ----------
        figure_size : (`int`, `int`), optional
            The size of the plotted figures.

        Raises
        ------
        ValueError
            Only convolution-based expert ensembles can be visualized.
        """
        if not isinstance(self.expert_ensembles[0],
                          ConvolutionBasedExpertEnsemble):
            raise ValueError('Only convolution-based expert ensembles can be '
                             'visualized.')
        try:
            from menpowidgets import visualize_expert_ensemble
            centers = [sp.model.mean() for sp in self.shape_models]
            visualize_expert_ensemble(self.expert_ensembles,
                                      centers,
                                      figure_size=figure_size)
        except:
            from menpo.visualize.base import MenpowidgetsMissingError
            raise MenpowidgetsMissingError()
コード例 #2
0
ファイル: base.py プロジェクト: jabooth/menpofit
    def view_expert_ensemble_widget(self, figure_size=(7, 7)):
        r"""
        Visualizes the ensemble of experts of the CLM object using an
        interactive widget.

        Parameters
        ----------
        figure_size : (`int`, `int`), optional
            The size of the plotted figures.

        Raises
        ------
        ValueError
            Only convolution-based expert ensembles can be visualized.
        """
        if not isinstance(self.expert_ensembles[0],
                          ConvolutionBasedExpertEnsemble):
            raise ValueError('Only convolution-based expert ensembles can be '
                             'visualized.')
        try:
            from menpowidgets import visualize_expert_ensemble
            centers = [sp.model.mean() for sp in self.shape_models]
            visualize_expert_ensemble(self.expert_ensembles, centers,
                                      figure_size=figure_size)
        except:
            from menpo.visualize.base import MenpowidgetsMissingError
            raise MenpowidgetsMissingError()