def add_custom_metrics(self, custom_metrics, overwrite=True):
        """Computes the given custom metrics and adds them to these results.

        Args:
            custom_metrics: a list of custom metrics to compute or a dict
                mapping metric names to kwargs dicts
            overwrite (True): whether to recompute any custom metrics that
                have already been applied
        """
        _custom_metrics = self.config.custom_metrics

        if _custom_metrics is None:
            _custom_metrics = {}

        if isinstance(_custom_metrics, list):
            _custom_metrics = {k: None for k in _custom_metrics}

        if isinstance(custom_metrics, list):
            custom_metrics = {k: None for k in custom_metrics}

        if not overwrite:
            custom_metrics = {
                k: v
                for k, v in custom_metrics.items()
                if k not in _custom_metrics
            }

        if not custom_metrics:
            return

        metric_uris = list(custom_metrics.keys())

        _custom_metrics.update(custom_metrics)
        if all(v is None for v in _custom_metrics.values()):
            _custom_metrics = list(_custom_metrics.keys())

        self.config.custom_metrics = _custom_metrics
        self.save_config()

        self.backend.compute_custom_metrics(
            self.samples, self.key, self, metric_uris=metric_uris
        )
        self.save()
Computes the given custom metrics and adds them to these results.

        Args:
            custom_metrics: a list of custom metrics to compute or a dict
                mapping metric names to kwargs dicts
            overwrite (True): whether to recompute any custom metrics that
                have already been applied
        
fiftyone/utils/eval/base.py