



"""simple docstring"""






import inspect
import unittest

from transformers import RegNetConfig
from transformers.file_utils import cached_property, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
   import torch
   from torch import nn

   from transformers import RegNetForImageClassification, RegNetModel
   from transformers.models.regnet.modeling_regnet import REGNET_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
   from PIL import Image

   from transformers import AutoImageProcessor






class 			__snake_case			:




  def __init__(					self	:		Optional[Any]		,   __lowerCAmelCase	:		Optional[int]		,   __lowerCAmelCase	:		Union[str, Any]=3		,   __lowerCAmelCase	:		List[Any]=3_2		,   __lowerCAmelCase	:		Tuple=3		,   __lowerCAmelCase	:		Union[str, Any]=1_0		,   __lowerCAmelCase	:		Union[str, Any]=[1_0, 2_0, 3_0, 4_0]		,   __lowerCAmelCase	:		Any=[1, 1, 2, 1]		,   __lowerCAmelCase	:		Tuple=True		,   __lowerCAmelCase	:		Union[str, Any]=True		,   __lowerCAmelCase	:		Tuple="relu"		,   __lowerCAmelCase	:		Tuple=3		,   __lowerCAmelCase	:		List[str]=None		,   ):






         """simple docstring"""






         _lowerCamelCase		:							str            =					parent
         _lowerCamelCase		:							Dict            =					batch_size
         _lowerCamelCase		:							int            =					image_size
         _lowerCamelCase		:							int            =					num_channels
         _lowerCamelCase		:							List[str]            =					embeddings_size
         _lowerCamelCase		:							Optional[Any]            =					hidden_sizes
         _lowerCamelCase		:							Dict            =					depths
         _lowerCamelCase		:							Optional[int]            =					is_training
         _lowerCamelCase		:							List[Any]            =					use_labels
         _lowerCamelCase		:							Dict            =					hidden_act
         _lowerCamelCase		:							Tuple            =					num_labels
         _lowerCamelCase		:							Dict            =					scope
         _lowerCamelCase		:							List[str]            =					len(__lowerCAmelCase						)




  def 		SCREAMING_SNAKE_CASE							(					self	:		Any						):






         """simple docstring"""






         _lowerCamelCase		:							Tuple            =					floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]						)

         _lowerCamelCase		:							int            =					None
         if self.use_labels:
                _lowerCamelCase		:							Union[str, Any]            =					ids_tensor([self.batch_size]		,   self.num_labels						)

         _lowerCamelCase		:							Union[str, Any]            =					self.get_config()

         return config, pixel_values, labels




  def 		SCREAMING_SNAKE_CASE							(					self	:		List[str]						):






         """simple docstring"""






         return RegNetConfig(
             num_channels=self.num_channels		,   embeddings_size=self.embeddings_size		,   hidden_sizes=self.hidden_sizes		,   depths=self.depths		,   hidden_act=self.hidden_act		,   num_labels=self.num_labels		,   )




  def 		SCREAMING_SNAKE_CASE							(					self	:		List[str]		,   __lowerCAmelCase	:		Optional[Any]		,   __lowerCAmelCase	:		str		,   __lowerCAmelCase	:		List[str]						):






         """simple docstring"""






         _lowerCamelCase		:							str            =					RegNetModel(config=__lowerCAmelCase						)
         model.to(__lowerCAmelCase						)
         model.eval()
         _lowerCamelCase		:							List[str]            =					model(__lowerCAmelCase						)
         # expected last hidden states: B, C, H // 32, W // 32
         self.parent.assertEqual(
             result.last_hidden_state.shape		,   (self.batch_size, self.hidden_sizes[-1], self.image_size // 3_2, self.image_size // 3_2)		,   )




  def 		SCREAMING_SNAKE_CASE							(					self	:		Dict		,   __lowerCAmelCase	:		Optional[Any]		,   __lowerCAmelCase	:		Any		,   __lowerCAmelCase	:		List[str]						):






         """simple docstring"""






         _lowerCamelCase		:							Dict            =					self.num_labels
         _lowerCamelCase		:							str            =					RegNetForImageClassification(__lowerCAmelCase						)
         model.to(__lowerCAmelCase						)
         model.eval()
         _lowerCamelCase		:							Any            =					model(__lowerCAmelCase		,   labels=__lowerCAmelCase						)
         self.parent.assertEqual(result.logits.shape		,   (self.batch_size, self.num_labels)						)




  def 		SCREAMING_SNAKE_CASE							(					self	:		int						):






         """simple docstring"""






         _lowerCamelCase		:							Optional[int]            =					self.prepare_config_and_inputs()
         _lowerCamelCase     ,       _lowerCamelCase     ,       _lowerCamelCase		:							Optional[int]            =					config_and_inputs
         _lowerCamelCase		:							Union[str, Any]            =					{'''pixel_values''': pixel_values}
         return config, inputs_dict






@require_torch
class 			__snake_case			(      _lowercase    ,	_lowercase    ,	unittest.TestCase):
  snake_case__							:  Any         =		(RegNetModel, RegNetForImageClassification) if is_torch_available() else ()
  snake_case__							:  int         =		(
      {"feature-extraction": RegNetModel, "image-classification": RegNetForImageClassification}
      if is_torch_available()
      else {}
  )

  snake_case__							:  Dict         =		False
  snake_case__							:  List[Any]         =		False
  snake_case__							:  Optional[int]         =		False
  snake_case__							:  List[str]         =		False




  def 		SCREAMING_SNAKE_CASE							(					self	:		Dict						):






         """simple docstring"""






         _lowerCamelCase		:							Tuple            =					RegNetModelTester(self						)
         _lowerCamelCase		:							List[str]            =					ConfigTester(self		,   config_class=__lowerCAmelCase		,   has_text_modality=__lowerCAmelCase						)




  def 		SCREAMING_SNAKE_CASE							(					self	:		int						):






         """simple docstring"""






         self.create_and_test_config_common_properties()
         self.config_tester.create_and_test_config_to_json_string()
         self.config_tester.create_and_test_config_to_json_file()
         self.config_tester.create_and_test_config_from_and_save_pretrained()
         self.config_tester.create_and_test_config_with_num_labels()
         self.config_tester.check_config_can_be_init_without_params()
         self.config_tester.check_config_arguments_init()




  def 		SCREAMING_SNAKE_CASE							(					self	:		str						):






         """simple docstring"""






         return




  @unittest.skip(reason='''RegNet does not use inputs_embeds'''						)
  def 		SCREAMING_SNAKE_CASE							(					self	:		Dict						):






         """simple docstring"""






         pass




  @unittest.skip(reason='''RegNet does not support input and output embeddings'''						)
  def 		SCREAMING_SNAKE_CASE							(					self	:		int						):






         """simple docstring"""






         pass




  def 		SCREAMING_SNAKE_CASE							(					self	:		Dict						):






         """simple docstring"""






         _lowerCamelCase     ,       _lowerCamelCase		:							str            =					self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
                _lowerCamelCase		:							Optional[Any]            =					model_class(__lowerCAmelCase						)
                _lowerCamelCase		:							Tuple            =					inspect.signature(model.forward						)
                # signature.parameters is an OrderedDict => so arg_names order is deterministic
                _lowerCamelCase		:							Optional[int]            =					[*signature.parameters.keys()]

                _lowerCamelCase		:							str            =					['''pixel_values''']
                self.assertListEqual(arg_names[:1]		,   __lowerCAmelCase						)




  def 		SCREAMING_SNAKE_CASE							(					self	:		Tuple						):






         """simple docstring"""






         _lowerCamelCase		:							Any            =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*__lowerCAmelCase						)




  def 		SCREAMING_SNAKE_CASE							(					self	:		Optional[Any]						):






         """simple docstring"""






         _lowerCamelCase     ,       _lowerCamelCase		:							int            =					self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
                _lowerCamelCase		:							List[Any]            =					model_class(config=__lowerCAmelCase						)
                for name, module in model.named_modules():
                       if isinstance(__lowerCAmelCase		,   (nn.BatchNormad, nn.GroupNorm)						):
                              self.assertTrue(
                                  torch.all(module.weight == 1						)		,   msg=f'''Parameter {name} of model {model_class} seems not properly initialized'''		,   )
                              self.assertTrue(
                                  torch.all(module.bias == 0						)		,   msg=f'''Parameter {name} of model {model_class} seems not properly initialized'''		,   )




  def 		SCREAMING_SNAKE_CASE							(					self	:		int						):






         """simple docstring"""






         def check_hidden_states_output(__lowerCAmelCase	:		Optional[Any]		,   __lowerCAmelCase	:		Dict		,   __lowerCAmelCase	:		Dict						):
                _lowerCamelCase		:							Optional[int]            =					model_class(__lowerCAmelCase						)
                model.to(__lowerCAmelCase						)
                model.eval()

                with torch.no_grad():
                       _lowerCamelCase		:							Optional[Any]            =					model(**self._prepare_for_class(__lowerCAmelCase		,   __lowerCAmelCase						)						)

                _lowerCamelCase		:							Union[str, Any]            =					outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

                _lowerCamelCase		:							Any            =					self.model_tester.num_stages
                self.assertEqual(len(__lowerCAmelCase						)		,   expected_num_stages + 1						)

                # RegNet's feature maps are of shape (batch_size, num_channels, height, width)
                self.assertListEqual(
                    list(hidden_states[0].shape[-2:]						)		,   [self.model_tester.image_size // 2, self.model_tester.image_size // 2]		,   )

         _lowerCamelCase     ,       _lowerCamelCase		:							Any            =					self.model_tester.prepare_config_and_inputs_for_common()
         _lowerCamelCase		:							Dict            =					['''basic''', '''bottleneck''']
         for model_class in self.all_model_classes:
                for layer_type in layers_type:
                       _lowerCamelCase		:							Tuple            =					layer_type
                       _lowerCamelCase		:							Tuple            =					True
                       check_hidden_states_output(__lowerCAmelCase		,   __lowerCAmelCase		,   __lowerCAmelCase						)

                       # check that output_hidden_states also work using config
                       del inputs_dict["output_hidden_states"]
                       _lowerCamelCase		:							List[Any]            =					True

                       check_hidden_states_output(__lowerCAmelCase		,   __lowerCAmelCase		,   __lowerCAmelCase						)




  def 		SCREAMING_SNAKE_CASE							(					self	:		str						):






         """simple docstring"""






         _lowerCamelCase		:							Optional[Any]            =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_image_classification(*__lowerCAmelCase						)




  @slow
  def 		SCREAMING_SNAKE_CASE							(					self	:		List[Any]						):






         """simple docstring"""






         for model_name in REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                _lowerCamelCase		:							int            =					RegNetModel.from_pretrained(__lowerCAmelCase						)
                self.assertIsNotNone(__lowerCAmelCase						)






def 			snake_case_    ( ):


       '''simple docstring'''





       _lowerCamelCase		:							List[Any]            =					Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''		)
       return image







@require_torch
@require_vision
class 			__snake_case			(      unittest.TestCase):




  @cached_property
  def 		SCREAMING_SNAKE_CASE							(					self	:		List[Any]						):






         """simple docstring"""






         return (
             AutoImageProcessor.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]						)
             if is_vision_available()
             else None
         )




  @slow
  def 		SCREAMING_SNAKE_CASE							(					self	:		List[str]						):






         """simple docstring"""






         _lowerCamelCase		:							Optional[Any]            =					RegNetForImageClassification.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]						).to(__lowerCAmelCase						)

         _lowerCamelCase		:							str            =					self.default_image_processor
         _lowerCamelCase		:							int            =					prepare_img()
         _lowerCamelCase		:							Tuple            =					image_processor(images=__lowerCAmelCase		,   return_tensors='''pt'''						).to(__lowerCAmelCase						)

         # forward pass
         with torch.no_grad():
                _lowerCamelCase		:							Optional[Any]            =					model(**__lowerCAmelCase						)

         # verify the logits
         _lowerCamelCase		:							Optional[Any]            =					torch.Size((1, 1_0_0_0)						)
         self.assertEqual(outputs.logits.shape		,   __lowerCAmelCase						)

         _lowerCamelCase		:							Optional[int]            =					torch.tensor([-0.41_80, -1.50_51, -3.48_36]						).to(__lowerCAmelCase						)

         self.assertTrue(torch.allclose(outputs.logits[0, :3]		,   __lowerCAmelCase		,   atol=1E-4						)						)









import argparse
import json

import requests
import torch
from huggingface_hub import hf_hub_download
from PIL import Image

from transformers import ConvNextConfig, SegformerImageProcessor, UperNetConfig, UperNetForSemanticSegmentation







def   __lowerCamelCase   (				__a  :int       )						->							int:






		"""simple docstring"""

		A__     =  3_8_4
		if "tiny" in model_name:
				A__     =  [3, 3, 9, 3]
				A__     =  [9_6, 1_9_2, 3_8_4, 7_6_8]
		if "small" in model_name:
				A__     =  [3, 3, 2_7, 3]
				A__     =  [9_6, 1_9_2, 3_8_4, 7_6_8]
		if "base" in model_name:
				A__     =  [3, 3, 2_7, 3]
				A__     =  [1_2_8, 2_5_6, 5_1_2, 1_0_2_4]
				A__     =  5_1_2
		if "large" in model_name:
				A__     =  [3, 3, 2_7, 3]
				A__     =  [1_9_2, 3_8_4, 7_6_8, 1_5_3_6]
				A__     =  7_6_8
		if "xlarge" in model_name:
				A__     =  [3, 3, 2_7, 3]
				A__     =  [2_5_6, 5_1_2, 1_0_2_4, 2_0_4_8]
				A__     =  1_0_2_4

		# set label information
		A__     =  1_5_0
		A__     =  """huggingface/label-files"""
		A__     =  """ade20k-id2label.json"""
		A__     =  json.load(open(hf_hub_download(__a       ,	__a       ,	repo_type="""dataset"""       )       ,	"""r"""       )       )
		A__     =  {int(__a       ): v for k, v in idalabel.items()}
		A__     =  {v: k for k, v in idalabel.items()}

		A__     =  ConvNextConfig(
		    depths=__a       ,	hidden_sizes=__a       ,	out_features=["""stage1""", """stage2""", """stage3""", """stage4"""]       )
		A__     =  UperNetConfig(
		    backbone_config=__a       ,	auxiliary_in_channels=__a       ,	num_labels=__a       ,	idalabel=__a       ,	labelaid=__a       ,	)

		return config







def   __lowerCamelCase   (				__a  :Union[str, Any]       )						->							List[Any]:






		"""simple docstring"""

		A__     =  []

		# fmt: off
		# stem
		rename_keys.append(("""backbone.downsample_layers.0.0.weight""", """backbone.embeddings.patch_embeddings.weight""")       )
		rename_keys.append(("""backbone.downsample_layers.0.0.bias""", """backbone.embeddings.patch_embeddings.bias""")       )
		rename_keys.append(("""backbone.downsample_layers.0.1.weight""", """backbone.embeddings.layernorm.weight""")       )
		rename_keys.append(("""backbone.downsample_layers.0.1.bias""", """backbone.embeddings.layernorm.bias""")       )
		# stages
		for i in range(len(config.backbone_config.depths       )       ):
				for j in range(config.backbone_config.depths[i]       ):
						rename_keys.append((F'backbone.stages.{i}.{j}.gamma', F'backbone.encoder.stages.{i}.layers.{j}.layer_scale_parameter')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.depthwise_conv.weight', F'backbone.encoder.stages.{i}.layers.{j}.dwconv.weight')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.depthwise_conv.bias', F'backbone.encoder.stages.{i}.layers.{j}.dwconv.bias')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.norm.weight', F'backbone.encoder.stages.{i}.layers.{j}.layernorm.weight')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.norm.bias', F'backbone.encoder.stages.{i}.layers.{j}.layernorm.bias')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.pointwise_conv1.weight', F'backbone.encoder.stages.{i}.layers.{j}.pwconv1.weight')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.pointwise_conv1.bias', F'backbone.encoder.stages.{i}.layers.{j}.pwconv1.bias')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.pointwise_conv2.weight', F'backbone.encoder.stages.{i}.layers.{j}.pwconv2.weight')       )
						rename_keys.append((F'backbone.stages.{i}.{j}.pointwise_conv2.bias', F'backbone.encoder.stages.{i}.layers.{j}.pwconv2.bias')       )
				if i > 0:
						rename_keys.append((F'backbone.downsample_layers.{i}.0.weight', F'backbone.encoder.stages.{i}.downsampling_layer.0.weight')       )
						rename_keys.append((F'backbone.downsample_layers.{i}.0.bias', F'backbone.encoder.stages.{i}.downsampling_layer.0.bias')       )
						rename_keys.append((F'backbone.downsample_layers.{i}.1.weight', F'backbone.encoder.stages.{i}.downsampling_layer.1.weight')       )
						rename_keys.append((F'backbone.downsample_layers.{i}.1.bias', F'backbone.encoder.stages.{i}.downsampling_layer.1.bias')       )

				rename_keys.append((F'backbone.norm{i}.weight', F'backbone.hidden_states_norms.stage{i+1}.weight')       )
				rename_keys.append((F'backbone.norm{i}.bias', F'backbone.hidden_states_norms.stage{i+1}.bias')       )

		# decode head
		rename_keys.extend(
		    [
		        ("""decode_head.conv_seg.weight""", """decode_head.classifier.weight"""),
		        ("""decode_head.conv_seg.bias""", """decode_head.classifier.bias"""),
		        ("""auxiliary_head.conv_seg.weight""", """auxiliary_head.classifier.weight"""),
		        ("""auxiliary_head.conv_seg.bias""", """auxiliary_head.classifier.bias"""),
		    ]       )
		# fmt: on

		return rename_keys







def   __lowerCamelCase   (				__a  :Union[str, Any]       ,	__a  :List[str]       ,	__a  :str       )						->							str:






		"""simple docstring"""

		A__     =  dct.pop(__a       )
		A__     =  val







def   __lowerCamelCase   (				__a  :Any       ,	__a  :int       ,	__a  :Any       )						->							List[Any]:






		"""simple docstring"""

		A__     =  {
		    """upernet-convnext-tiny""": """https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k/upernet_convnext_tiny_fp16_512x512_160k_ade20k_20220227_124553-cad485de.pth""",
		    """upernet-convnext-small""": """https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_small_fp16_512x512_160k_ade20k/upernet_convnext_small_fp16_512x512_160k_ade20k_20220227_131208-1b1e394f.pth""",
		    """upernet-convnext-base""": """https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_base_fp16_512x512_160k_ade20k/upernet_convnext_base_fp16_512x512_160k_ade20k_20220227_181227-02a24fc6.pth""",
		    """upernet-convnext-large""": """https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_large_fp16_640x640_160k_ade20k/upernet_convnext_large_fp16_640x640_160k_ade20k_20220226_040532-e57aa54d.pth""",
		    """upernet-convnext-xlarge""": """https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_xlarge_fp16_640x640_160k_ade20k/upernet_convnext_xlarge_fp16_640x640_160k_ade20k_20220226_080344-95fc38c2.pth""",
		}
		A__     =  model_name_to_url[model_name]
		A__     =  torch.hub.load_state_dict_from_url(__a       ,	map_location="""cpu"""       )["""state_dict"""]

		A__     =  get_upernet_config(__a       )
		A__     =  UperNetForSemanticSegmentation(__a       )
		model.eval()

		# replace "bn" => "batch_norm"
		for key in state_dict.copy().keys():
				A__     =  state_dict.pop(__a       )
				if "bn" in key:
						A__     =  key.replace("""bn"""       ,	"""batch_norm"""       )
				A__     =  val

		# rename keys
		A__     =  create_rename_keys(__a       )
		for src, dest in rename_keys:
				rename_key(__a       ,	__a       ,	__a       )

		model.load_state_dict(__a       )

		# verify on image
		A__     =  """https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000001.jpg"""
		A__     =  Image.open(requests.get(__a       ,	stream=__a       ).raw       ).convert("""RGB"""       )

		A__     =  SegformerImageProcessor()
		A__     =  processor(__a       ,	return_tensors="""pt"""       ).pixel_values

		with torch.no_grad():
				A__     =  model(__a       )

		if model_name == "upernet-convnext-tiny":
				A__     =  torch.tensor(
				    [[-8.8110, -8.8110, -8.6521], [-8.8110, -8.8110, -8.6521], [-8.7746, -8.7746, -8.6130]]       )
		elif model_name == "upernet-convnext-small":
				A__     =  torch.tensor(
				    [[-8.8236, -8.8236, -8.6771], [-8.8236, -8.8236, -8.6771], [-8.7638, -8.7638, -8.6240]]       )
		elif model_name == "upernet-convnext-base":
				A__     =  torch.tensor(
				    [[-8.8558, -8.8558, -8.6905], [-8.8558, -8.8558, -8.6905], [-8.7669, -8.7669, -8.6021]]       )
		elif model_name == "upernet-convnext-large":
				A__     =  torch.tensor(
				    [[-8.6660, -8.6660, -8.6210], [-8.6660, -8.6660, -8.6210], [-8.6310, -8.6310, -8.5964]]       )
		elif model_name == "upernet-convnext-xlarge":
				A__     =  torch.tensor(
				    [[-8.4980, -8.4980, -8.3977], [-8.4980, -8.4980, -8.3977], [-8.4379, -8.4379, -8.3412]]       )
		print("""Logits:"""       ,	outputs.logits[0, 0, :3, :3]       )
		assert torch.allclose(outputs.logits[0, 0, :3, :3]       ,	__a       ,	atol=1E-4       )
		print("""Looks ok!"""       )

		if pytorch_dump_folder_path is not None:
				print(F'Saving model {model_name} to {pytorch_dump_folder_path}'       )
				model.save_pretrained(__a       )
				print(F'Saving processor to {pytorch_dump_folder_path}'       )
				processor.save_pretrained(__a       )

		if push_to_hub:
				print(F'Pushing model and processor for {model_name} to hub'       )
				model.push_to_hub(F'openmmlab/{model_name}'       )
				processor.push_to_hub(F'openmmlab/{model_name}'       )


if __name__ == "__main__":
					A       :   Optional[int]					= argparse.ArgumentParser()
					# Required parameters
					parser.add_argument(
					    '''--model_name''',
					    default='''upernet-convnext-tiny''',
					    type=str,
					    choices=[F'''upernet-convnext-{size}''' for size in ['''tiny''', '''small''', '''base''', '''large''', '''xlarge''']],
					    help='''Name of the ConvNext UperNet model you\'d like to convert.''',
					)
					parser.add_argument(
					    '''--pytorch_dump_folder_path''', default=None, type=str, help='''Path to the output PyTorch model directory.'''
					)
					parser.add_argument(
					    '''--push_to_hub''', action='''store_true''', help='''Whether or not to push the converted model to the 🤗 hub.'''
					)

					A       :   str					= parser.parse_args()
					convert_upernet_checkpoint(args.model_name, args.pytorch_dump_folder_path, args.push_to_hub)



