


'''simple docstring'''

import colorsys
import io

import cva
import matplotlib as mpl
import matplotlib.colors as mplc
import matplotlib.figure as mplfigure
import numpy as np
import torch
from matplotlib.backends.backend_agg import FigureCanvasAgg

from utils import img_tensorize


lowerCamelCase							:       Any  						=     1_000
class   __lowerCAmelCase						:





      '''simple docstring'''






      def __init__(self   :   List[str]       ,						UpperCamelCase   :   Tuple       ,						UpperCamelCase   :   str=1.2       ,						UpperCamelCase   :   Dict="g"       ,						UpperCamelCase   :   int=0.5       ,						UpperCamelCase   :   Optional[Any]="-"       ,						UpperCamelCase   :   Optional[int]="test_out.jpg"       ,						UpperCamelCase   :   str=True       ,						UpperCamelCase   :   str=False       ,						UpperCamelCase   :   Tuple=None       ,						UpperCamelCase   :   List[Any]=None       ,						UpperCamelCase   :   List[Any]=0.7       ,						):

             '''simple docstring'''







             if isinstance(UpperCamelCase       ,						torch.Tensor			):
                    lowercase__				      =			img.numpy().astype('''np.uint8'''			)
             if isinstance(UpperCamelCase       ,						UpperCamelCase			):
                    lowercase__				      =			img_tensorize(UpperCamelCase			)
             assert isinstance(UpperCamelCase       ,						np.ndarray			)

             lowercase__      ,lowercase__				      =			img.shape[1], img.shape[0]
             lowercase__				      =			mplfigure.Figure(frameon=UpperCamelCase			)
             lowercase__				      =			fig.get_dpi()
             lowercase__				      =			(width * scale + 1E-2) / dpi
             lowercase__				      =			(height * scale + 1E-2) / dpi
             fig.set_size_inches(UpperCamelCase       ,						UpperCamelCase			)
             lowercase__				      =			fig.add_axes([0.0, 0.0, 1.0, 1.0]			)
             ax.axis('''off'''			)
             ax.set_xlim(0.0       ,						UpperCamelCase			)
             ax.set_ylim(UpperCamelCase			)

             lowercase__				      =			saveas
             lowercase__				      =			rgb
             lowercase__				      =			pynb
             lowercase__				      =			img
             lowercase__				      =			edgecolor
             lowercase__				      =			0.5
             lowercase__				      =			linestyle
             lowercase__				      =			int(np.sqrt(min(UpperCamelCase       ,						UpperCamelCase			)			) * scale // 3			)
             lowercase__				      =			width
             lowercase__				      =			height
             lowercase__				      =			scale
             lowercase__				      =			fig
             lowercase__				      =			ax
             lowercase__				      =			pad
             lowercase__				      =			idaobj
             lowercase__				      =			idaattr
             lowercase__				      =			FigureCanvasAgg(UpperCamelCase			)



      def 				UpperCamelCase__		(self   :   str       ,						UpperCamelCase   :   List[str]       ,						UpperCamelCase   :   List[Any]=None			):

             '''simple docstring'''







             if color is None:
                    lowercase__				      =			self.edgecolor
             ((lowercase__)      ,(lowercase__)      ,(lowercase__)      ,(lowercase__))				      =			box
             lowercase__				      =			xa - xa
             lowercase__				      =			ya - ya
             self.ax.add_patch(
                 mpl.patches.Rectangle(
                     (xa, ya)       ,						UpperCamelCase       ,						UpperCamelCase       ,						fill=UpperCamelCase       ,						edgecolor=UpperCamelCase       ,						linewidth=self.font_size // 3       ,						alpha=self.alpha       ,						linestyle=self.linestyle       ,						)			)



      def 				UpperCamelCase__		(self   :   Tuple       ,						UpperCamelCase   :   Tuple       ,						UpperCamelCase   :   List[str]=None       ,						UpperCamelCase   :   List[str]=None       ,						UpperCamelCase   :   Dict=None       ,						UpperCamelCase   :   Dict=None			):

             '''simple docstring'''







             if len(boxes.shape			) > 2:
                    lowercase__				      =			boxes[0]
             if len(obj_ids.shape			) > 1:
                    lowercase__				      =			obj_ids[0]
             if len(obj_scores.shape			) > 1:
                    lowercase__				      =			obj_scores[0]
             if len(attr_ids.shape			) > 1:
                    lowercase__				      =			attr_ids[0]
             if len(attr_scores.shape			) > 1:
                    lowercase__				      =			attr_scores[0]
             if isinstance(UpperCamelCase       ,						torch.Tensor			):
                    lowercase__				      =			boxes.numpy()
             if isinstance(UpperCamelCase       ,						UpperCamelCase			):
                    lowercase__				      =			np.array(UpperCamelCase			)
             assert isinstance(UpperCamelCase       ,						np.ndarray			)
             lowercase__				      =			np.prod(boxes[:, 2:] - boxes[:, :2]       ,						axis=1			)
             lowercase__				      =			np.argsort(-areas			).tolist()
             lowercase__				      =			boxes[sorted_idxs] if boxes is not None else None
             lowercase__				      =			obj_ids[sorted_idxs] if obj_ids is not None else None
             lowercase__				      =			obj_scores[sorted_idxs] if obj_scores is not None else None
             lowercase__				      =			attr_ids[sorted_idxs] if attr_ids is not None else None
             lowercase__				      =			attr_scores[sorted_idxs] if attr_scores is not None else None

             lowercase__				      =			[self._random_color(maximum=1			) for _ in range(len(UpperCamelCase			)			)]
             lowercase__				      =			[assigned_colors[idx] for idx in sorted_idxs]
             if obj_ids is not None:
                    lowercase__				      =			self._create_text_labels_attr(UpperCamelCase       ,						UpperCamelCase       ,						UpperCamelCase       ,						UpperCamelCase			)
                    for i in range(len(UpperCamelCase			)			):
                           lowercase__				      =			assigned_colors[i]
                           self.add_box(boxes[i]       ,						UpperCamelCase			)
                           self.draw_labels(labels[i]       ,						boxes[i]       ,						UpperCamelCase			)



      def 				UpperCamelCase__		(self   :   Union[str, Any]       ,						UpperCamelCase   :   Union[str, Any]       ,						UpperCamelCase   :   Union[str, Any]       ,						UpperCamelCase   :   int			):

             '''simple docstring'''







             lowercase__      ,lowercase__      ,lowercase__      ,lowercase__				      =			box
             lowercase__				      =			(xa, ya)
             lowercase__				      =			(ya - ya) * (xa - xa)
             lowercase__				      =			_SMALL_OBJ * self.scale
             if instance_area < small or ya - ya < 40 * self.scale:
                    if ya >= self.height - 5:
                           lowercase__				      =			(xa, ya)
                    else:
                           lowercase__				      =			(xa, ya)

             lowercase__				      =			(ya - ya) / np.sqrt(self.height * self.width			)
             lowercase__				      =			self._change_color_brightness(UpperCamelCase       ,						brightness_factor=0.7			)
             lowercase__				      =			np.clip((height_ratio - 0.02) / 0.08 + 1       ,						1.2       ,						2			)
             font_size *= 0.75 * self.font_size

             self.draw_text(
                 text=UpperCamelCase       ,						position=UpperCamelCase       ,						color=UpperCamelCase       ,						)



      def 				UpperCamelCase__		(self   :   Tuple       ,						UpperCamelCase   :   Dict       ,						UpperCamelCase   :   Union[str, Any]       ,						UpperCamelCase   :   Any="g"       ,						UpperCamelCase   :   Any="left"       ,						):

             '''simple docstring'''







             lowercase__				      =			0
             lowercase__				      =			self.font_size
             lowercase__				      =			np.maximum(list(mplc.to_rgb(UpperCamelCase			)			)       ,						0.2			)
             lowercase__				      =			max(0.8       ,						np.max(UpperCamelCase			)			)
             lowercase__				      =			{
                 '''facecolor''': '''black''',
                 '''alpha''': self.alpha,
                 '''pad''': self.pad,
                 '''edgecolor''': '''none''',
             }
             lowercase__      ,lowercase__				      =			position
             self.ax.text(
                 UpperCamelCase       ,						UpperCamelCase       ,						UpperCamelCase       ,						size=font_size * self.scale       ,						family='''sans-serif'''       ,						bbox=UpperCamelCase       ,						verticalalignment='''top'''       ,						horizontalalignment=UpperCamelCase       ,						color=UpperCamelCase       ,						zorder=10       ,						rotation=UpperCamelCase       ,						)



      def 				UpperCamelCase__		(self   :   Tuple       ,						UpperCamelCase   :   List[Any]=None			):

             '''simple docstring'''







             if saveas is None:
                    lowercase__				      =			self.saveas
             if saveas.lower().endswith('''.jpg'''			) or saveas.lower().endswith('''.png'''			):
                    cva.imwrite(
                        UpperCamelCase       ,						self._get_buffer()[:, :, ::-1]       ,						)
             else:
                    self.fig.savefig(UpperCamelCase			)



      def 				UpperCamelCase__		(self   :   Optional[Any]       ,						UpperCamelCase   :   Optional[int]       ,						UpperCamelCase   :   Any       ,						UpperCamelCase   :   str       ,						UpperCamelCase   :   Optional[int]			):

             '''simple docstring'''







             lowercase__				      =			[self.idaobj[i] for i in classes]
             lowercase__				      =			[self.idaattr[i] for i in attr_classes]
             lowercase__				      =			[
                 f"{label} {score:.2f} {attr} {attr_score:.2f}"
                 for label, score, attr, attr_score in zip(UpperCamelCase       ,						UpperCamelCase       ,						UpperCamelCase       ,						UpperCamelCase			)
             ]
             return labels



      def 				UpperCamelCase__		(self   :   str       ,						UpperCamelCase   :   List[str]       ,						UpperCamelCase   :   str			):

             '''simple docstring'''







             lowercase__				      =			[self.idaobj[i] for i in classes]
             if scores is not None:
                    if labels is None:
                           lowercase__				      =			['''{:.0f}%'''.format(s * 100			) for s in scores]
                    else:
                           lowercase__				      =			['''{} {:.0f}%'''.format(UpperCamelCase       ,						s * 100			) for li, s in zip(UpperCamelCase       ,						UpperCamelCase			)]
             return labels



      def 				UpperCamelCase__		(self   :   Any       ,						UpperCamelCase   :   Tuple=255			):

             '''simple docstring'''







             lowercase__				      =			np.random.randint(0       ,						len(_COLORS			)			)
             lowercase__				      =			_COLORS[idx] * maximum
             if not self.rgb:
                    lowercase__				      =			ret[::-1]
             return ret



      def 				UpperCamelCase__		(self   :   Optional[Any]			):

             '''simple docstring'''







             if not self.pynb:
                    lowercase__      ,lowercase__				      =			self.canvas.print_to_buffer()
                    if (width, height) != (self.width, self.height):
                           lowercase__				      =			cva.resize(self.img       ,						(width, height)			)
                    else:
                           lowercase__				      =			self.img
             else:
                    lowercase__				      =			io.BytesIO()  # works for cairo backend
                    self.canvas.print_rgba(UpperCamelCase			)
                    lowercase__      ,lowercase__				      =			self.width, self.height
                    lowercase__				      =			buf.getvalue()
                    lowercase__				      =			self.img

             lowercase__				      =			np.frombuffer(UpperCamelCase       ,						dtype='''uint8'''			)
             lowercase__				      =			buffer.reshape(UpperCamelCase       ,						UpperCamelCase       ,						4			)
             lowercase__      ,lowercase__				      =			np.split(UpperCamelCase       ,						[3]       ,						axis=2			)

             try:
                    import numexpr as ne  # fuse them with numexpr

                    lowercase__				      =			ne.evaluate('''img * (1 - alpha / 255.0) + rgb * (alpha / 255.0)'''			)
             except ImportError:
                    lowercase__				      =			alpha.astype('''float32'''			) / 2_55.0
                    lowercase__				      =			img * (1 - alpha) + rgb * alpha

             return visualized_image.astype('''uint8'''			)






      def 				UpperCamelCase__		(self   :   Dict       ,						UpperCamelCase   :   List[Any]       ,						UpperCamelCase   :   int			):

             '''simple docstring'''







             assert brightness_factor >= -1.0 and brightness_factor <= 1.0
             lowercase__				      =			mplc.to_rgb(UpperCamelCase			)
             lowercase__				      =			colorsys.rgb_to_hls(*mplc.to_rgb(UpperCamelCase			)			)
             lowercase__				      =			polygon_color[1] + (brightness_factor * polygon_color[1])
             lowercase__				      =			0.0 if modified_lightness < 0.0 else modified_lightness
             lowercase__				      =			1.0 if modified_lightness > 1.0 else modified_lightness
             lowercase__				      =			colorsys.hls_to_rgb(polygon_color[0]       ,						UpperCamelCase       ,						polygon_color[2]			)
             return modified_color






lowerCamelCase							:       Any  						=     (
    np.array(
        [
            0.0_0_0,
            0.4_4_7,
            0.7_4_1,
            0.8_5_0,
            0.3_2_5,
            0.0_9_8,
            0.9_2_9,
            0.6_9_4,
            0.1_2_5,
            0.4_9_4,
            0.1_8_4,
            0.5_5_6,
            0.4_6_6,
            0.6_7_4,
            0.1_8_8,
            0.3_0_1,
            0.7_4_5,
            0.9_3_3,
            0.6_3_5,
            0.0_7_8,
            0.1_8_4,
            0.3_0_0,
            0.3_0_0,
            0.3_0_0,
            0.6_0_0,
            0.6_0_0,
            0.6_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.7_4_9,
            0.7_4_9,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.3_3_3,
            0.0_0_0,
            0.3_3_3,
            0.6_6_7,
            0.0_0_0,
            0.3_3_3,
            1.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.3_3_3,
            0.0_0_0,
            0.6_6_7,
            0.6_6_7,
            0.0_0_0,
            0.6_6_7,
            1.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.3_3_3,
            0.5_0_0,
            0.0_0_0,
            0.6_6_7,
            0.5_0_0,
            0.0_0_0,
            1.0_0_0,
            0.5_0_0,
            0.3_3_3,
            0.0_0_0,
            0.5_0_0,
            0.3_3_3,
            0.3_3_3,
            0.5_0_0,
            0.3_3_3,
            0.6_6_7,
            0.5_0_0,
            0.3_3_3,
            1.0_0_0,
            0.5_0_0,
            0.6_6_7,
            0.0_0_0,
            0.5_0_0,
            0.6_6_7,
            0.3_3_3,
            0.5_0_0,
            0.6_6_7,
            0.6_6_7,
            0.5_0_0,
            0.6_6_7,
            1.0_0_0,
            0.5_0_0,
            1.0_0_0,
            0.0_0_0,
            0.5_0_0,
            1.0_0_0,
            0.3_3_3,
            0.5_0_0,
            1.0_0_0,
            0.6_6_7,
            0.5_0_0,
            1.0_0_0,
            1.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.3_3_3,
            1.0_0_0,
            0.0_0_0,
            0.6_6_7,
            1.0_0_0,
            0.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.0_0_0,
            1.0_0_0,
            0.3_3_3,
            0.3_3_3,
            1.0_0_0,
            0.3_3_3,
            0.6_6_7,
            1.0_0_0,
            0.3_3_3,
            1.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.0_0_0,
            1.0_0_0,
            0.6_6_7,
            0.3_3_3,
            1.0_0_0,
            0.6_6_7,
            0.6_6_7,
            1.0_0_0,
            0.6_6_7,
            1.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.0_0_0,
            1.0_0_0,
            1.0_0_0,
            0.3_3_3,
            1.0_0_0,
            1.0_0_0,
            0.6_6_7,
            1.0_0_0,
            0.3_3_3,
            0.0_0_0,
            0.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.0_0_0,
            0.0_0_0,
            0.8_3_3,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.1_6_7,
            0.0_0_0,
            0.0_0_0,
            0.3_3_3,
            0.0_0_0,
            0.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.0_0_0,
            0.0_0_0,
            0.8_3_3,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.1_6_7,
            0.0_0_0,
            0.0_0_0,
            0.3_3_3,
            0.0_0_0,
            0.0_0_0,
            0.5_0_0,
            0.0_0_0,
            0.0_0_0,
            0.6_6_7,
            0.0_0_0,
            0.0_0_0,
            0.8_3_3,
            0.0_0_0,
            0.0_0_0,
            1.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.0_0_0,
            0.1_4_3,
            0.1_4_3,
            0.1_4_3,
            0.8_5_7,
            0.8_5_7,
            0.8_5_7,
            1.0_0_0,
            1.0_0_0,
            1.0_0_0,
        ]
    )
    .astype(np.floataa)
    .reshape(-1, 3)
)








'''simple docstring'''

import argparse
import json
import re
from pathlib import Path

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

from transformers import (
    MobileNetVaConfig,
    MobileNetVaForImageClassification,
    MobileNetVaForSemanticSegmentation,
    MobileNetVaImageProcessor,
    load_tf_weights_in_mobilenet_va,
)
from transformers.utils import logging


logging.set_verbosity_info()
lowerCamelCase							:       Dict  						=     logging.get_logger(__name__)

def _SCREAMING_SNAKE_CASE				(A	)	->	Optional[Any]:






       """simple docstring"""







       lowercase__				      =			MobileNetVaConfig(layer_norm_eps=0.001	)

       if "quant" in model_name:
              raise ValueError('''Quantized models are not supported.'''	)

       lowercase__				      =			re.match(R'''^.*mobilenet_v2_([^_]*)_([^_]*)$'''  ,			A	)
       if matches:
              lowercase__				      =			float(matches[1]	)
              lowercase__				      =			int(matches[2]	)

       if model_name.startswith('''deeplabv3_'''	):
              lowercase__				      =			8
              lowercase__				      =			21
              lowercase__				      =			'''pascal-voc-id2label.json'''
       else:
              # The TensorFlow version of MobileNetV2 predicts 1001 classes instead
              # of the usual 1000. The first class (index 0) is "background".
              lowercase__				      =			1_001
              lowercase__				      =			'''imagenet-1k-id2label.json'''

       lowercase__				      =			'''huggingface/label-files'''
       lowercase__				      =			json.load(open(hf_hub_download(A  ,			A  ,			repo_type='''dataset'''	)  ,			'''r'''	)	)

       if config.num_labels == 1_001:
              lowercase__				      =			{int(A	) + 1: v for k, v in idalabel.items()}
              lowercase__				      =			'''background'''
       else:
              lowercase__				      =			{int(A	): v for k, v in idalabel.items()}

       lowercase__				      =			idalabel
       lowercase__				      =			{v: k for k, v in idalabel.items()}

       return config

def _SCREAMING_SNAKE_CASE				()	->	List[Any]:






       """simple docstring"""







       lowercase__				      =			'''http://images.cocodataset.org/val2017/000000039769.jpg'''
       lowercase__				      =			Image.open(requests.get(A  ,			stream=A	).raw	)
       return im

@torch.no_grad()
def _SCREAMING_SNAKE_CASE				(A  ,			A  ,			A  ,			A=False	)	->	Any:






       """simple docstring"""







       lowercase__				      =			get_mobilenet_va_config(A	)

       # Load 🤗 model
       if model_name.startswith('''deeplabv3_'''	):
              lowercase__				      =			MobileNetVaForSemanticSegmentation(A	).eval()
       else:
              lowercase__				      =			MobileNetVaForImageClassification(A	).eval()

       # Load weights from TensorFlow checkpoint
       load_tf_weights_in_mobilenet_va(A  ,			A  ,			A	)

       # Check outputs on an image, prepared by MobileNetV2ImageProcessor
       lowercase__				      =			MobileNetVaImageProcessor(
           crop_size={'''width''': config.image_size, '''height''': config.image_size}  ,			size={'''shortest_edge''': config.image_size + 32}  ,			)
       lowercase__				      =			image_processor(images=prepare_img()  ,			return_tensors='''pt'''	)
       lowercase__				      =			model(**A	)
       lowercase__				      =			outputs.logits

       if model_name.startswith('''deeplabv3_'''	):
              assert logits.shape == (1, 21, 65, 65)

              if model_name == "deeplabv3_mobilenet_v2_1.0_513":
                     lowercase__				      =			torch.tensor(
                         [
                             [[17.5_790, 17.7_581, 18.3_355], [18.3_257, 18.4_230, 18.8_973], [18.6_169, 18.8_650, 19.2_187]],
                             [[-2.1_595, -2.0_977, -2.3_741], [-2.4_226, -2.3_028, -2.6_835], [-2.7_819, -2.5_991, -2.7_706]],
                             [[4.2_058, 4.8_317, 4.7_638], [4.4_136, 5.0_361, 4.9_383], [4.5_028, 4.9_644, 4.8_734]],
                         ]	)

              else:
                     raise ValueError(f"Unknown model name: {model_name}"	)

              assert torch.allclose(logits[0, :3, :3, :3]  ,			A  ,			atol=1E-4	)
       else:
              assert logits.shape == (1, 1_001)

              if model_name == "mobilenet_v2_1.4_224":
                     lowercase__				      =			torch.tensor([0.0_181, -1.0_015, 0.4_688]	)
              elif model_name == "mobilenet_v2_1.0_224":
                     lowercase__				      =			torch.tensor([0.2_445, -1.1_993, 0.1_905]	)
              elif model_name == "mobilenet_v2_0.75_160":
                     lowercase__				      =			torch.tensor([0.2_482, 0.4_136, 0.6_669]	)
              elif model_name == "mobilenet_v2_0.35_96":
                     lowercase__				      =			torch.tensor([0.1_451, -0.4_624, 0.7_192]	)
              else:
                     lowercase__				      =			None

              if expected_logits is not None:
                     assert torch.allclose(logits[0, :3]  ,			A  ,			atol=1E-4	)

       Path(A	).mkdir(exist_ok=A	)
       print(f"Saving model {model_name} to {pytorch_dump_folder_path}"	)
       model.save_pretrained(A	)
       print(f"Saving image processor to {pytorch_dump_folder_path}"	)
       image_processor.save_pretrained(A	)

       if push_to_hub:
              print('''Pushing to the hub...'''	)
              lowercase__				      =			'''google/''' + model_name
              image_processor.push_to_hub(A	)
              model.push_to_hub(A	)


if __name__ == "__main__":
 lowerCamelCase							:       int  						=     argparse.ArgumentParser()
 # Required parameters
 parser.add_argument(
     '--model_name',
     default='mobilenet_v2_1.0_224',
     type=str,
     help='Name of the MobileNetV2 model you\'d like to convert. Should in the form \'mobilenet_v2_<depth>_<size>\'.',
 )
 parser.add_argument(
     '--checkpoint_path', required=True, type=str, help='Path to the original TensorFlow checkpoint (.ckpt file).'
 )
 parser.add_argument(
     '--pytorch_dump_folder_path', required=True, 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.'
 )

 lowerCamelCase							:       int  						=     parser.parse_args()
 convert_movilevit_checkpoint(
     args.model_name, args.checkpoint_path, args.pytorch_dump_folder_path, args.push_to_hub
 )




