def compute_metrics(self, results: List[dict]) -> dict:
        """Compute the metrics from the results.

        Args:
            results (List[dict]): A list of results.

        Returns:
            dict: A dict of metrics.
        """
        if get_rank() == 0:
            self.dump_results_to_csv(results)
        metrics = dict()
        metrics['accuracy/top1'] = np.mean([
            result['pred_category'][0] == result['gt_category']
            for result in results
        ])

        return metrics
Compute the metrics from the results.

        Args:
            results (List[dict]): A list of results.

        Returns:
            dict: A dict of metrics.
        
mmpretrain/evaluation/metrics/shape_bias_label.py