


'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_UpperCAmelCase				: List[str]							    =				logging.get_logger(__name__)

_UpperCAmelCase				: int							    =				{
    'microsoft/focalnet-tiny': 'https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json',
}


class       a__				( snake_case__							,						snake_case__      ):







    """simple docstring"""



    __UpperCamelCase    :		Any	=	"""focalnet"""




    def __init__(self       ,			__lowercase=2_24       ,			__lowercase=4       ,			__lowercase=3       ,			__lowercase=96       ,			__lowercase=False       ,			__lowercase=[1_92, 3_84, 7_68, 7_68]       ,			__lowercase=[2, 2, 6, 2]       ,			__lowercase=[2, 2, 2, 2]       ,			__lowercase=[3, 3, 3, 3]       ,			__lowercase="gelu"       ,			__lowercase=4.0       ,			__lowercase=0.0       ,			__lowercase=0.1       ,			__lowercase=False       ,			__lowercase=1e-4       ,			__lowercase=False       ,			__lowercase=False       ,			__lowercase=False       ,			__lowercase=0.0_2       ,			__lowercase=1e-5       ,			__lowercase=32       ,			__lowercase=None       ,			__lowercase=None       ,			**__lowercase       ,			):
          super().__init__(**UpperCAmelCase_		)

          __lowerCAmelCase							       =				image_size
          __lowerCAmelCase							       =				patch_size
          __lowerCAmelCase							       =				num_channels
          __lowerCAmelCase							       =				embed_dim
          __lowerCAmelCase							       =				use_conv_embed
          __lowerCAmelCase							       =				hidden_sizes
          __lowerCAmelCase							       =				depths
          __lowerCAmelCase							       =				focal_levels
          __lowerCAmelCase							       =				focal_windows
          __lowerCAmelCase							       =				hidden_act
          __lowerCAmelCase							       =				mlp_ratio
          __lowerCAmelCase							       =				hidden_dropout_prob
          __lowerCAmelCase							       =				drop_path_rate
          __lowerCAmelCase							       =				use_layerscale
          __lowerCAmelCase							       =				layerscale_value
          __lowerCAmelCase							       =				use_post_layernorm
          __lowerCAmelCase							       =				use_post_layernorm_in_modulation
          __lowerCAmelCase							       =				normalize_modulator
          __lowerCAmelCase							       =				initializer_range
          __lowerCAmelCase							       =				layer_norm_eps
          __lowerCAmelCase							       =				encoder_stride
          __lowerCAmelCase							       =				['''stem'''] + [F"""stage{idx}""" for idx in range(1       ,			len(self.depths		) + 1		)]
          __lowerCAmelCase       ,					__lowerCAmelCase							       =				get_aligned_output_features_output_indices(
              out_features=UpperCAmelCase_       ,			out_indices=UpperCAmelCase_       ,			stage_names=self.stage_names		)





'''simple docstring'''

from PIL import Image

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):

						def brightness(lowerCamelCase) -> float:
												return 1_2_8 + level + (c - 1_2_8)

						if not -2_55.0 <= level <= 2_55.0:
												raise ValueError('''level must be between -255.0 (black) and 255.0 (white)''')
						return img.point(lowerCamelCase)


if __name__ == "__main__":
	# Load image
	with Image.open("""image_data/lena.jpg""") as img:
		# Change brightness to 100
		_UpperCAmelCase				: str							    =				change_brightness(img, 1_0_0)
		brigt_img.save("""image_data/lena_brightness.png""", format="""png""")

