def evaluate_multiple_datasets(
    LOG, dataloaders, model, opt, save=True, give_return=True, epoch=0
):
    """
    Compute evaluation metrics, update LOGGER and print results, specifically for Multi-test datasets s.a. PKU Vehicle ID.

    Args:
        LOG:         aux.LOGGER-instance. Main Logging Functionality.
        dataloaders: List of PyTorch Dataloaders, test-dataloaders to evaluate.
        model:       PyTorch Network, Network to evaluate.
        opt:         argparse.Namespace, contains all training-specific parameters.
        sa ve:        bool, if True, Checkpoints are saved when testing metrics (specifically Recall @ 1) improve.
        give_return: bool, i f True, return computed metrics.
        epoch:       int, current epoch, required for logger.
    Returns :
        (optional) Computed metrics. Are normally written directly to LOG and printed.
    """
    start = time.time()

    csv_data = [epoch]

    with torch.no_grad():
        for i, dataloader in enumerate(dataloaders):
            print("Working on Set {}/{}".format(i + 1, len(dataloaders)))
            image_paths = np.array(dataloader.dataset.image_list)
            # Compute Metrics for specific testset.
            (
                F1,
                NMI,
                recall_at_ks,
                feature_matrix_all,
            ) = aux.eval_metrics_one_dataset(
                model, dataloader, device=opt.device, k_vals=opt.k_vals, opt=opt
            )
            # Generate printable summary string.
            result_str = ", ".join(
                "@{0}: {1:.4f}".format(k, rec)
                for k, rec in zip(opt.k_vals, recall_at_ks)
            )
            result_str = "SET {0}: Epoch (Test) {1}: NMI [{2:.4f}] | F1 {3:.4f}| Recall [{4}]".format(
                i + 1, epoch, NMI, F1, result_str
            )

            if LOG is not None:
                if save:
                    if not len(
                        LOG.progress_saver["val"]["Set {} Recall @ 1".format(i)]
                    ) or recall_at_ks[0] > np.max(
                        LOG.progress_saver["val"]["Set {} Recall @ 1".format(i)]
                    ):
                        # Save Checkpoint for specific test set.
                        aux.set_checkpoint(
                            model,
                            opt,
                            LOG.progress_saver,
                            LOG.prop.save_path
                            + "/checkpoint_set{}.pth.tar".format(i + 1),
                        )
                        aux.recover_closest_one_dataset(
                            feature_matrix_all,
                            image_paths,
                            LOG.prop.save_path
                            + "/sample_recoveries_set{}.png".format(i + 1),
                        )

                csv_data += [NMI, F1] + recall_at_ks
            print(result_str)

    csv_data.insert(0, np.round(time.time() - start))
    # Update logs.
    LOG.log("val", LOG.metrics_to_log["val"], csv_data)

    # if give_return:
    return csv_data[2:]
    # else:
    #    None

    Compute evaluation metrics, update LOGGER and print results, specifically for Multi-test datasets s.a. PKU Vehicle ID.

    Args:
        LOG:         aux.LOGGER-instance. Main Logging Functionality.
        dataloaders: List of PyTorch Dataloaders, test-dataloaders to evaluate.
        model:       PyTorch Network, Network to evaluate.
        opt:         argparse.Namespace, contains all training-specific parameters.
        sa ve:        bool, if True, Checkpoints are saved when testing metrics (specifically Recall @ 1) improve.
        give_return: bool, i f True, return computed metrics.
        epoch:       int, current epoch, required for logger.
    Returns :
        (optional) Computed metrics. Are normally written directly to LOG and printed.
    
examples/pytorch/hilander/PSS/Smooth_AP/src/evaluate.py