





from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCAmelCase_					:   Dict 							=						logging.get_logger(__name__)

UpperCAmelCase_					:   int 							=						{
    'hustvl/yolos-small': 'https://huggingface.co/hustvl/yolos-small/resolve/main/config.json',
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}





class      lowercase__    (							__A  ):
  __UpperCamelCase	     =  """yolos"""







  def __init__(	self    ,						_lowercase=768    ,						_lowercase=12    ,						_lowercase=12    ,						_lowercase=3_072    ,						_lowercase="gelu"    ,						_lowercase=0.0    ,						_lowercase=0.0    ,						_lowercase=0.02    ,						_lowercase=1e-12    ,						_lowercase=[512, 864]    ,						_lowercase=16    ,						_lowercase=3    ,						_lowercase=True    ,						_lowercase=100    ,						_lowercase=True    ,						_lowercase=False    ,						_lowercase=1    ,						_lowercase=5    ,						_lowercase=2    ,						_lowercase=5    ,						_lowercase=2    ,						_lowercase=0.1    ,						**_lowercase    ,						):
       super().__init__(**__A						)

       lowerCAmelCase_					:       List[Any]    =		hidden_size
       lowerCAmelCase_					:       List[str]    =		num_hidden_layers
       lowerCAmelCase_					:       Any    =		num_attention_heads
       lowerCAmelCase_					:       str    =		intermediate_size
       lowerCAmelCase_					:       Optional[int]    =		hidden_act
       lowerCAmelCase_					:       Union[str, Any]    =		hidden_dropout_prob
       lowerCAmelCase_					:       Tuple    =		attention_probs_dropout_prob
       lowerCAmelCase_					:       Any    =		initializer_range
       lowerCAmelCase_					:       Optional[Any]    =		layer_norm_eps
       lowerCAmelCase_					:       Dict    =		image_size
       lowerCAmelCase_					:       Dict    =		patch_size
       lowerCAmelCase_					:       Dict    =		num_channels
       lowerCAmelCase_					:       List[str]    =		qkv_bias
       lowerCAmelCase_					:       Optional[int]    =		num_detection_tokens
       lowerCAmelCase_					:       Tuple    =		use_mid_position_embeddings
       lowerCAmelCase_					:       List[str]    =		auxiliary_loss
       # Hungarian matcher
       lowerCAmelCase_					:       List[Any]    =		class_cost
       lowerCAmelCase_					:       List[str]    =		bbox_cost
       lowerCAmelCase_					:       str    =		giou_cost
       # Loss coefficients
       lowerCAmelCase_					:       Optional[int]    =		bbox_loss_coefficient
       lowerCAmelCase_					:       List[str]    =		giou_loss_coefficient
       lowerCAmelCase_					:       Tuple    =		eos_coefficient





class      lowercase__    (							__A  ):
  __UpperCamelCase	     =  version.parse("""1.11"""  )







  @property
  def 	UpperCAmelCase__		(	self						):
       return OrderedDict(
           [
               ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
           ]						)







  @property
  def 	UpperCAmelCase__		(	self						):
       return 1e-4







  @property
  def 	UpperCAmelCase__		(	self						):
       return 12







# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCAmelCase_					:   Tuple 							=						{
    """configuration_vivit""": ["""VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """VivitConfig"""],
}
try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCAmelCase_					:   Tuple 							=						["""VivitImageProcessor"""]


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCAmelCase_					:   Any 							=						[
          """VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """VivitModel""",
          """VivitPreTrainedModel""",
          """VivitForVideoClassification""",
      ]


if TYPE_CHECKING:
      from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .image_processing_vivit import VivitImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_vivit import (
                VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                VivitForVideoClassification,
                VivitModel,
                VivitPreTrainedModel,
            )


else:
      import sys

      UpperCAmelCase_					:   Dict 							=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
