



import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


__lowerCamelCase     :							Tuple  							=				logging.get_logger(__name__)





class  __magic_name__   (							A__						):
  lowercase      :       Optional[Any]          ='''upernet'''






  def __init__(						self      :     Optional[Any]				,		UpperCamelCase__      :     Optional[Any]=None				,		UpperCamelCase__      :     List[str]=5_12				,		UpperCamelCase__      :     List[Any]=0.02				,		UpperCamelCase__      :     Any=[1, 2, 3, 6]				,		UpperCamelCase__      :     int=True				,		UpperCamelCase__      :     Optional[Any]=0.4				,		UpperCamelCase__      :     List[Any]=3_84				,		UpperCamelCase__      :     Optional[Any]=2_56				,		UpperCamelCase__      :     Dict=1				,		UpperCamelCase__      :     Optional[int]=False				,		UpperCamelCase__      :     List[str]=2_55				,		**UpperCamelCase__      :     Optional[Any]				,		)				->					Optional[int]:
        '''simple docstring'''







        super().__init__(**UpperCAmelCase__      )

        if backbone_config is None:
              logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."      )
              UpperCAmelCase         =     CONFIG_MAPPING["resnet"](out_features=["stage1", "stage2", "stage3", "stage4"]      )
        elif isinstance(UpperCAmelCase__				,		UpperCAmelCase__      ):
              UpperCAmelCase         =     backbone_config.get("model_type"      )
              UpperCAmelCase         =     CONFIG_MAPPING[backbone_model_type]
              UpperCAmelCase         =     config_class.from_dict(UpperCAmelCase__      )

        UpperCAmelCase         =     backbone_config
        UpperCAmelCase         =     hidden_size
        UpperCAmelCase         =     initializer_range
        UpperCAmelCase         =     pool_scales
        UpperCAmelCase         =     use_auxiliary_head
        UpperCAmelCase         =     auxiliary_loss_weight
        UpperCAmelCase         =     auxiliary_in_channels
        UpperCAmelCase         =     auxiliary_channels
        UpperCAmelCase         =     auxiliary_num_convs
        UpperCAmelCase         =     auxiliary_concat_input
        UpperCAmelCase         =     loss_ignore_index







  def SCREAMING_SNAKE_CASE_			(						self      :     Optional[Any]      )				->					Tuple:
        '''simple docstring'''







        UpperCAmelCase         =     copy.deepcopy(self.__dict__      )
        UpperCAmelCase         =     self.backbone_config.to_dict()
        UpperCAmelCase         =     self.__class__.model_type
        return output








from argparse import ArgumentParser

from .env import EnvironmentCommand

def    lowerCamelCase_() ->       Any:
						UpperCAmelCase         =     ArgumentParser("Diffusers CLI tool"    ,   usage="diffusers-cli <command> [<args>]"    )
						UpperCAmelCase         =     parser.add_subparsers(help="diffusers-cli command helpers"    )

						# Register commands
						EnvironmentCommand.register_subcommand(lowerCamelCase_    )

						# Let's go
						UpperCAmelCase         =     parser.parse_args()

						if not hasattr(lowerCamelCase_    ,   "func"    ):
												parser.print_help()
												exit(1    )

						# Run
						UpperCAmelCase         =     args.func(lowerCamelCase_    )
						service.run()


if __name__ == "__main__":
		main()



