
"""simple docstring"""




import gc
import random
import tempfile
import unittest

import numpy as np
import torch
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMInverseScheduler,
    DDIMScheduler,
    DPMSolverMultistepInverseScheduler,
    DPMSolverMultistepScheduler,
    StableDiffusionDiffEditPipeline,
    UNetaDConditionModel,
)
from diffusers.utils import load_image, slow
from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, require_torch_gpu, torch_device

from ..pipeline_params import TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS, TEXT_GUIDED_IMAGE_INPAINTING_PARAMS
from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin


enable_full_determinism()







class   _lowercase						(       lowerCAmelCase_	,   lowerCAmelCase_	,   unittest.TestCase				):


     '''simple docstring'''





     _A								=							StableDiffusionDiffEditPipeline
     _A								=							TEXT_GUIDED_IMAGE_INPAINTING_PARAMS - {'height', 'width', 'image'} | {'image_latents'}
     _A								=							TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS - {'image'} | {'image_latents'}
     _A								=							frozenset(
         []				)  # TO-DO: update image_params once pipeline is refactored with VaeImageProcessor.preprocess
     _A								=							frozenset([]				)



     def  lowerCAmelCase__       (      self  )->					Any:
          torch.manual_seed(0  )
          UpperCAmelCase__							: Union[str, Any] 							=						UNetaDConditionModel(
              block_out_channels=(32, 64) ,			layers_per_block=2 ,			sample_size=32 ,			in_channels=4 ,			out_channels=4 ,			down_block_types=("DownBlock2D", "CrossAttnDownBlock2D") ,			up_block_types=("CrossAttnUpBlock2D", "UpBlock2D") ,			cross_attention_dim=32 ,			attention_head_dim=(2, 4) ,			use_linear_projection=__UpperCamelCase ,			)
          UpperCAmelCase__							: int 							=						DDIMScheduler(
              beta_start=0.0_0085 ,			beta_end=0.012 ,			beta_schedule="scaled_linear" ,			clip_sample=__UpperCamelCase ,			set_alpha_to_one=__UpperCamelCase ,			)
          UpperCAmelCase__							: Optional[Any] 							=						DDIMInverseScheduler(
              beta_start=0.0_0085 ,			beta_end=0.012 ,			beta_schedule="scaled_linear" ,			clip_sample=__UpperCamelCase ,			set_alpha_to_zero=__UpperCamelCase ,			)
          torch.manual_seed(0  )
          UpperCAmelCase__							: Dict 							=						AutoencoderKL(
              block_out_channels=[32, 64] ,			in_channels=3 ,			out_channels=3 ,			down_block_types=["DownEncoderBlock2D", "DownEncoderBlock2D"] ,			up_block_types=["UpDecoderBlock2D", "UpDecoderBlock2D"] ,			latent_channels=4 ,			sample_size=1_28 ,			)
          torch.manual_seed(0  )
          UpperCAmelCase__							: Tuple 							=						CLIPTextConfig(
              bos_token_id=0 ,			eos_token_id=2 ,			hidden_size=32 ,			intermediate_size=37 ,			layer_norm_eps=1E-05 ,			num_attention_heads=4 ,			num_hidden_layers=5 ,			pad_token_id=1 ,			vocab_size=10_00 ,			hidden_act="gelu" ,			projection_dim=5_12 ,			)
          UpperCAmelCase__							: Optional[int] 							=						CLIPTextModel(__UpperCamelCase  )
          UpperCAmelCase__							: int 							=						CLIPTokenizer.from_pretrained("hf-internal-testing/tiny-random-clip"  )

          UpperCAmelCase__							: str 							=						{
              "unet": unet,
              "scheduler": scheduler,
              "inverse_scheduler": inverse_scheduler,
              "vae": vae,
              "text_encoder": text_encoder,
              "tokenizer": tokenizer,
              "safety_checker": None,
              "feature_extractor": None,
          }

          return components



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase=0  )->					List[Any]:
          UpperCAmelCase__							: Optional[Any] 							=						floats_tensor((1, 16, 16) ,			rng=random.Random(__UpperCamelCase  )  ).to(__UpperCamelCase  )
          UpperCAmelCase__							: Union[str, Any] 							=						floats_tensor((1, 2, 4, 16, 16) ,			rng=random.Random(__UpperCamelCase  )  ).to(__UpperCamelCase  )
          if str(__UpperCamelCase  ).startswith("mps"  ):
               UpperCAmelCase__							: List[Any] 							=						torch.manual_seed(__UpperCamelCase  )
          else:
               UpperCAmelCase__							: str 							=						torch.Generator(device=__UpperCamelCase  ).manual_seed(__UpperCamelCase  )
          UpperCAmelCase__							: Optional[int] 							=						{
              "prompt": "a dog and a newt",
              "mask_image": mask,
              "image_latents": latents,
              "generator": generator,
              "num_inference_steps": 2,
              "inpaint_strength": 1.0,
              "guidance_scale": 6.0,
              "output_type": "numpy",
          }

          return inputs



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase=0  )->					str:
          UpperCAmelCase__							: str 							=						floats_tensor((1, 3, 32, 32) ,			rng=random.Random(__UpperCamelCase  )  ).to(__UpperCamelCase  )
          UpperCAmelCase__							: List[Any] 							=						image.cpu().permute(0 ,			2 ,			3 ,			1  )[0]
          UpperCAmelCase__							: Union[str, Any] 							=						Image.fromarray(np.uinta(__UpperCamelCase  )  ).convert("RGB"  )
          if str(__UpperCamelCase  ).startswith("mps"  ):
               UpperCAmelCase__							: str 							=						torch.manual_seed(__UpperCamelCase  )
          else:
               UpperCAmelCase__							: Optional[Any] 							=						torch.Generator(device=__UpperCamelCase  ).manual_seed(__UpperCamelCase  )
          UpperCAmelCase__							: List[str] 							=						{
              "image": image,
              "source_prompt": "a cat and a frog",
              "target_prompt": "a dog and a newt",
              "generator": generator,
              "num_inference_steps": 2,
              "num_maps_per_mask": 2,
              "mask_encode_strength": 1.0,
              "guidance_scale": 6.0,
              "output_type": "numpy",
          }

          return inputs



     def  lowerCAmelCase__       (      self ,			__UpperCamelCase ,			__UpperCamelCase=0  )->					str:
          UpperCAmelCase__							: List[str] 							=						floats_tensor((1, 3, 32, 32) ,			rng=random.Random(__UpperCamelCase  )  ).to(__UpperCamelCase  )
          UpperCAmelCase__							: Dict 							=						image.cpu().permute(0 ,			2 ,			3 ,			1  )[0]
          UpperCAmelCase__							: Tuple 							=						Image.fromarray(np.uinta(__UpperCamelCase  )  ).convert("RGB"  )
          if str(__UpperCamelCase  ).startswith("mps"  ):
               UpperCAmelCase__							: Optional[int] 							=						torch.manual_seed(__UpperCamelCase  )
          else:
               UpperCAmelCase__							: Optional[Any] 							=						torch.Generator(device=__UpperCamelCase  ).manual_seed(__UpperCamelCase  )
          UpperCAmelCase__							: Optional[int] 							=						{
              "image": image,
              "prompt": "a cat and a frog",
              "generator": generator,
              "num_inference_steps": 2,
              "inpaint_strength": 1.0,
              "guidance_scale": 6.0,
              "decode_latents": True,
              "output_type": "numpy",
          }
          return inputs



     def  lowerCAmelCase__       (      self  )->					Union[str, Any]:
          if not hasattr(self.pipeline_class ,			"_optional_components"  ):
               return

          UpperCAmelCase__							: List[Any] 							=						self.get_dummy_components()
          UpperCAmelCase__							: List[str] 							=						self.pipeline_class(**__UpperCamelCase  )
          pipe.to(__UpperCamelCase  )
          pipe.set_progress_bar_config(disable=__UpperCamelCase  )

          # set all optional components to None and update pipeline config accordingly
          for optional_component in pipe._optional_components:
               setattr(__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase  )
          pipe.register_modules(**{optional_component: None for optional_component in pipe._optional_components}  )

          UpperCAmelCase__							: Optional[Any] 							=						self.get_dummy_inputs(__UpperCamelCase  )
          UpperCAmelCase__							: Tuple 							=						pipe(**__UpperCamelCase  )[0]

          with tempfile.TemporaryDirectory() as tmpdir:
               pipe.save_pretrained(__UpperCamelCase  )
               UpperCAmelCase__							: List[Any] 							=						self.pipeline_class.from_pretrained(__UpperCamelCase  )
               pipe_loaded.to(__UpperCamelCase  )
               pipe_loaded.set_progress_bar_config(disable=__UpperCamelCase  )

          for optional_component in pipe._optional_components:
               self.assertTrue(
                   getattr(__UpperCamelCase ,			__UpperCamelCase  ) is None ,			F"`{optional_component}` did not stay set to None after loading." ,			)

          UpperCAmelCase__							: Dict 							=						self.get_dummy_inputs(__UpperCamelCase  )
          UpperCAmelCase__							: List[Any] 							=						pipe_loaded(**__UpperCamelCase  )[0]

          UpperCAmelCase__							: str 							=						np.abs(output - output_loaded  ).max()
          self.assertLess(__UpperCamelCase ,			1E-4  )



     def  lowerCAmelCase__       (      self  )->					Any:
          UpperCAmelCase__							: List[Any] 							=						"cpu"

          UpperCAmelCase__							: List[Any] 							=						self.get_dummy_components()
          UpperCAmelCase__							: Union[str, Any] 							=						self.pipeline_class(**__UpperCamelCase  )
          pipe.to(__UpperCamelCase  )
          pipe.set_progress_bar_config(disable=__UpperCamelCase  )

          UpperCAmelCase__							: Optional[Any] 							=						self.get_dummy_mask_inputs(__UpperCamelCase  )
          UpperCAmelCase__							: Union[str, Any] 							=						pipe.generate_mask(**__UpperCamelCase  )
          UpperCAmelCase__							: Dict 							=						mask[0, -3:, -3:]

          self.assertEqual(mask.shape ,			(1, 16, 16)  )
          UpperCAmelCase__							: Any 							=						np.array([0] * 9  )
          UpperCAmelCase__							: List[Any] 							=						np.abs(mask_slice.flatten() - expected_slice  ).max()
          self.assertLessEqual(__UpperCamelCase ,			1E-3  )
          self.assertEqual(mask[0, -3, -4] ,			0  )



     def  lowerCAmelCase__       (      self  )->					str:
          UpperCAmelCase__							: List[str] 							=						"cpu"

          UpperCAmelCase__							: str 							=						self.get_dummy_components()
          UpperCAmelCase__							: Dict 							=						self.pipeline_class(**__UpperCamelCase  )
          pipe.to(__UpperCamelCase  )
          pipe.set_progress_bar_config(disable=__UpperCamelCase  )

          UpperCAmelCase__							: int 							=						self.get_dummy_inversion_inputs(__UpperCamelCase  )
          UpperCAmelCase__							: Optional[int] 							=						pipe.invert(**__UpperCamelCase  ).images
          UpperCAmelCase__							: int 							=						image[0, -1, -3:, -3:]

          self.assertEqual(image.shape ,			(2, 32, 32, 3)  )
          UpperCAmelCase__							: str 							=						np.array(
              [0.5150, 0.5134, 0.5043, 0.5376, 0.4694, 0.5_1050, 0.5015, 0.4407, 0.4799] ,			)
          UpperCAmelCase__							: str 							=						np.abs(image_slice.flatten() - expected_slice  ).max()
          self.assertLessEqual(__UpperCamelCase ,			1E-3  )



     def  lowerCAmelCase__       (      self  )->					Dict:
          super().test_inference_batch_single_identical(expected_max_diff=5E-3  )



     def  lowerCAmelCase__       (      self  )->					Tuple:
          UpperCAmelCase__							: Union[str, Any] 							=						"cpu"

          UpperCAmelCase__							: Dict 							=						self.get_dummy_components()

          UpperCAmelCase__							: List[str] 							=						{"beta_start": 0.0_0085, "beta_end": 0.012, "beta_schedule": "scaled_linear"}
          UpperCAmelCase__							: Any 							=						DPMSolverMultistepScheduler(**__UpperCamelCase  )
          UpperCAmelCase__							: Optional[Any] 							=						DPMSolverMultistepInverseScheduler(**__UpperCamelCase  )

          UpperCAmelCase__							: Optional[Any] 							=						self.pipeline_class(**__UpperCamelCase  )
          pipe.to(__UpperCamelCase  )
          pipe.set_progress_bar_config(disable=__UpperCamelCase  )

          UpperCAmelCase__							: Optional[Any] 							=						self.get_dummy_inversion_inputs(__UpperCamelCase  )
          UpperCAmelCase__							: List[str] 							=						pipe.invert(**__UpperCamelCase  ).images
          UpperCAmelCase__							: Any 							=						image[0, -1, -3:, -3:]

          self.assertEqual(image.shape ,			(2, 32, 32, 3)  )
          UpperCAmelCase__							: Any 							=						np.array(
              [0.5150, 0.5134, 0.5043, 0.5376, 0.4694, 0.5_1050, 0.5015, 0.4407, 0.4799] ,			)
          UpperCAmelCase__							: Union[str, Any] 							=						np.abs(image_slice.flatten() - expected_slice  ).max()
          self.assertLessEqual(__UpperCamelCase ,			1E-3  )







@require_torch_gpu
@slow
class   _lowercase						(       unittest.TestCase				):


     '''simple docstring'''





     def  lowerCAmelCase__       (      self  )->					Union[str, Any]:
          super().tearDown()
          gc.collect()
          torch.cuda.empty_cache()



     @classmethod
     def  lowerCAmelCase__       (      cls  )->					Any:
          UpperCAmelCase__							: Any 							=						load_image(
              "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/diffedit/fruit.png"  )

          UpperCAmelCase__							: Tuple 							=						raw_image.convert("RGB"  ).resize((7_68, 7_68)  )

          UpperCAmelCase__							: int 							=						raw_image



     def  lowerCAmelCase__       (      self  )->					Dict:
          UpperCAmelCase__							: Any 							=						torch.manual_seed(0  )

          UpperCAmelCase__							: Dict 							=						StableDiffusionDiffEditPipeline.from_pretrained(
              "stabilityai/stable-diffusion-2-1" ,			safety_checker=__UpperCamelCase ,			torch_dtype=torch.floataa  )
          UpperCAmelCase__							: Optional[Any] 							=						DDIMScheduler.from_config(pipe.scheduler.config  )
          UpperCAmelCase__							: Optional[int] 							=						DDIMInverseScheduler.from_config(pipe.scheduler.config  )
          pipe.enable_model_cpu_offload()
          pipe.set_progress_bar_config(disable=__UpperCamelCase  )

          UpperCAmelCase__							: Optional[Any] 							=						"a bowl of fruit"
          UpperCAmelCase__							: Optional[Any] 							=						"a bowl of pears"

          UpperCAmelCase__							: Optional[Any] 							=						pipe.generate_mask(
              image=self.raw_image ,			source_prompt=__UpperCamelCase ,			target_prompt=__UpperCamelCase ,			generator=__UpperCamelCase ,			)

          UpperCAmelCase__							: Union[str, Any] 							=						pipe.invert(
              prompt=__UpperCamelCase ,			image=self.raw_image ,			inpaint_strength=0.7 ,			generator=__UpperCamelCase  ).latents

          UpperCAmelCase__							: Any 							=						pipe(
              prompt=__UpperCamelCase ,			mask_image=__UpperCamelCase ,			image_latents=__UpperCamelCase ,			generator=__UpperCamelCase ,			negative_prompt=__UpperCamelCase ,			inpaint_strength=0.7 ,			output_type="numpy" ,			).images[0]

          UpperCAmelCase__							: Tuple 							=						(
              np.array(
                  load_image(
                      "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
                      "/diffedit/pears.png"  ).resize((7_68, 7_68)  )  )
              / 2_55
          )
          assert np.abs((expected_image - image).max()  ) < 5E-1



     def  lowerCAmelCase__       (      self  )->					Dict:
          UpperCAmelCase__							: Dict 							=						torch.manual_seed(0  )

          UpperCAmelCase__							: Optional[Any] 							=						StableDiffusionDiffEditPipeline.from_pretrained(
              "stabilityai/stable-diffusion-2-1" ,			safety_checker=__UpperCamelCase ,			torch_dtype=torch.floataa  )
          UpperCAmelCase__							: str 							=						DPMSolverMultistepScheduler.from_config(pipe.scheduler.config  )
          UpperCAmelCase__							: Optional[Any] 							=						DPMSolverMultistepInverseScheduler.from_config(pipe.scheduler.config  )
          pipe.enable_model_cpu_offload()
          pipe.set_progress_bar_config(disable=__UpperCamelCase  )

          UpperCAmelCase__							: Tuple 							=						"a bowl of fruit"
          UpperCAmelCase__							: List[Any] 							=						"a bowl of pears"

          UpperCAmelCase__							: Optional[Any] 							=						pipe.generate_mask(
              image=self.raw_image ,			source_prompt=__UpperCamelCase ,			target_prompt=__UpperCamelCase ,			generator=__UpperCamelCase ,			)

          UpperCAmelCase__							: Any 							=						pipe.invert(
              prompt=__UpperCamelCase ,			image=self.raw_image ,			inpaint_strength=0.7 ,			generator=__UpperCamelCase ,			num_inference_steps=25 ,			).latents

          UpperCAmelCase__							: Any 							=						pipe(
              prompt=__UpperCamelCase ,			mask_image=__UpperCamelCase ,			image_latents=__UpperCamelCase ,			generator=__UpperCamelCase ,			negative_prompt=__UpperCamelCase ,			inpaint_strength=0.7 ,			num_inference_steps=25 ,			output_type="numpy" ,			).images[0]

          UpperCAmelCase__							: Optional[Any] 							=						(
              np.array(
                  load_image(
                      "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
                      "/diffedit/pears.png"  ).resize((7_68, 7_68)  )  )
              / 2_55
          )
          assert np.abs((expected_image - image).max()  ) < 5E-1





"""simple docstring"""




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
from ..auto import CONFIG_MAPPING


A__      :	Union[str, Any]          =    logging.get_logger(__name__)

A__      :	Optional[int]          =    {
    """microsoft/table-transformer-detection""": (
        """https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json"""
    ),
}







class   _lowercase						(       lowerCAmelCase_				):


     '''simple docstring'''





     _A								=							'table-transformer'
     _A								=							['past_key_values']
     _A								=							{
         'hidden_size': 'd_model',
         'num_attention_heads': 'encoder_attention_heads',
     }



     def __init__(      self ,			__UpperCamelCase=True ,			__UpperCamelCase=None ,			__UpperCamelCase=3 ,			__UpperCamelCase=1_00 ,			__UpperCamelCase=6 ,			__UpperCamelCase=20_48 ,			__UpperCamelCase=8 ,			__UpperCamelCase=6 ,			__UpperCamelCase=20_48 ,			__UpperCamelCase=8 ,			__UpperCamelCase=0.0 ,			__UpperCamelCase=0.0 ,			__UpperCamelCase=True ,			__UpperCamelCase="relu" ,			__UpperCamelCase=2_56 ,			__UpperCamelCase=0.1 ,			__UpperCamelCase=0.0 ,			__UpperCamelCase=0.0 ,			__UpperCamelCase=0.02 ,			__UpperCamelCase=1.0 ,			__UpperCamelCase=False ,			__UpperCamelCase="sine" ,			__UpperCamelCase="resnet50" ,			__UpperCamelCase=True ,			__UpperCamelCase=False ,			__UpperCamelCase=1 ,			__UpperCamelCase=5 ,			__UpperCamelCase=2 ,			__UpperCamelCase=1 ,			__UpperCamelCase=1 ,			__UpperCamelCase=5 ,			__UpperCamelCase=2 ,			__UpperCamelCase=0.1 ,			**__UpperCamelCase ,			)->					List[Any]:
          if backbone_config is not None and use_timm_backbone:
               raise ValueError("You can't specify both `backbone_config` and `use_timm_backbone`."  )

          if not use_timm_backbone:
               if backbone_config is None:
                    logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."  )
                    UpperCAmelCase__							: Any 							=						CONFIG_MAPPING["resnet"](out_features=["stage4"]  )
               elif isinstance(__UpperCamelCase ,			__UpperCamelCase  ):
                    UpperCAmelCase__							: int 							=						backbone_config.get("model_type"  )
                    UpperCAmelCase__							: Optional[Any] 							=						CONFIG_MAPPING[backbone_model_type]
                    UpperCAmelCase__							: int 							=						config_class.from_dict(__UpperCamelCase  )
               # set timm attributes to None
               UpperCAmelCase__							,	UpperCAmelCase__							,	UpperCAmelCase__							: List[str] 							=						None, None, None

          UpperCAmelCase__							: Optional[int] 							=						use_timm_backbone
          UpperCAmelCase__							: Dict 							=						backbone_config
          UpperCAmelCase__							: List[Any] 							=						num_channels
          UpperCAmelCase__							: Any 							=						num_queries
          UpperCAmelCase__							: int 							=						d_model
          UpperCAmelCase__							: Optional[int] 							=						encoder_ffn_dim
          UpperCAmelCase__							: str 							=						encoder_layers
          UpperCAmelCase__							: Dict 							=						encoder_attention_heads
          UpperCAmelCase__							: Optional[Any] 							=						decoder_ffn_dim
          UpperCAmelCase__							: Tuple 							=						decoder_layers
          UpperCAmelCase__							: Optional[Any] 							=						decoder_attention_heads
          UpperCAmelCase__							: List[str] 							=						dropout
          UpperCAmelCase__							: Tuple 							=						attention_dropout
          UpperCAmelCase__							: List[Any] 							=						activation_dropout
          UpperCAmelCase__							: Dict 							=						activation_function
          UpperCAmelCase__							: Optional[Any] 							=						init_std
          UpperCAmelCase__							: List[str] 							=						init_xavier_std
          UpperCAmelCase__							: int 							=						encoder_layerdrop
          UpperCAmelCase__							: Tuple 							=						decoder_layerdrop
          UpperCAmelCase__							: int 							=						encoder_layers
          UpperCAmelCase__							: Dict 							=						auxiliary_loss
          UpperCAmelCase__							: Union[str, Any] 							=						position_embedding_type
          UpperCAmelCase__							: List[str] 							=						backbone
          UpperCAmelCase__							: List[Any] 							=						use_pretrained_backbone
          UpperCAmelCase__							: List[str] 							=						dilation
          # Hungarian matcher
          UpperCAmelCase__							: Dict 							=						class_cost
          UpperCAmelCase__							: Any 							=						bbox_cost
          UpperCAmelCase__							: Tuple 							=						giou_cost
          # Loss coefficients
          UpperCAmelCase__							: Any 							=						mask_loss_coefficient
          UpperCAmelCase__							: Dict 							=						dice_loss_coefficient
          UpperCAmelCase__							: Any 							=						bbox_loss_coefficient
          UpperCAmelCase__							: Tuple 							=						giou_loss_coefficient
          UpperCAmelCase__							: List[Any] 							=						eos_coefficient
          super().__init__(is_encoder_decoder=__UpperCamelCase ,			**__UpperCamelCase  )



     @property
     def  lowerCAmelCase__       (      self  )->					int:
          return self.encoder_attention_heads



     @property
     def  lowerCAmelCase__       (      self  )->					int:
          return self.d_model







class   _lowercase						(       lowerCAmelCase_				):


     '''simple docstring'''





     _A								=							version.parse('1.11'				)



     @property
     def  lowerCAmelCase__       (      self  )->					Mapping[str, Mapping[int, str]]:
          return OrderedDict(
              [
                  ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
                  ("pixel_mask", {0: "batch"}),
              ]  )



     @property
     def  lowerCAmelCase__       (      self  )->					float:
          return 1E-5



     @property
     def  lowerCAmelCase__       (      self  )->					int:
          return 12



