
'''simple docstring'''







import inspect
import math
import tempfile
import unittest

import numpy as np

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

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 ViTMAEForPreTraining, ViTMAEModel
						from transformers.models.vit.modeling_vit import VIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
						from PIL import Image

						from transformers import ViTImageProcessor


class 			lowerCAmelCase :




		def __init__(				self					,						UpperCamelCase					,						UpperCamelCase=13					,						UpperCamelCase=30					,						UpperCamelCase=2					,						UpperCamelCase=3					,						UpperCamelCase=True					,						UpperCamelCase=True					,						UpperCamelCase=32					,						UpperCamelCase=5					,						UpperCamelCase=4					,						UpperCamelCase=37					,						UpperCamelCase="gelu"					,						UpperCamelCase=0.1					,						UpperCamelCase=0.1					,						UpperCamelCase=10					,						UpperCamelCase=0.02					,						UpperCamelCase=3					,						UpperCamelCase=0.6					,						UpperCamelCase=None					,						):
								_SCREAMING_SNAKE_CASE				= parent
								_SCREAMING_SNAKE_CASE				= batch_size
								_SCREAMING_SNAKE_CASE				= image_size
								_SCREAMING_SNAKE_CASE				= patch_size
								_SCREAMING_SNAKE_CASE				= num_channels
								_SCREAMING_SNAKE_CASE				= is_training
								_SCREAMING_SNAKE_CASE				= use_labels
								_SCREAMING_SNAKE_CASE				= hidden_size
								_SCREAMING_SNAKE_CASE				= num_hidden_layers
								_SCREAMING_SNAKE_CASE				= num_attention_heads
								_SCREAMING_SNAKE_CASE				= intermediate_size
								_SCREAMING_SNAKE_CASE				= hidden_act
								_SCREAMING_SNAKE_CASE				= hidden_dropout_prob
								_SCREAMING_SNAKE_CASE				= attention_probs_dropout_prob
								_SCREAMING_SNAKE_CASE				= type_sequence_label_size
								_SCREAMING_SNAKE_CASE				= initializer_range
								_SCREAMING_SNAKE_CASE				= mask_ratio
								_SCREAMING_SNAKE_CASE				= scope

								# in ViTMAE, the expected sequence length = (num_patches + 1) * (1 - config.mask_ratio), rounded above
								# (we add 1 for the [CLS] token)
								_SCREAMING_SNAKE_CASE				= (image_size // patch_size) ** 2
								_SCREAMING_SNAKE_CASE				= int(math.ceil((1 - mask_ratio) * (num_patches + 1)      )      )




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE				= floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]      )

								_SCREAMING_SNAKE_CASE				= None
								if self.use_labels:
														_SCREAMING_SNAKE_CASE				= ids_tensor([self.batch_size]					,						self.type_sequence_label_size      )

								_SCREAMING_SNAKE_CASE				= self.get_config()

								return config, pixel_values, labels




		def     lowercase       (				self      ):
								return ViTMAEConfig(
								    image_size=self.image_size					,						patch_size=self.patch_size					,						num_channels=self.num_channels					,						hidden_size=self.hidden_size					,						num_hidden_layers=self.num_hidden_layers					,						num_attention_heads=self.num_attention_heads					,						intermediate_size=self.intermediate_size					,						hidden_act=self.hidden_act					,						hidden_dropout_prob=self.hidden_dropout_prob					,						attention_probs_dropout_prob=self.attention_probs_dropout_prob					,						is_decoder=UpperCamelCase					,						initializer_range=self.initializer_range					,						mask_ratio=self.mask_ratio					,						)




		def     lowercase       (				self					,						UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase      ):
								_SCREAMING_SNAKE_CASE				= ViTMAEModel(config=UpperCamelCase      )
								model.to(UpperCamelCase      )
								model.eval()
								_SCREAMING_SNAKE_CASE				= model(UpperCamelCase      )
								self.parent.assertEqual(result.last_hidden_state.shape					,						(self.batch_size, self.seq_length, self.hidden_size)      )




		def     lowercase       (				self					,						UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase      ):
								_SCREAMING_SNAKE_CASE				= ViTMAEForPreTraining(UpperCamelCase      )
								model.to(UpperCamelCase      )
								model.eval()
								_SCREAMING_SNAKE_CASE				= model(UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= (self.image_size // self.patch_size) ** 2
								_SCREAMING_SNAKE_CASE				= self.patch_size**2 * self.num_channels
								self.parent.assertEqual(result.logits.shape					,						(self.batch_size, num_patches, expected_num_channels)      )

								# test greyscale images
								_SCREAMING_SNAKE_CASE				= 1
								_SCREAMING_SNAKE_CASE				= ViTMAEForPreTraining(UpperCamelCase      )
								model.to(UpperCamelCase      )
								model.eval()
								_SCREAMING_SNAKE_CASE				= floats_tensor([self.batch_size, 1, self.image_size, self.image_size]      )
								_SCREAMING_SNAKE_CASE				= model(UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= self.patch_size**2
								self.parent.assertEqual(result.logits.shape					,						(self.batch_size, num_patches, expected_num_channels)      )




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE				= self.prepare_config_and_inputs()
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= config_and_inputs
								_SCREAMING_SNAKE_CASE				= {"pixel_values": pixel_values}
								return config, inputs_dict


@require_torch
class 			lowerCAmelCase (				__UpperCAmelCase		,     __UpperCAmelCase		,     unittest.TestCase			):
		a							:					str       =					(ViTMAEModel, ViTMAEForPreTraining) if is_torch_available() else ()
		a							:					Union[str, Any]       =					{"""feature-extraction""": ViTMAEModel} if is_torch_available() else {}

		a							:					int       =					False
		a							:					Tuple       =					False
		a							:					Any       =					False
		a							:					Tuple       =					False




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE				= ViTMAEModelTester(self      )
								_SCREAMING_SNAKE_CASE				= ConfigTester(self					,						config_class=UpperCamelCase					,						has_text_modality=UpperCamelCase					,						hidden_size=37      )




		def     lowercase       (				self      ):
								self.config_tester.run_common_tests()




		@unittest.skip(reason="ViTMAE does not use inputs_embeds"      )
		def     lowercase       (				self      ):
								pass




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
														_SCREAMING_SNAKE_CASE				= model_class(UpperCamelCase      )
														self.assertIsInstance(model.get_input_embeddings()					,						(nn.Module)      )
														_SCREAMING_SNAKE_CASE				= model.get_output_embeddings()
														self.assertTrue(x is None or isinstance(UpperCamelCase					,						nn.Linear      )      )




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
														_SCREAMING_SNAKE_CASE				= model_class(UpperCamelCase      )
														_SCREAMING_SNAKE_CASE				= inspect.signature(model.forward      )
														# signature.parameters is an OrderedDict => so arg_names order is deterministic
														_SCREAMING_SNAKE_CASE				= [*signature.parameters.keys()]

														_SCREAMING_SNAKE_CASE				= ["pixel_values"]
														self.assertListEqual(arg_names[:1]					,						UpperCamelCase      )




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE				= self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*UpperCamelCase      )




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE				= self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_pretraining(*UpperCamelCase      )




		def     lowercase       (				self					,						UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase      ):
								# make masks reproducible
								np.random.seed(2      )

								_SCREAMING_SNAKE_CASE				= int((pt_model.config.image_size // pt_model.config.patch_size) ** 2      )
								_SCREAMING_SNAKE_CASE				= np.random.uniform(size=(self.model_tester.batch_size, num_patches)      )
								_SCREAMING_SNAKE_CASE				= torch.from_numpy(UpperCamelCase      )

								# Add `noise` argument.
								# PT inputs will be prepared in `super().check_pt_tf_models()` with this added `noise` argument
								_SCREAMING_SNAKE_CASE				= pt_noise

								super().check_pt_tf_models(UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase      )




		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
														_SCREAMING_SNAKE_CASE				= model_class(UpperCamelCase      )
														model.to(UpperCamelCase      )
														model.eval()
														# make random mask reproducible
														torch.manual_seed(2      )
														with torch.no_grad():
																				_SCREAMING_SNAKE_CASE				= model(**self._prepare_for_class(UpperCamelCase					,						UpperCamelCase      )      )

														_SCREAMING_SNAKE_CASE				= outputs[0].cpu().numpy()
														_SCREAMING_SNAKE_CASE				= 0

														with tempfile.TemporaryDirectory() as tmpdirname:
																				model.save_pretrained(UpperCamelCase      )
																				_SCREAMING_SNAKE_CASE				= model_class.from_pretrained(UpperCamelCase      )
																				model.to(UpperCamelCase      )
																				# make random mask reproducible
																				torch.manual_seed(2      )
																				with torch.no_grad():
																										_SCREAMING_SNAKE_CASE				= model(**self._prepare_for_class(UpperCamelCase					,						UpperCamelCase      )      )

																				# Make sure we don't have nans
																				_SCREAMING_SNAKE_CASE				= after_outputs[0].cpu().numpy()
																				_SCREAMING_SNAKE_CASE				= 0
																				_SCREAMING_SNAKE_CASE				= np.amax(np.abs(out_a - out_a      )      )
																				self.assertLessEqual(UpperCamelCase					,						1e-5      )




		@unittest.skip(
		    reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load\n    to get deterministic results."      )
		def     lowercase       (				self      ):
								pass




		@unittest.skip(
		    reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load\n    to get deterministic results."      )
		def     lowercase       (				self      ):
								pass




		@unittest.skip(
		    reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load\n    to get deterministic results."      )
		def     lowercase       (				self      ):
								pass




		@unittest.skip(reason="ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load"      )
		def     lowercase       (				self      ):
								pass




		@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."      )
		def     lowercase       (				self      ):
								pass




		@slow
		def     lowercase       (				self      ):
								for model_name in VIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
														_SCREAMING_SNAKE_CASE				= ViTMAEModel.from_pretrained(UpperCamelCase      )
														self.assertIsNotNone(UpperCamelCase      )



def 			_a		(	):
						_SCREAMING_SNAKE_CASE				= Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"  )
						return image




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




		@cached_property
		def     lowercase       (				self      ):
								return ViTImageProcessor.from_pretrained("facebook/vit-mae-base"      ) if is_vision_available() else None




		@slow
		def     lowercase       (				self      ):
								# make random mask reproducible across the PT and TF model
								np.random.seed(2      )

								_SCREAMING_SNAKE_CASE				= ViTMAEForPreTraining.from_pretrained("facebook/vit-mae-base"      ).to(UpperCamelCase      )

								_SCREAMING_SNAKE_CASE				= self.default_image_processor
								_SCREAMING_SNAKE_CASE				= prepare_img()
								_SCREAMING_SNAKE_CASE				= image_processor(images=UpperCamelCase					,						return_tensors="pt"      ).to(UpperCamelCase      )

								# prepare a noise vector that will be also used for testing the TF model
								# (this way we can ensure that the PT and TF models operate on the same inputs)
								_SCREAMING_SNAKE_CASE				= ViTMAEConfig()
								_SCREAMING_SNAKE_CASE				= int((vit_mae_config.image_size // vit_mae_config.patch_size) ** 2      )
								_SCREAMING_SNAKE_CASE				= np.random.uniform(size=(1, num_patches)      )

								# forward pass
								with torch.no_grad():
														_SCREAMING_SNAKE_CASE				= model(**UpperCamelCase					,						noise=torch.from_numpy(UpperCamelCase      ).to(device=UpperCamelCase      )      )

								# verify the logits
								_SCREAMING_SNAKE_CASE				= torch.Size((1, 196, 768)      )
								self.assertEqual(outputs.logits.shape					,						UpperCamelCase      )

								_SCREAMING_SNAKE_CASE				= torch.tensor(
								    [[-0.05_48, -1.70_23, -0.93_25], [0.37_21, -0.56_70, -0.22_33], [0.82_35, -1.38_78, -0.35_24]]      )

								self.assertTrue(torch.allclose(outputs.logits[0, :3, :3]					,						expected_slice.to(UpperCamelCase      )					,						atol=1e-4      )      )

'''simple docstring'''







from copy import deepcopy
from typing import Optional, Union

import numpy as np

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
from ...utils import TensorType, is_tf_available, is_torch_available


if is_torch_available():
						import torch

if is_tf_available():
						import tensorflow as tf


class 			lowerCAmelCase (				__UpperCAmelCase			):
		a							:					Optional[int]       =					["""image_processor"""]
		a							:					Tuple       =					"""SamImageProcessor"""




		def __init__(				self					,						UpperCamelCase      ):
								super().__init__(UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= self.image_processor
								_SCREAMING_SNAKE_CASE				= -10
								_SCREAMING_SNAKE_CASE				= self.image_processor.size["longest_edge"]




		def __call__(				self					,						UpperCamelCase=None					,						UpperCamelCase=None					,						UpperCamelCase=None					,						UpperCamelCase=None					,						UpperCamelCase = None					,						**UpperCamelCase					,						):
								_SCREAMING_SNAKE_CASE				= self.image_processor(
								    UpperCamelCase					,						return_tensors=UpperCamelCase					,						**UpperCamelCase					,						)

								# pop arguments that are not used in the foward but used nevertheless
								_SCREAMING_SNAKE_CASE				= encoding_image_processor["original_sizes"]

								if hasattr(UpperCamelCase					,						"numpy"      ):  # Checks if Torch or TF tensor
														_SCREAMING_SNAKE_CASE				= original_sizes.numpy()

								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= self._check_and_preprocess_points(
								    input_points=UpperCamelCase					,						input_labels=UpperCamelCase					,						input_boxes=UpperCamelCase					,						)

								_SCREAMING_SNAKE_CASE				= self._normalize_and_convert(
								    UpperCamelCase					,						UpperCamelCase					,						input_points=UpperCamelCase					,						input_labels=UpperCamelCase					,						input_boxes=UpperCamelCase					,						return_tensors=UpperCamelCase					,						)

								return encoding_image_processor




		def     lowercase       (				self					,						UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase=None					,						UpperCamelCase=None					,						UpperCamelCase=None					,						UpperCamelCase="pt"					,						):
								if input_points is not None:
														if len(UpperCamelCase      ) != len(UpperCamelCase      ):
																				_SCREAMING_SNAKE_CASE				= [
																				    self._normalize_coordinates(self.target_size					,						UpperCamelCase					,						original_sizes[0]      ) for point in input_points
																				]
														else:
																				_SCREAMING_SNAKE_CASE				= [
																				    self._normalize_coordinates(self.target_size					,						UpperCamelCase					,						UpperCamelCase      )
																				    for point, original_size in zip(UpperCamelCase					,						UpperCamelCase      )
																				]
														# check that all arrays have the same shape
														if not all(point.shape == input_points[0].shape for point in input_points      ):
																				if input_labels is not None:
																										_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= self._pad_points_and_labels(UpperCamelCase					,						UpperCamelCase      )

														_SCREAMING_SNAKE_CASE				= np.array(UpperCamelCase      )

								if input_labels is not None:
														_SCREAMING_SNAKE_CASE				= np.array(UpperCamelCase      )

								if input_boxes is not None:
														if len(UpperCamelCase      ) != len(UpperCamelCase      ):
																				_SCREAMING_SNAKE_CASE				= [
																				    self._normalize_coordinates(self.target_size					,						UpperCamelCase					,						original_sizes[0]					,						is_bounding_box=UpperCamelCase      )
																				    for box in input_boxes
																				]
														else:
																				_SCREAMING_SNAKE_CASE				= [
																				    self._normalize_coordinates(self.target_size					,						UpperCamelCase					,						UpperCamelCase					,						is_bounding_box=UpperCamelCase      )
																				    for box, original_size in zip(UpperCamelCase					,						UpperCamelCase      )
																				]
														_SCREAMING_SNAKE_CASE				= np.array(UpperCamelCase      )

								if input_boxes is not None:
														if return_tensors == "pt":
																				_SCREAMING_SNAKE_CASE				= torch.from_numpy(UpperCamelCase      )
																				# boxes batch size of 1 by default
																				_SCREAMING_SNAKE_CASE				= input_boxes.unsqueeze(1      ) if len(input_boxes.shape      ) != 3 else input_boxes
														elif return_tensors == "tf":
																				_SCREAMING_SNAKE_CASE				= tf.convert_to_tensor(UpperCamelCase      )
																				# boxes batch size of 1 by default
																				_SCREAMING_SNAKE_CASE				= tf.expand_dims(UpperCamelCase					,						1      ) if len(input_boxes.shape      ) != 3 else input_boxes
														encoding_image_processor.update({"input_boxes": input_boxes}      )
								if input_points is not None:
														if return_tensors == "pt":
																				_SCREAMING_SNAKE_CASE				= torch.from_numpy(UpperCamelCase      )
																				# point batch size of 1 by default
																				_SCREAMING_SNAKE_CASE				= input_points.unsqueeze(1      ) if len(input_points.shape      ) != 4 else input_points
														elif return_tensors == "tf":
																				_SCREAMING_SNAKE_CASE				= tf.convert_to_tensor(UpperCamelCase      )
																				# point batch size of 1 by default
																				_SCREAMING_SNAKE_CASE				= tf.expand_dims(UpperCamelCase					,						1      ) if len(input_points.shape      ) != 4 else input_points
														encoding_image_processor.update({"input_points": input_points}      )
								if input_labels is not None:
														if return_tensors == "pt":
																				_SCREAMING_SNAKE_CASE				= torch.from_numpy(UpperCamelCase      )
																				# point batch size of 1 by default
																				_SCREAMING_SNAKE_CASE				= input_labels.unsqueeze(1      ) if len(input_labels.shape      ) != 3 else input_labels
														elif return_tensors == "tf":
																				_SCREAMING_SNAKE_CASE				= tf.convert_to_tensor(UpperCamelCase      )
																				# point batch size of 1 by default
																				_SCREAMING_SNAKE_CASE				= tf.expand_dims(UpperCamelCase					,						1      ) if len(input_labels.shape      ) != 3 else input_labels
														encoding_image_processor.update({"input_labels": input_labels}      )

								return encoding_image_processor




		def     lowercase       (				self					,						UpperCamelCase					,						UpperCamelCase      ):
								_SCREAMING_SNAKE_CASE				= max([point.shape[0] for point in input_points]      )
								_SCREAMING_SNAKE_CASE				= []
								for i, point in enumerate(UpperCamelCase      ):
														if point.shape[0] != expected_nb_points:
																				_SCREAMING_SNAKE_CASE				= np.concatenate(
																				    [point, np.zeros((expected_nb_points - point.shape[0], 2)      ) + self.point_pad_value]					,						axis=0      )
																				_SCREAMING_SNAKE_CASE				= np.append(input_labels[i]					,						[self.point_pad_value]      )
														processed_input_points.append(UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= processed_input_points
								return input_points, input_labels




		def     lowercase       (				self					,						UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase					,						UpperCamelCase=False      ):
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= original_size
								_SCREAMING_SNAKE_CASE,							_SCREAMING_SNAKE_CASE				= self.image_processor._get_preprocess_shape(UpperCamelCase					,						longest_edge=UpperCamelCase      )
								_SCREAMING_SNAKE_CASE				= deepcopy(UpperCamelCase      ).astype(UpperCamelCase      )

								if is_bounding_box:
														_SCREAMING_SNAKE_CASE				= coords.reshape(-1					,						2					,						2      )

								_SCREAMING_SNAKE_CASE				= coords[..., 0] * (new_w / old_w)
								_SCREAMING_SNAKE_CASE				= coords[..., 1] * (new_h / old_h)

								if is_bounding_box:
														_SCREAMING_SNAKE_CASE				= coords.reshape(-1					,						4      )

								return coords




		def     lowercase       (				self					,						UpperCamelCase=None					,						UpperCamelCase=None					,						UpperCamelCase=None					,						):
								if input_points is not None:
														if hasattr(UpperCamelCase					,						"numpy"      ):  # Checks for TF or Torch tensor
																				_SCREAMING_SNAKE_CASE				= input_points.numpy().tolist()

														if not isinstance(UpperCamelCase					,						UpperCamelCase      ) or not isinstance(input_points[0]					,						UpperCamelCase      ):
																				raise ValueError("Input points must be a list of list of floating points."      )
														_SCREAMING_SNAKE_CASE				= [np.array(UpperCamelCase      ) for input_point in input_points]
								else:
														_SCREAMING_SNAKE_CASE				= None

								if input_labels is not None:
														if hasattr(UpperCamelCase					,						"numpy"      ):
																				_SCREAMING_SNAKE_CASE				= input_labels.numpy().tolist()

														if not isinstance(UpperCamelCase					,						UpperCamelCase      ) or not isinstance(input_labels[0]					,						UpperCamelCase      ):
																				raise ValueError("Input labels must be a list of list integers."      )
														_SCREAMING_SNAKE_CASE				= [np.array(UpperCamelCase      ) for label in input_labels]
								else:
														_SCREAMING_SNAKE_CASE				= None

								if input_boxes is not None:
														if hasattr(UpperCamelCase					,						"numpy"      ):
																				_SCREAMING_SNAKE_CASE				= input_boxes.numpy().tolist()

														if (
														    not isinstance(UpperCamelCase					,						UpperCamelCase      )
														    or not isinstance(input_boxes[0]					,						UpperCamelCase      )
														    or not isinstance(input_boxes[0][0]					,						UpperCamelCase      )
														):
																				raise ValueError("Input boxes must be a list of list of list of floating points."      )
														_SCREAMING_SNAKE_CASE				= [np.array(UpperCamelCase      ).astype(np.floataa      ) for box in input_boxes]
								else:
														_SCREAMING_SNAKE_CASE				= None

								return input_points, input_labels, input_boxes




		@property
		def     lowercase       (				self      ):
								_SCREAMING_SNAKE_CASE				= self.image_processor.model_input_names
								return list(dict.fromkeys(UpperCamelCase      )      )




		def     lowercase       (				self					,						*UpperCamelCase					,						**UpperCamelCase      ):
								return self.image_processor.post_process_masks(*UpperCamelCase					,						**UpperCamelCase      )