import torch


def classification(image_scores: torch.Tensor, thresh: float) -> torch.Tensor:
    """Calculate image classifications from image scores.

    Args:
        image_scores: A batch of image scores.
        thresh: A treshold value. If an image score is larger than
                or equal to thresh it is classified as anomalous.

    Returns:
        image_classifications: A batch of image classifcations.

    """

    # Apply threshold
    image_classifications = image_scores.clone()
    image_classifications[image_classifications < thresh] = 1
    image_classifications[image_classifications >= thresh] = 0
    return image_classifications