def add_image(self, image: np.ndarray | Figure, name: str | None = None, **kwargs) -> None:
        """Log images to MLflow.

        Args:
            image: Image to log, can be either a numpy array or matplotlib Figure.
            name: Name/title of the image. Defaults to ``None``.
            **kwargs: Additional keyword arguments passed to the MLflow logging
                method when ``image`` is a Figure. Has no effect when ``image``
                is a numpy array.
        """
        # Need to call different functions of `Experiment` for  Figure vs np.ndarray
        if isinstance(image, Figure):
            self.experiment.log_figure(run_id=self.run_id, figure=image, artifact_file=name, **kwargs)
        else:
            self.experiment.log_image(run_id=self.run_id, image=image, artifact_file=name)
Log images to MLflow.

        Args:
            image: Image to log, can be either a numpy array or matplotlib Figure.
            name: Name/title of the image. Defaults to ``None``.
            **kwargs: Additional keyword arguments passed to the MLflow logging
                method when ``image`` is a Figure. Has no effect when ``image``
                is a numpy array.
        
src/anomalib/loggers/mlflow.py