


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


_snake_case					=					logging.get_logger(__name__)

_snake_case					=					{
    '''MCG-NJU/videomae-base''': '''https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json''',
}
class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   __A			:				str							=		"videomae"






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






     """simple docstring"""





     super().__init__(**__A			)

     lowerCamelCase			: Any   =    image_size
     lowerCamelCase			: Tuple   =    patch_size
     lowerCamelCase			: Dict   =    num_channels
     lowerCamelCase			: Any   =    num_frames
     lowerCamelCase			: List[Any]   =    tubelet_size

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

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







import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
   from PIL import Image
class      UpperCAmelCase_ ( unittest.TestCase		,			UpperCamelCase   ):

   '''simple docstring'''




   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: List[Any]   =    load_tool("image-segmentation"			)
     self.tool.setup()
     lowerCamelCase			: Optional[Any]   =    load_tool("image-segmentation"						,    remote=__A			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: List[str]   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: Dict   =    self.tool(__A						,    "cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: int   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: int   =    self.remote_tool(__A						,    "cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: Optional[int]   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: Optional[Any]   =    self.tool(image=__A						,    label="cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)






   def _snake_case   (		self			):






     """simple docstring"""





     lowerCamelCase			: str   =    Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"			)			) / "000000039769.png"			)
     lowerCamelCase			: Dict   =    self.remote_tool(image=__A						,    label="cat"			)
     self.assertTrue(isinstance(__A						,    Image.Image			)			)



