def METHOD_NAME(
    self,
    model: Network,
    dataloader: DataLoader,
    criterion: _Loss,
    use_labels: bool = True,
    amp: bool = False,
) -> Tuple[pd.DataFrame, Dict[str, float]]:
    """
    Computes the predictions and evaluation metrics.
    Args:
        model: the model trained.
        dataloader: wrapper of a CapsDataset.
        criterion: function to calculate the loss.
        use_labels: If True the true_label will be written in output DataFrame
            and metrics dict will be created.
        amp: If True, enables Pytorch's automatic mixed precision.
    Returns:
        the results and metrics on the image level.
    """
    model.eval()
    dataloader.dataset.eval()
    results_df = pd.DataFrame(columns=self.columns)
    total_loss = {}
    with torch.no_grad():
        for i, data in enumerate(dataloader):
            # initialize the loss list to save the loss components
            with autocast(enabled=amp):
                outputs, loss_dict = model.compute_outputs_and_loss(
                    data, criterion, use_labels=use_labels
                )
            if i == 0:
                for loss_component in loss_dict.keys():
                    total_loss[loss_component] = 0
            for loss_component in total_loss.keys():
                total_loss[loss_component] += (
                    loss_dict[loss_component].float().item()
                )
            # Generate detailed DataFrame
            for idx in range(len(data["participant_id"])):
                row = self.generate_test_row(idx, data, outputs.float())
                row_df = pd.DataFrame(row, columns=self.columns)
                results_df = pd.concat([results_df, row_df])
            del outputs, loss_dict
        results_df.reset_index(inplace=True, drop=True)
    if not use_labels:
        metrics_dict = None
    else:
        metrics_dict = self.compute_metrics(results_df)
        for loss_component in total_loss.keys():
            metrics_dict[loss_component] = total_loss[loss_component]
    torch.cuda.empty_cache()
    return results_df, metrics_dict