def METHOD_NAME(self, img, results=None):
    """
    Visualize the results on an image.
    """
    if not self.enabled:
        return img
    if results is None:
        results = self.results
    if self.type == 'classification' or self.type == 'action':
        if results[0] >= 0:
            str = f"{results[1] * 100:05.2f}% {self.net.GetClassLabel(results[0])}"
            self.font.OverlayText(img, img.width, img.height, str, 5, 5 + (self.fontLine * 37), self.font.White, self.font.Gray40)
    elif self.type == 'detection':
        self.net.Overlay(img, results)
    elif self.type == 'segmentation':
        if not self.overlayImg or self.overlayImg.width != img.width or self.overlayImg.height != img.height:
            self.overlayImg = cudaAllocMapped(like=img)
        self.net.Overlay(self.overlayImg, filter_mode='linear')
        return self.overlayImg
    elif self.type == 'pose':
        self.net.Overlay(img, self.results, 'links,keypoints')
    elif self.type == 'background':
        self.net.Process(img)
    return img