


'''simple docstring'''




from math import acos, sin
from typing import List, Tuple, Union

import numpy as np
import torch
from PIL import Image

from ...models import AutoencoderKL, UNetaDConditionModel
from ...schedulers import DDIMScheduler, DDPMScheduler
from ...utils import randn_tensor
from ..pipeline_utils import AudioPipelineOutput, BaseOutput, DiffusionPipeline, ImagePipelineOutput
from .mel import Mel




class 			_lowercase (	__lowercase							):
   _SCREAMING_SNAKE_CASE  :  Dict          =	["vqvae"]
   def __init__(						self       :      List[str]       ,   SCREAMING_SNAKE_CASE_       :      AutoencoderKL       ,   SCREAMING_SNAKE_CASE_       :      UNetaDConditionModel       ,   SCREAMING_SNAKE_CASE_       :      Mel       ,   SCREAMING_SNAKE_CASE_       :      Union[DDIMScheduler, DDPMScheduler]       ,   ) ->							List[str]:
        super().__init__()
        self.register_modules(unet=SCREAMING_SNAKE_CASE_       ,   scheduler=SCREAMING_SNAKE_CASE_       ,   mel=SCREAMING_SNAKE_CASE_       ,   vqvae=SCREAMING_SNAKE_CASE_      )
   def a  (						self       :      Optional[Any]      ) ->							int:
        return 50 if isinstance(self.scheduler       ,   SCREAMING_SNAKE_CASE_      ) else 1000
   @torch.no_grad()
   def __call__(						self       :      Optional[int]       ,   SCREAMING_SNAKE_CASE_       :      int = 1       ,   SCREAMING_SNAKE_CASE_       :      str = None       ,   SCREAMING_SNAKE_CASE_       :      np.ndarray = None       ,   SCREAMING_SNAKE_CASE_       :      int = 0       ,   SCREAMING_SNAKE_CASE_       :      int = 0       ,   SCREAMING_SNAKE_CASE_       :      int = None       ,   SCREAMING_SNAKE_CASE_       :      torch.Generator = None       ,   SCREAMING_SNAKE_CASE_       :      float = 0       ,   SCREAMING_SNAKE_CASE_       :      float = 0       ,   SCREAMING_SNAKE_CASE_       :      torch.Generator = None       ,   SCREAMING_SNAKE_CASE_       :      float = 0       ,   SCREAMING_SNAKE_CASE_       :      torch.Tensor = None       ,   SCREAMING_SNAKE_CASE_       :      torch.Tensor = None       ,   SCREAMING_SNAKE_CASE_       :      Optional[Any]=True       ,   ) ->							Union[
       Union[AudioPipelineOutput, ImagePipelineOutput],
       Tuple[List[Image.Image], Tuple[int, List[np.ndarray]]],
   ]:
        __snake_case           =						steps or self.get_default_steps()
        self.scheduler.set_timesteps(SCREAMING_SNAKE_CASE_      )
        __snake_case           =						step_generator or generator
        # For backwards compatibility
        if type(self.unet.config.sample_size      ) == int:
             __snake_case           =						(self.unet.config.sample_size, self.unet.config.sample_size)
        if noise is None:
             __snake_case           =						randn_tensor(
                 (
                     batch_size,
                     self.unet.config.in_channels,
                     self.unet.config.sample_size[0],
                     self.unet.config.sample_size[1],
                 )       ,   generator=SCREAMING_SNAKE_CASE_       ,   device=self.device       ,   )
        __snake_case           =						noise
        __snake_case           =						None

        if audio_file is not None or raw_audio is not None:
             self.mel.load_audio(SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_      )
             __snake_case           =						self.mel.audio_slice_to_image(SCREAMING_SNAKE_CASE_      )
             __snake_case           =						np.frombuffer(input_image.tobytes()       ,   dtype='uint8'      ).reshape(
                 (input_image.height, input_image.width)      )
             __snake_case           =						(input_image / 255) * 2 - 1
             __snake_case           =						torch.tensor(input_image[np.newaxis, :, :]       ,   dtype=torch.float      ).to(self.device      )

             if self.vqvae is not None:
                  __snake_case           =						self.vqvae.encode(torch.unsqueeze(SCREAMING_SNAKE_CASE_       ,   0      )      ).latent_dist.sample(
                      generator=SCREAMING_SNAKE_CASE_      )[0]
                  __snake_case           =						self.vqvae.config.scaling_factor * input_images

             if start_step > 0:
                  __snake_case           =						self.scheduler.add_noise(SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_       ,   self.scheduler.timesteps[start_step - 1]      )

             __snake_case           =						(
                 self.unet.config.sample_size[1] * self.mel.get_sample_rate() / self.mel.x_res / self.mel.hop_length
             )
             __snake_case           =						int(mask_start_secs * pixels_per_second      )
             __snake_case           =						int(mask_end_secs * pixels_per_second      )
             __snake_case           =						self.scheduler.add_noise(SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_       ,   torch.tensor(self.scheduler.timesteps[start_step:]      )      )

        for step, t in enumerate(self.progress_bar(self.scheduler.timesteps[start_step:]      )      ):
             if isinstance(self.unet       ,   SCREAMING_SNAKE_CASE_      ):
                  __snake_case           =						self.unet(SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_      )['sample']
             else:
                  __snake_case           =						self.unet(SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_      )['sample']

             if isinstance(self.scheduler       ,   SCREAMING_SNAKE_CASE_      ):
                  __snake_case           =						self.scheduler.step(
                      model_output=SCREAMING_SNAKE_CASE_       ,   timestep=SCREAMING_SNAKE_CASE_       ,   sample=SCREAMING_SNAKE_CASE_       ,   eta=SCREAMING_SNAKE_CASE_       ,   generator=SCREAMING_SNAKE_CASE_       ,   )['prev_sample']
             else:
                  __snake_case           =						self.scheduler.step(
                      model_output=SCREAMING_SNAKE_CASE_       ,   timestep=SCREAMING_SNAKE_CASE_       ,   sample=SCREAMING_SNAKE_CASE_       ,   generator=SCREAMING_SNAKE_CASE_       ,   )['prev_sample']

             if mask is not None:
                  if mask_start > 0:
                       __snake_case           =						mask[:, step, :, :mask_start]
                  if mask_end > 0:
                       __snake_case           =						mask[:, step, :, -mask_end:]

        if self.vqvae is not None:
             # 0.18215 was scaling factor used in training to ensure unit variance
             __snake_case           =						1 / self.vqvae.config.scaling_factor * images
             __snake_case           =						self.vqvae.decode(SCREAMING_SNAKE_CASE_      )['sample']

        __snake_case           =						(images / 2 + 0.5).clamp(0       ,   1      )
        __snake_case           =						images.cpu().permute(0       ,   2       ,   3       ,   1      ).numpy()
        __snake_case           =						(images * 255).round().astype('uint8'      )
        __snake_case           =						list(
            (Image.fromarray(_[:, :, 0]      ) for _ in images)
            if images.shape[3] == 1
            else (Image.fromarray(SCREAMING_SNAKE_CASE_       ,   mode='RGB'      ).convert('L'      ) for _ in images)      )

        __snake_case           =						[self.mel.image_to_audio(SCREAMING_SNAKE_CASE_      ) for _ in images]
        if not return_dict:
             return images, (self.mel.get_sample_rate(), audios)

        return BaseOutput(**AudioPipelineOutput(np.array(SCREAMING_SNAKE_CASE_      )[:, np.newaxis, :]      )       ,   **ImagePipelineOutput(SCREAMING_SNAKE_CASE_      )      )
   @torch.no_grad()
   def a  (						self       :      List[str]       ,   SCREAMING_SNAKE_CASE_       :      List[Image.Image]       ,   SCREAMING_SNAKE_CASE_       :      int = 50      ) ->							np.ndarray:
        assert isinstance(self.scheduler       ,   SCREAMING_SNAKE_CASE_      )
        self.scheduler.set_timesteps(SCREAMING_SNAKE_CASE_      )
        __snake_case           =						np.array(
            [np.frombuffer(image.tobytes()       ,   dtype='uint8'      ).reshape((1, image.height, image.width)      ) for image in images]      )
        __snake_case           =						(sample / 255) * 2 - 1
        __snake_case           =						torch.Tensor(SCREAMING_SNAKE_CASE_      ).to(self.device      )

        for t in self.progress_bar(torch.flip(self.scheduler.timesteps       ,   (0,)      )      ):
             __snake_case           =						t - self.scheduler.config.num_train_timesteps // self.scheduler.num_inference_steps
             __snake_case           =						self.scheduler.alphas_cumprod[t]
             __snake_case           =						(
                 self.scheduler.alphas_cumprod[prev_timestep]
                 if prev_timestep >= 0
                 else self.scheduler.final_alpha_cumprod
             )
             __snake_case           =						1 - alpha_prod_t
             __snake_case           =						self.unet(SCREAMING_SNAKE_CASE_       ,   SCREAMING_SNAKE_CASE_      )['sample']
             __snake_case           =						(1 - alpha_prod_t_prev) ** 0.5 * model_output
             __snake_case           =						(sample - pred_sample_direction) * alpha_prod_t_prev ** (-0.5)
             __snake_case           =						sample * alpha_prod_t ** 0.5 + beta_prod_t ** 0.5 * model_output

        return sample





   @staticmethod
   def a  (						SCREAMING_SNAKE_CASE_       :      torch.Tensor       ,   SCREAMING_SNAKE_CASE_       :      torch.Tensor       ,   SCREAMING_SNAKE_CASE_       :      float      ) ->							torch.Tensor:
        __snake_case           =						acos(torch.dot(torch.flatten(SCREAMING_SNAKE_CASE_      )       ,   torch.flatten(SCREAMING_SNAKE_CASE_      )      ) / torch.norm(SCREAMING_SNAKE_CASE_      ) / torch.norm(SCREAMING_SNAKE_CASE_      )      )
        return sin((1 - alpha) * theta      ) * xa / sin(SCREAMING_SNAKE_CASE_      ) + sin(alpha * theta      ) * xa / sin(SCREAMING_SNAKE_CASE_      )






import json
import pathlib
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision, slow
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
     import torch

if is_vision_available():
     from PIL import Image

     from transformers import DetaImageProcessor




class        _SCREAMING_SNAKE_CASE	(   unittest.TestCase			):
      def __init__(      self		,						lowerCamelCase		,						lowerCamelCase=7		,						lowerCamelCase=3		,						lowerCamelCase=30		,						lowerCamelCase=4_00		,						lowerCamelCase=True		,						lowerCamelCase=None		,						lowerCamelCase=True		,						lowerCamelCase=[0.5, 0.5, 0.5]		,						lowerCamelCase=[0.5, 0.5, 0.5]		,						lowerCamelCase=True		,						lowerCamelCase=1 / 2_55		,						lowerCamelCase=True		,						):
          # by setting size["longest_edge"] > max_resolution we're effectively not testing this :p
          snake_case__    =					size if size is not None else {"shortest_edge": 18, "longest_edge": 13_33}
          snake_case__    =					parent
          snake_case__    =					batch_size
          snake_case__    =					num_channels
          snake_case__    =					min_resolution
          snake_case__    =					max_resolution
          snake_case__    =					do_resize
          snake_case__    =					size
          snake_case__    =					do_normalize
          snake_case__    =					image_mean
          snake_case__    =					image_std
          snake_case__    =					do_rescale
          snake_case__    =					rescale_factor
          snake_case__    =					do_pad
      def A_      (      self			):
          return {
              "do_resize": self.do_resize,
              "size": self.size,
              "do_normalize": self.do_normalize,
              "image_mean": self.image_mean,
              "image_std": self.image_std,
              "do_rescale": self.do_rescale,
              "rescale_factor": self.rescale_factor,
              "do_pad": self.do_pad,
          }



      def A_      (      self		,						lowerCamelCase		,						lowerCamelCase=False			):
          if not batched:
              snake_case__    =					image_inputs[0]
              if isinstance(lowerCamelCase		,						Image.Image			):
                  snake_case__    ,       snake_case__    =					image.size
              else:
                  snake_case__    ,       snake_case__    =					image.shape[1], image.shape[2]
              if w < h:
                  snake_case__    =					int(self.size["shortest_edge"] * h / w			)
                  snake_case__    =					self.size["shortest_edge"]
              elif w > h:
                  snake_case__    =					self.size["shortest_edge"]
                  snake_case__    =					int(self.size["shortest_edge"] * w / h			)
              else:
                  snake_case__    =					self.size["shortest_edge"]
                  snake_case__    =					self.size["shortest_edge"]

          else:
              snake_case__    =					[]
              for image in image_inputs:
                  snake_case__    ,       snake_case__    =					self.get_expected_values([image]			)
                  expected_values.append((expected_height, expected_width)			)
              snake_case__    =					max(lowerCamelCase		,						key=lambda lowerCamelCase			: item[0]			)[0]
              snake_case__    =					max(lowerCamelCase		,						key=lambda lowerCamelCase			: item[1]			)[1]

          return expected_height, expected_width





@require_torch
@require_vision
class        _SCREAMING_SNAKE_CASE	(   __UpperCamelCase							,       unittest.TestCase			):
      _A    :		List[str]     						=  DetaImageProcessor if is_vision_available() else None
      def A_      (      self			):
          snake_case__    =					DetaImageProcessingTester(self			)
      @property
      def A_      (      self			):
          return self.image_processor_tester.prepare_image_processor_dict()
      def A_      (      self			):
          snake_case__    =					self.image_processing_class(**self.image_processor_dict			)
          self.assertTrue(hasattr(lowerCamelCase		,						"image_mean"			)			)
          self.assertTrue(hasattr(lowerCamelCase		,						"image_std"			)			)
          self.assertTrue(hasattr(lowerCamelCase		,						"do_normalize"			)			)
          self.assertTrue(hasattr(lowerCamelCase		,						"do_resize"			)			)
          self.assertTrue(hasattr(lowerCamelCase		,						"do_rescale"			)			)
          self.assertTrue(hasattr(lowerCamelCase		,						"do_pad"			)			)
          self.assertTrue(hasattr(lowerCamelCase		,						"size"			)			)
      def A_      (      self			):
          snake_case__    =					self.image_processing_class.from_dict(self.image_processor_dict			)
          self.assertEqual(image_processor.size		,						{"shortest_edge": 18, "longest_edge": 13_33}			)
          self.assertEqual(image_processor.do_pad		,						lowerCamelCase			)
      def A_      (      self			):
          pass
      def A_      (      self			):
          # Initialize image_processing
          snake_case__    =					self.image_processing_class(**self.image_processor_dict			)
          # create random PIL images
          snake_case__    =					prepare_image_inputs(self.image_processor_tester		,						equal_resolution=lowerCamelCase			)
          for image in image_inputs:
              self.assertIsInstance(lowerCamelCase		,						Image.Image			)

          # Test not batched input
          snake_case__    =					image_processing(image_inputs[0]		,						return_tensors="pt"			).pixel_values

          snake_case__    ,       snake_case__    =					self.image_processor_tester.get_expected_values(lowerCamelCase			)

          self.assertEqual(
              encoded_images.shape		,						(1, self.image_processor_tester.num_channels, expected_height, expected_width)		,						)

          # Test batched
          snake_case__    ,       snake_case__    =					self.image_processor_tester.get_expected_values(lowerCamelCase		,						batched=lowerCamelCase			)

          snake_case__    =					image_processing(lowerCamelCase		,						return_tensors="pt"			).pixel_values
          self.assertEqual(
              encoded_images.shape		,						(
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_channels,
                  expected_height,
                  expected_width,
              )		,						)
      def A_      (      self			):
          # Initialize image_processing
          snake_case__    =					self.image_processing_class(**self.image_processor_dict			)
          # create random numpy tensors
          snake_case__    =					prepare_image_inputs(self.image_processor_tester		,						equal_resolution=lowerCamelCase		,						numpify=lowerCamelCase			)
          for image in image_inputs:
              self.assertIsInstance(lowerCamelCase		,						np.ndarray			)

          # Test not batched input
          snake_case__    =					image_processing(image_inputs[0]		,						return_tensors="pt"			).pixel_values

          snake_case__    ,       snake_case__    =					self.image_processor_tester.get_expected_values(lowerCamelCase			)

          self.assertEqual(
              encoded_images.shape		,						(1, self.image_processor_tester.num_channels, expected_height, expected_width)		,						)

          # Test batched
          snake_case__    =					image_processing(lowerCamelCase		,						return_tensors="pt"			).pixel_values

          snake_case__    ,       snake_case__    =					self.image_processor_tester.get_expected_values(lowerCamelCase		,						batched=lowerCamelCase			)

          self.assertEqual(
              encoded_images.shape		,						(
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_channels,
                  expected_height,
                  expected_width,
              )		,						)
      def A_      (      self			):
          # Initialize image_processing
          snake_case__    =					self.image_processing_class(**self.image_processor_dict			)
          # create random PyTorch tensors
          snake_case__    =					prepare_image_inputs(self.image_processor_tester		,						equal_resolution=lowerCamelCase		,						torchify=lowerCamelCase			)
          for image in image_inputs:
              self.assertIsInstance(lowerCamelCase		,						torch.Tensor			)

          # Test not batched input
          snake_case__    =					image_processing(image_inputs[0]		,						return_tensors="pt"			).pixel_values

          snake_case__    ,       snake_case__    =					self.image_processor_tester.get_expected_values(lowerCamelCase			)

          self.assertEqual(
              encoded_images.shape		,						(1, self.image_processor_tester.num_channels, expected_height, expected_width)		,						)

          # Test batched
          snake_case__    =					image_processing(lowerCamelCase		,						return_tensors="pt"			).pixel_values

          snake_case__    ,       snake_case__    =					self.image_processor_tester.get_expected_values(lowerCamelCase		,						batched=lowerCamelCase			)

          self.assertEqual(
              encoded_images.shape		,						(
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_channels,
                  expected_height,
                  expected_width,
              )		,						)
      @slow
      def A_      (      self			):
          # prepare image and target
          snake_case__    =					Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"			)
          with open("./tests/fixtures/tests_samples/COCO/coco_annotations.txt"		,						"r"			) as f:
              snake_case__    =					json.loads(f.read()			)

          snake_case__    =					{"image_id": 3_97_69, "annotations": target}

          # encode them
          snake_case__    =					DetaImageProcessor()
          snake_case__    =					image_processing(images=lowerCamelCase		,						annotations=lowerCamelCase		,						return_tensors="pt"			)

          # verify pixel values
          snake_case__    =					torch.Size([1, 3, 8_00, 10_66]			)
          self.assertEqual(encoding["pixel_values"].shape		,						lowerCamelCase			)

          snake_case__    =					torch.tensor([0.2_7_9_6, 0.3_1_3_8, 0.3_4_8_1]			)
          self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]		,						lowerCamelCase		,						atol=1e-4			)			)

          # verify area
          snake_case__    =					torch.tensor([5_8_8_7.9_6_0_0, 1_1_2_5_0.2_0_6_1, 4_8_9_3_5_3.8_4_3_8, 8_3_7_1_2_2.7_5_0_0, 1_4_7_9_6_7.5_1_5_6, 1_6_5_7_3_2.3_4_3_8]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["area"]		,						lowerCamelCase			)			)
          # verify boxes
          snake_case__    =					torch.Size([6, 4]			)
          self.assertEqual(encoding["labels"][0]["boxes"].shape		,						lowerCamelCase			)
          snake_case__    =					torch.tensor([0.5_5_0_3, 0.2_7_6_5, 0.0_6_0_4, 0.2_2_1_5]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]		,						lowerCamelCase		,						atol=1e-3			)			)
          # verify image_id
          snake_case__    =					torch.tensor([3_97_69]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]		,						lowerCamelCase			)			)
          # verify is_crowd
          snake_case__    =					torch.tensor([0, 0, 0, 0, 0, 0]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]		,						lowerCamelCase			)			)
          # verify class_labels
          snake_case__    =					torch.tensor([75, 75, 63, 65, 17, 17]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]		,						lowerCamelCase			)			)
          # verify orig_size
          snake_case__    =					torch.tensor([4_80, 6_40]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]		,						lowerCamelCase			)			)
          # verify size
          snake_case__    =					torch.tensor([8_00, 10_66]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["size"]		,						lowerCamelCase			)			)



      @slow
      def A_      (      self			):
          # prepare image, target and masks_path
          snake_case__    =					Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"			)
          with open("./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt"		,						"r"			) as f:
              snake_case__    =					json.loads(f.read()			)

          snake_case__    =					{"file_name": "000000039769.png", "image_id": 3_97_69, "segments_info": target}

          snake_case__    =					pathlib.Path("./tests/fixtures/tests_samples/COCO/coco_panoptic"			)

          # encode them
          snake_case__    =					DetaImageProcessor(format="coco_panoptic"			)
          snake_case__    =					image_processing(images=lowerCamelCase		,						annotations=lowerCamelCase		,						masks_path=lowerCamelCase		,						return_tensors="pt"			)

          # verify pixel values
          snake_case__    =					torch.Size([1, 3, 8_00, 10_66]			)
          self.assertEqual(encoding["pixel_values"].shape		,						lowerCamelCase			)

          snake_case__    =					torch.tensor([0.2_7_9_6, 0.3_1_3_8, 0.3_4_8_1]			)
          self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]		,						lowerCamelCase		,						atol=1e-4			)			)

          # verify area
          snake_case__    =					torch.tensor([1_4_7_9_7_9.6_8_7_5, 1_6_5_5_2_7.0_4_6_9, 4_8_4_6_3_8.5_9_3_8, 1_1_2_9_2.9_3_7_5, 5_8_7_9.6_5_6_2, 7_6_3_4.1_1_4_7]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["area"]		,						lowerCamelCase			)			)
          # verify boxes
          snake_case__    =					torch.Size([6, 4]			)
          self.assertEqual(encoding["labels"][0]["boxes"].shape		,						lowerCamelCase			)
          snake_case__    =					torch.tensor([0.2_6_2_5, 0.5_4_3_7, 0.4_6_8_8, 0.8_6_2_5]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]		,						lowerCamelCase		,						atol=1e-3			)			)
          # verify image_id
          snake_case__    =					torch.tensor([3_97_69]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]		,						lowerCamelCase			)			)
          # verify is_crowd
          snake_case__    =					torch.tensor([0, 0, 0, 0, 0, 0]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]		,						lowerCamelCase			)			)
          # verify class_labels
          snake_case__    =					torch.tensor([17, 17, 63, 75, 75, 93]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]		,						lowerCamelCase			)			)
          # verify masks
          snake_case__    =					82_28_73
          self.assertEqual(encoding["labels"][0]["masks"].sum().item()		,						lowerCamelCase			)
          # verify orig_size
          snake_case__    =					torch.tensor([4_80, 6_40]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]		,						lowerCamelCase			)			)
          # verify size
          snake_case__    =					torch.tensor([8_00, 10_66]			)
          self.assertTrue(torch.allclose(encoding["labels"][0]["size"]		,						lowerCamelCase			)			)



