




'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging


a		:  Dict   			=			logging.get_logger(__name__)

a		:  Tuple   			=			{
    'MCG-NJU/videomae-base': 'https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json',
}




class     UpperCamelCase					(  snake_case__					):
		a    :Tuple      					=				'videomae'



		def __init__( self		,    __lowerCAmelCase=224		,    __lowerCAmelCase=16		,    __lowerCAmelCase=3		,    __lowerCAmelCase=16		,    __lowerCAmelCase=2		,    __lowerCAmelCase=768		,    __lowerCAmelCase=12		,    __lowerCAmelCase=12		,    __lowerCAmelCase=3072		,    __lowerCAmelCase="gelu"		,    __lowerCAmelCase=0.0		,    __lowerCAmelCase=0.0		,    __lowerCAmelCase=0.02		,    __lowerCAmelCase=1e-12		,    __lowerCAmelCase=True		,    __lowerCAmelCase=True		,    __lowerCAmelCase=6		,    __lowerCAmelCase=384		,    __lowerCAmelCase=4		,    __lowerCAmelCase=1536		,    __lowerCAmelCase=True		,    **__lowerCAmelCase		,    ):







						'''simple docstring'''


						super().__init__(**A_   )

						_a							:       Optional[Any]       					=			image_size
						_a							:       Optional[Any]       					=			patch_size
						_a							:       Tuple       					=			num_channels
						_a							:       Optional[int]       					=			num_frames
						_a							:       Any       					=			tubelet_size

						_a							:       List[str]       					=			hidden_size
						_a							:       List[Any]       					=			num_hidden_layers
						_a							:       Any       					=			num_attention_heads
						_a							:       str       					=			intermediate_size
						_a							:       Optional[Any]       					=			hidden_act
						_a							:       Dict       					=			hidden_dropout_prob
						_a							:       Any       					=			attention_probs_dropout_prob
						_a							:       Tuple       					=			initializer_range
						_a							:       List[Any]       					=			layer_norm_eps
						_a							:       Union[str, Any]       					=			qkv_bias
						_a							:       Optional[int]       					=			use_mean_pooling

						_a							:       Any       					=			decoder_num_attention_heads
						_a							:       int       					=			decoder_hidden_size
						_a							:       str       					=			decoder_num_hidden_layers
						_a							:       Optional[Any]       					=			decoder_intermediate_size
						_a							:       int       					=			norm_pix_loss








'''simple docstring'''





from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like





def UpperCAmelCase						(					UpperCAmelCase_      ,  UpperCAmelCase_=3	):
    _a							:       Optional[Any]       					=			int(mask / 2	)
    # copy image size
    _a							:       Optional[int]       					=			zeros_like(UpperCAmelCase_	)
    for i in range(UpperCAmelCase_      ,  gray_img.shape[0] - bd	):
        for j in range(UpperCAmelCase_      ,  gray_img.shape[1] - bd	):
            # get mask according with mask
            _a							:       List[str]       					=			ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]	)
            # calculate mask median
            _a							:       Optional[Any]       					=			sort(UpperCAmelCase_	)[inta(divide((multiply(UpperCAmelCase_      ,  UpperCAmelCase_	))      ,  2	) + 1	)]
            _a							:       int       					=			median
    return median_img


if __name__ == "__main__":
  # read original image
  a		:  List[Any]   			=			imread('''../image_data/lena.jpg''')
  # turn image in gray scale value
  a		:  Optional[Any]   			=			cvtColor(img, COLOR_BGR2GRAY)

  # get values with two different mask size
  a		:  str   			=			median_filter(gray, 3)
  a		:  Optional[Any]   			=			median_filter(gray, 5)

  # show result images
  imshow('''median filter with 3x3 mask''', medianaxa)
  imshow('''median filter with 5x5 mask''', medianaxa)
  waitKey(0)


