import numpy as np
import torch

from ..models.clipseg import CLIPSegForImageSegmentation
from ..utils import is_vision_available, requires_backends
from .base import PipelineTool


if is_vision_available():
					from PIL import Image







class 			lowercase    (	a__      ):
				__SCREAMING_SNAKE_CASE :			int	      =      (
				    '''This is a tool that creates a segmentation mask of an image according to a label. It cannot create an image.'''
				    '''It takes two arguments named `image` which should be the original image, and `label` which should be a text '''
				    '''describing the elements what should be identified in the segmentation mask. The tool returns the mask.'''
				)
				__SCREAMING_SNAKE_CASE :			List[Any]	      =      '''CIDAS/clipseg-rd64-refined'''
				__SCREAMING_SNAKE_CASE :			List[str]	      =      '''image_segmenter'''
				__SCREAMING_SNAKE_CASE :			List[str]	      =      CLIPSegForImageSegmentation

				__SCREAMING_SNAKE_CASE :			List[str]	      =      ['''image''', '''text''']
				__SCREAMING_SNAKE_CASE :			Optional[int]	      =      ['''image''']




				def __init__( self				,       *snake_case				,       **snake_case	):
											requires_backends(self				,       ['vision']	)
											super().__init__(*snake_case				,       **snake_case	)




				def    a							( self				,       snake_case				,       snake_case	):
											return self.pre_processor(text=[label]				,       images=[image]				,       padding=snake_case				,       return_tensors='pt'	)




				def    a							( self				,       snake_case	):
											with torch.no_grad():
																		snake_case_          =   self.model(**snake_case	).logits
											return logits




				def    a							( self				,       snake_case	):
											snake_case_          =   outputs.cpu().detach().numpy()
											snake_case_          =   0
											snake_case_          =   1
											return Image.fromarray((array * 255).astype(np.uinta	)	)







from math import sqrt





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   0
							for i in range(1       ,							int(sqrt(UpperCamelCase__				) + 1				)				):
														if n % i == 0 and i != sqrt(UpperCamelCase__				):
																					total += i + n // i
														elif i == sqrt(UpperCamelCase__				):
																					total += i
							return total - n





def  __lowerCamelCase     (			UpperCamelCase__ = 10000				):







							'''simple docstring'''






							snake_case_          =   sum(
							    i
							    for i in range(1       ,							UpperCamelCase__				)
							    if sum_of_divisors(sum_of_divisors(UpperCamelCase__				)				) == i and sum_of_divisors(UpperCamelCase__				) != i				)
							return total


if __name__ == "__main__":
					print(solution(int(str(input()).strip())))




