def predict_image_classification(model: nn.Module, input_: torch.Tensor):
    """
    Predict using an image classification model.
    Args:
        model (`nn.Module`):
            Pytorch model.
        input_ (`Tensor`):
            Input image tensor.
    Returns:
        (`tuple`)
            Prediction score which max is 1, and label idx.

    """
    output = model(input_)
    output = F.softmax(output, dim=1)
    prediction_score, pred_label_idx = torch.topk(output, 1)
    if isinstance(pred_label_idx, torch.Tensor):
        pred_label_idx = pred_label_idx.squeeze().item()
    prediction_score = prediction_score.squeeze().detach().item()
    return prediction_score, pred_label_idx
Predict using an image classification model.
Args:
model (`nn.Module`):
Pytorch model.
input_ (`Tensor`):
Input image tensor.
Returns:
(`tuple`)
Prediction score which max is 1, and label idx.
towhee/trainer/utils/plot_utils.py