






'''simple docstring'''







from ..utils import DummyObject, requires_backends






class 					a__    (			metaclass=lowerCamelCase						):
     '''simple docstring'''







     _snake_case             =  ['torch', 'librosa']






     def __init__(self    :	Any				,				*lowercase__    :	List[Any]				,				**lowercase__    :	str					)  ->       List[Any]:
           requires_backends(self				,				["torch", "librosa"]					)






     @classmethod
     def     _UpperCamelCase   (cls    :	List[Any]				,				*lowercase__    :	Union[str, Any]				,				**lowercase__    :	Tuple					)  ->       Dict:
           requires_backends(cls				,				["torch", "librosa"]					)






     @classmethod
     def     _UpperCamelCase   (cls    :	str				,				*lowercase__    :	Any				,				**lowercase__    :	List[Any]					)  ->       List[Any]:
           requires_backends(cls				,				["torch", "librosa"]					)







class 					a__    (			metaclass=lowerCamelCase						):
     '''simple docstring'''







     _snake_case             =  ['torch', 'librosa']






     def __init__(self    :	Optional[Any]				,				*lowercase__    :	Any				,				**lowercase__    :	Union[str, Any]					)  ->       Tuple:
           requires_backends(self				,				["torch", "librosa"]					)






     @classmethod
     def     _UpperCamelCase   (cls    :	Tuple				,				*lowercase__    :	List[Any]				,				**lowercase__    :	Union[str, Any]					)  ->       Dict:
           requires_backends(cls				,				["torch", "librosa"]					)






     @classmethod
     def     _UpperCamelCase   (cls    :	Dict				,				*lowercase__    :	Any				,				**lowercase__    :	Union[str, Any]					)  ->       Dict:
           requires_backends(cls				,				["torch", "librosa"]					)










'''simple docstring'''







from cva import destroyAllWindows, imread, imshow, waitKey


def 						_UpperCamelCase							(     snake_case__							,			snake_case__							):
      __A   ,				__A		   =      img.shape[0], img.shape[1]

      def to_grayscale(snake_case__							,			snake_case__							,			snake_case__							):
            return 0.2126 * red + 0.587 * green + 0.114 * blue

      def normalize(snake_case__							):
            return min(snake_case__							,			255							)

      for i in range(snake_case__							):
            for j in range(snake_case__							):
                  __A		   =      int(to_grayscale(*img[i][j]							)							)
                  __A		   =      [
                      normalize(snake_case__							),
                      normalize(greyscale + factor							),
                      normalize(greyscale + 2 * factor							),
                  ]

      return img


if __name__ == "__main__":
       # read original image
       __A      :       Dict      =	{
           percentage: imread('image_data/lena.jpg', 1) for percentage in (1_0, 2_0, 3_0, 4_0)
       }

       for percentage, img in images.items():
              make_sepia(img, percentage)

       for percentage, img in images.items():
              imshow(F"""Original image with sepia (factor: {percentage})""", img)

       waitKey(0)
       destroyAllWindows()


