
'''simple docstring'''






import enum
import inspect
from typing import Iterable, List, Optional, Tuple, Union

class 							_snake_case     (  enum.Enum ):
	"""simple docstring"""





	_UpperCamelCase							:  List[Any]								=		'''timm'''
	_UpperCamelCase							:  str								=		'''transformers'''







def 		SCREAMING_SNAKE_CASE__					(							_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ):
		if stage_names is None:
				raise ValueError('''Stage_names must be set for transformers backbones'''  )

		if out_features is not None:
				if not isinstance(_SCREAMING_SNAKE_CASE  ,					(list,)  ):
						raise ValueError(f'out_features must be a list {type(_SCREAMING_SNAKE_CASE  )}'  )
				if any(feat not in stage_names for feat in out_features  ):
						raise ValueError(f'out_features must be a subset of stage_names: {stage_names} got {out_features}'  )

		if out_indices is not None:
				if not isinstance(_SCREAMING_SNAKE_CASE  ,					(list, tuple)  ):
						raise ValueError(f'out_indices must be a list or tuple, got {type(_SCREAMING_SNAKE_CASE  )}'  )
				if any(idx >= len(_SCREAMING_SNAKE_CASE  ) for idx in out_indices  ):
						raise ValueError('''out_indices must be valid indices for stage_names {stage_names}, got {out_indices}'''  )

		if out_features is not None and out_indices is not None:
				if len(_SCREAMING_SNAKE_CASE  ) != len(_SCREAMING_SNAKE_CASE  ):
						raise ValueError('''out_features and out_indices should have the same length if both are set'''  )
				if out_features != [stage_names[idx] for idx in out_indices]:
						raise ValueError('''out_features and out_indices should correspond to the same stages if both are set'''  )







def 		SCREAMING_SNAKE_CASE__					(							_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					):
		if out_indices is None and out_features is None:
				lowerCAmelCase_   :       List[Any]    							=[len(_SCREAMING_SNAKE_CASE  ) - 1]
				lowerCAmelCase_   :       int    							=[stage_names[-1]]
		elif out_indices is None and out_features is not None:
				lowerCAmelCase_   :       Dict    							=[stage_names.index(_SCREAMING_SNAKE_CASE  ) for layer in out_features]
		elif out_features is None and out_indices is not None:
				lowerCAmelCase_   :       Optional[Any]    							=[stage_names[idx] for idx in out_indices]
		return out_features, out_indices







def 		SCREAMING_SNAKE_CASE__					(							_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					):
		verify_out_features_out_indices(out_features=_SCREAMING_SNAKE_CASE  ,					out_indices=_SCREAMING_SNAKE_CASE  ,					stage_names=_SCREAMING_SNAKE_CASE  )
		lowerCAmelCase_							,		lowerCAmelCase_   :       Dict    							=_align_output_features_output_indices(
		    out_features=_SCREAMING_SNAKE_CASE  ,					out_indices=_SCREAMING_SNAKE_CASE  ,					stage_names=_SCREAMING_SNAKE_CASE  )
		# Verify that the aligned out_features and out_indices are valid
		verify_out_features_out_indices(out_features=_SCREAMING_SNAKE_CASE  ,					out_indices=_SCREAMING_SNAKE_CASE  ,					stage_names=_SCREAMING_SNAKE_CASE  )
		return output_features, output_indices

class 							_snake_case     :
	"""simple docstring"""





	_UpperCamelCase							:  Optional[BackboneType]								=		None




	def 	__A      (						self				: List[Any]					,						UpperCamelCase_				: Optional[int]      ):
			if getattr(self					,						'''_backbone'''					,						UpperCamelCase_      ) is None:
					raise ValueError('''self._backbone must be set before calling _init_timm_backbone'''      )

			# These will diagree with the defaults for the transformers models e.g. for resnet50
			# the transformer model has out_features = ['stem', 'stage1', 'stage2', 'stage3', 'stage4']
			# the timm model has out_features = ['act', 'layer1', 'layer2', 'layer3', 'layer4']
			lowerCAmelCase_   :       str    							=[stage['''module'''] for stage in self._backbone.feature_info.info]
			lowerCAmelCase_   :       Optional[int]    							=[stage['''num_chs'''] for stage in self._backbone.feature_info.info]
			lowerCAmelCase_   :       int    							=self._backbone.feature_info.out_indices
			lowerCAmelCase_   :       Union[str, Any]    							=self._backbone.feature_info.module_name()

			# We verify the out indices and out features are valid
			verify_out_features_out_indices(
			    out_features=UpperCamelCase_					,						out_indices=UpperCamelCase_					,						stage_names=self.stage_names      )
			lowerCAmelCase_							,		lowerCAmelCase_   :       Union[str, Any]    							=out_features, out_indices




	def 	__A      (						self				: List[Any]					,						UpperCamelCase_				: List[Any]      ):
			lowerCAmelCase_   :       Optional[Any]    							=getattr(UpperCamelCase_					,						'''stage_names'''      )
			lowerCAmelCase_   :       List[Any]    							=getattr(UpperCamelCase_					,						'''out_features'''					,						UpperCamelCase_      )
			lowerCAmelCase_   :       Union[str, Any]    							=getattr(UpperCamelCase_					,						'''out_indices'''					,						UpperCamelCase_      )

			lowerCAmelCase_   :       Optional[Any]    							=stage_names
			lowerCAmelCase_							,		lowerCAmelCase_   :       Optional[Any]    							=get_aligned_output_features_output_indices(
			    out_features=UpperCamelCase_					,						out_indices=UpperCamelCase_					,						stage_names=UpperCamelCase_      )
			# Number of channels for each stage. This is set in the transformer backbone model init
			lowerCAmelCase_   :       str    							=None




	def 	__A      (						self				: List[Any]					,						UpperCamelCase_				: List[str]      ):
			lowerCAmelCase_   :       int    							=config

			lowerCAmelCase_   :       Union[str, Any]    							=getattr(UpperCamelCase_					,						'''use_timm_backbone'''					,						UpperCamelCase_      )
			lowerCAmelCase_   :       Union[str, Any]    							=BackboneType.TIMM if self.use_timm_backbone else BackboneType.TRANSFORMERS

			if self.backbone_type == BackboneType.TIMM:
					self._init_timm_backbone(UpperCamelCase_      )
			elif self.backbone_type == BackboneType.TRANSFORMERS:
					self._init_transformers_backbone(UpperCamelCase_      )
			else:
					raise ValueError(F'backbone_type {self.backbone_type} not supported.'      )




	@property
	def 	__A      (						self				: int      ):
			return self._out_features




	@out_features.setter
	def 	__A      (						self				: Any					,						UpperCamelCase_				: List[str]      ):
			lowerCAmelCase_							,		lowerCAmelCase_   :       Any    							=get_aligned_output_features_output_indices(
			    out_features=UpperCamelCase_					,						out_indices=UpperCamelCase_					,						stage_names=self.stage_names      )




	@property
	def 	__A      (						self				: List[str]      ):
			return self._out_indices




	@out_indices.setter
	def 	__A      (						self				: List[str]					,						UpperCamelCase_				: Union[Tuple[int], List[int]]      ):
			lowerCAmelCase_							,		lowerCAmelCase_   :       Any    							=get_aligned_output_features_output_indices(
			    out_features=UpperCamelCase_					,						out_indices=UpperCamelCase_					,						stage_names=self.stage_names      )




	@property
	def 	__A      (						self				: int      ):
			# the current backbones will output the number of channels for each stage
			# even if that stage is not in the out_features list.
			return {stage: self.num_features[i] for i, stage in enumerate(self.stage_names      )}




	@property
	def 	__A      (						self				: Union[str, Any]      ):
			return [self.out_feature_channels[name] for name in self.out_features]




	def 	__A      (						self				: Any					,						*UpperCamelCase_				: str					,						**UpperCamelCase_				: int      ):
			lowerCAmelCase_   :       Optional[int]    							=dict(inspect.signature(self.forward      ).parameters      )
			lowerCAmelCase_   :       List[str]    							={k: v for k, v in kwargs.items() if k in signature}
			return self(*UpperCamelCase_					,						**UpperCamelCase_      )




	def 	__A      (						self				: Optional[Any]					,						UpperCamelCase_				: Any					,						UpperCamelCase_				: Optional[bool] = None					,						UpperCamelCase_				: Optional[bool] = None					,						UpperCamelCase_				: Optional[bool] = None					,						):
			raise NotImplementedError('''This method should be implemented by the derived class.'''      )





	def 	__A      (						self				: Optional[Any]      ):
			lowerCAmelCase_   :       str    							=super().to_dict()
			lowerCAmelCase_   :       Union[str, Any]    							=output.pop('''_out_features'''      )
			lowerCAmelCase_   :       Tuple    							=output.pop('''_out_indices'''      )
			return output







class 							_snake_case     :
	"""simple docstring"""





	@property
	def 	__A      (						self				: Tuple      ):
			return self._out_features




	@out_features.setter
	def 	__A      (						self				: int					,						UpperCamelCase_				: List[str]      ):
			lowerCAmelCase_							,		lowerCAmelCase_   :       Tuple    							=get_aligned_output_features_output_indices(
			    out_features=UpperCamelCase_					,						out_indices=UpperCamelCase_					,						stage_names=self.stage_names      )




	@property
	def 	__A      (						self				: List[str]      ):
			return self._out_indices




	@out_indices.setter
	def 	__A      (						self				: Any					,						UpperCamelCase_				: Union[Tuple[int], List[int]]      ):
			lowerCAmelCase_							,		lowerCAmelCase_   :       Tuple    							=get_aligned_output_features_output_indices(
			    out_features=UpperCamelCase_					,						out_indices=UpperCamelCase_					,						stage_names=self.stage_names      )





	def 	__A      (						self				: List[str]      ):
			lowerCAmelCase_   :       int    							=super().to_dict()
			lowerCAmelCase_   :       int    							=output.pop('''_out_features'''      )
			lowerCAmelCase_   :       Optional[int]    							=output.pop('''_out_indices'''      )
			return output








'''simple docstring'''






import unittest

import numpy as np
from datasets import load_dataset

from transformers.testing_utils import require_torch, require_vision
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 SegformerImageProcessor

class 							_snake_case     (  unittest.TestCase ):
	"""simple docstring"""





	def __init__(						self				: int					,						UpperCamelCase_				: Any					,						UpperCamelCase_				: Any=7					,						UpperCamelCase_				: Optional[Any]=3					,						UpperCamelCase_				: Optional[Any]=30					,						UpperCamelCase_				: List[Any]=400					,						UpperCamelCase_				: Tuple=True					,						UpperCamelCase_				: List[str]=None					,						UpperCamelCase_				: str=True					,						UpperCamelCase_				: Tuple=[0.5, 0.5, 0.5]					,						UpperCamelCase_				: int=[0.5, 0.5, 0.5]					,						UpperCamelCase_				: str=False					,						):
			lowerCAmelCase_   :       Tuple    							=size if size is not None else {'''height''': 30, '''width''': 30}
			lowerCAmelCase_   :       List[Any]    							=parent
			lowerCAmelCase_   :       int    							=batch_size
			lowerCAmelCase_   :       int    							=num_channels
			lowerCAmelCase_   :       Union[str, Any]    							=min_resolution
			lowerCAmelCase_   :       Tuple    							=max_resolution
			lowerCAmelCase_   :       Tuple    							=do_resize
			lowerCAmelCase_   :       List[str]    							=size
			lowerCAmelCase_   :       int    							=do_normalize
			lowerCAmelCase_   :       int    							=image_mean
			lowerCAmelCase_   :       str    							=image_std
			lowerCAmelCase_   :       List[Any]    							=do_reduce_labels





	def 	__A      (						self				: Optional[Any]      ):
			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_reduce_labels": self.do_reduce_labels,
			}







def 		SCREAMING_SNAKE_CASE__					(							):
		lowerCAmelCase_   :       Optional[int]    							=load_dataset('''hf-internal-testing/fixtures_ade20k'''  ,					split='''test'''  )

		lowerCAmelCase_   :       Optional[Any]    							=Image.open(dataset[0]['''file''']  )
		lowerCAmelCase_   :       Tuple    							=Image.open(dataset[1]['''file''']  )

		return image, map







def 		SCREAMING_SNAKE_CASE__					(							):
		lowerCAmelCase_   :       Tuple    							=load_dataset('''hf-internal-testing/fixtures_ade20k'''  ,					split='''test'''  )

		lowerCAmelCase_   :       Tuple    							=Image.open(dataset[0]['''file''']  )
		lowerCAmelCase_   :       Tuple    							=Image.open(dataset[1]['''file''']  )
		lowerCAmelCase_   :       Optional[int]    							=Image.open(dataset[2]['''file''']  )
		lowerCAmelCase_   :       Union[str, Any]    							=Image.open(dataset[3]['''file''']  )

		return [imagea, imagea], [mapa, mapa]






@require_torch
@require_vision
class 							_snake_case     (  lowerCAmelCase_						,    unittest.TestCase ):
	"""simple docstring"""





	_UpperCamelCase							:  List[Any]								=		SegformerImageProcessor if is_vision_available() else None




	def 	__A      (						self				: Optional[int]      ):
			lowerCAmelCase_   :       List[str]    							=SegformerImageProcessingTester(self      )




	@property
	def 	__A      (						self				: str      ):
			return self.image_processor_tester.prepare_image_processor_dict()




	def 	__A      (						self				: Tuple      ):
			lowerCAmelCase_   :       Optional[Any]    							=self.image_processing_class(**self.image_processor_dict      )
			self.assertTrue(hasattr(UpperCamelCase_					,						'''do_resize'''      )      )
			self.assertTrue(hasattr(UpperCamelCase_					,						'''size'''      )      )
			self.assertTrue(hasattr(UpperCamelCase_					,						'''do_normalize'''      )      )
			self.assertTrue(hasattr(UpperCamelCase_					,						'''image_mean'''      )      )
			self.assertTrue(hasattr(UpperCamelCase_					,						'''image_std'''      )      )
			self.assertTrue(hasattr(UpperCamelCase_					,						'''do_reduce_labels'''      )      )




	def 	__A      (						self				: Optional[Any]      ):
			lowerCAmelCase_   :       str    							=self.image_processing_class.from_dict(self.image_processor_dict      )
			self.assertEqual(image_processor.size					,						{'''height''': 30, '''width''': 30}      )
			self.assertEqual(image_processor.do_reduce_labels					,						UpperCamelCase_      )

			lowerCAmelCase_   :       Tuple    							=self.image_processing_class.from_dict(self.image_processor_dict					,						size=42					,						reduce_labels=UpperCamelCase_      )
			self.assertEqual(image_processor.size					,						{'''height''': 42, '''width''': 42}      )
			self.assertEqual(image_processor.do_reduce_labels					,						UpperCamelCase_      )




	def 	__A      (						self				: Dict      ):
			pass




	def 	__A      (						self				: Any      ):
			# Initialize image_processing
			lowerCAmelCase_   :       List[Any]    							=self.image_processing_class(**self.image_processor_dict      )
			# create random PIL images
			lowerCAmelCase_   :       Dict    							=prepare_image_inputs(self.image_processor_tester					,						equal_resolution=UpperCamelCase_      )
			for image in image_inputs:
					self.assertIsInstance(UpperCamelCase_					,						Image.Image      )

			# Test not batched input
			lowerCAmelCase_   :       int    							=image_processing(image_inputs[0]					,						return_tensors='''pt'''      ).pixel_values
			self.assertEqual(
			    encoded_images.shape					,						(
			        1,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)

			# Test batched
			lowerCAmelCase_   :       Optional[Any]    							=image_processing(UpperCamelCase_					,						return_tensors='''pt'''      ).pixel_values
			self.assertEqual(
			    encoded_images.shape					,						(
			        self.image_processor_tester.batch_size,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)




	def 	__A      (						self				: str      ):
			# Initialize image_processing
			lowerCAmelCase_   :       Union[str, Any]    							=self.image_processing_class(**self.image_processor_dict      )
			# create random numpy tensors
			lowerCAmelCase_   :       List[str]    							=prepare_image_inputs(self.image_processor_tester					,						equal_resolution=UpperCamelCase_					,						numpify=UpperCamelCase_      )
			for image in image_inputs:
					self.assertIsInstance(UpperCamelCase_					,						np.ndarray      )

			# Test not batched input
			lowerCAmelCase_   :       Any    							=image_processing(image_inputs[0]					,						return_tensors='''pt'''      ).pixel_values
			self.assertEqual(
			    encoded_images.shape					,						(
			        1,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)

			# Test batched
			lowerCAmelCase_   :       Optional[Any]    							=image_processing(UpperCamelCase_					,						return_tensors='''pt'''      ).pixel_values
			self.assertEqual(
			    encoded_images.shape					,						(
			        self.image_processor_tester.batch_size,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)




	def 	__A      (						self				: List[str]      ):
			# Initialize image_processing
			lowerCAmelCase_   :       List[Any]    							=self.image_processing_class(**self.image_processor_dict      )
			# create random PyTorch tensors
			lowerCAmelCase_   :       str    							=prepare_image_inputs(self.image_processor_tester					,						equal_resolution=UpperCamelCase_					,						torchify=UpperCamelCase_      )
			for image in image_inputs:
					self.assertIsInstance(UpperCamelCase_					,						torch.Tensor      )

			# Test not batched input
			lowerCAmelCase_   :       Optional[int]    							=image_processing(image_inputs[0]					,						return_tensors='''pt'''      ).pixel_values
			self.assertEqual(
			    encoded_images.shape					,						(
			        1,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)

			# Test batched
			lowerCAmelCase_   :       str    							=image_processing(UpperCamelCase_					,						return_tensors='''pt'''      ).pixel_values
			self.assertEqual(
			    encoded_images.shape					,						(
			        self.image_processor_tester.batch_size,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)




	def 	__A      (						self				: str      ):
			# Initialize image_processing
			lowerCAmelCase_   :       Any    							=self.image_processing_class(**self.image_processor_dict      )
			# create random PyTorch tensors
			lowerCAmelCase_   :       Optional[Any]    							=prepare_image_inputs(self.image_processor_tester					,						equal_resolution=UpperCamelCase_					,						torchify=UpperCamelCase_      )
			lowerCAmelCase_   :       Tuple    							=[]
			for image in image_inputs:
					self.assertIsInstance(UpperCamelCase_					,						torch.Tensor      )
					maps.append(torch.zeros(image.shape[-2:]      ).long()      )

			# Test not batched input
			lowerCAmelCase_   :       Optional[Any]    							=image_processing(image_inputs[0]					,						maps[0]					,						return_tensors='''pt'''      )
			self.assertEqual(
			    encoding['''pixel_values'''].shape					,						(
			        1,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(
			    encoding['''labels'''].shape					,						(
			        1,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(encoding['''labels'''].dtype					,						torch.long      )
			self.assertTrue(encoding['''labels'''].min().item() >= 0      )
			self.assertTrue(encoding['''labels'''].max().item() <= 255      )

			# Test batched
			lowerCAmelCase_   :       Union[str, Any]    							=image_processing(UpperCamelCase_					,						UpperCamelCase_					,						return_tensors='''pt'''      )
			self.assertEqual(
			    encoding['''pixel_values'''].shape					,						(
			        self.image_processor_tester.batch_size,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(
			    encoding['''labels'''].shape					,						(
			        self.image_processor_tester.batch_size,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(encoding['''labels'''].dtype					,						torch.long      )
			self.assertTrue(encoding['''labels'''].min().item() >= 0      )
			self.assertTrue(encoding['''labels'''].max().item() <= 255      )

			# Test not batched input (PIL images)
			lowerCAmelCase_							,		lowerCAmelCase_   :       int    							=prepare_semantic_single_inputs()

			lowerCAmelCase_   :       Union[str, Any]    							=image_processing(UpperCamelCase_					,						UpperCamelCase_					,						return_tensors='''pt'''      )
			self.assertEqual(
			    encoding['''pixel_values'''].shape					,						(
			        1,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(
			    encoding['''labels'''].shape					,						(
			        1,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(encoding['''labels'''].dtype					,						torch.long      )
			self.assertTrue(encoding['''labels'''].min().item() >= 0      )
			self.assertTrue(encoding['''labels'''].max().item() <= 255      )

			# Test batched input (PIL images)
			lowerCAmelCase_							,		lowerCAmelCase_   :       Any    							=prepare_semantic_batch_inputs()

			lowerCAmelCase_   :       Union[str, Any]    							=image_processing(UpperCamelCase_					,						UpperCamelCase_					,						return_tensors='''pt'''      )
			self.assertEqual(
			    encoding['''pixel_values'''].shape					,						(
			        2,
			        self.image_processor_tester.num_channels,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(
			    encoding['''labels'''].shape					,						(
			        2,
			        self.image_processor_tester.size['''height'''],
			        self.image_processor_tester.size['''width'''],
			    )					,						)
			self.assertEqual(encoding['''labels'''].dtype					,						torch.long      )
			self.assertTrue(encoding['''labels'''].min().item() >= 0      )
			self.assertTrue(encoding['''labels'''].max().item() <= 255      )





	def 	__A      (						self				: List[str]      ):
			# Initialize image_processing
			lowerCAmelCase_   :       Any    							=self.image_processing_class(**self.image_processor_dict      )

			# ADE20k has 150 classes, and the background is included, so labels should be between 0 and 150
			lowerCAmelCase_							,		lowerCAmelCase_   :       int    							=prepare_semantic_single_inputs()
			lowerCAmelCase_   :       Dict    							=image_processing(UpperCamelCase_					,						UpperCamelCase_					,						return_tensors='''pt'''      )
			self.assertTrue(encoding['''labels'''].min().item() >= 0      )
			self.assertTrue(encoding['''labels'''].max().item() <= 150      )

			lowerCAmelCase_   :       Optional[Any]    							=True
			lowerCAmelCase_   :       Optional[Any]    							=image_processing(UpperCamelCase_					,						UpperCamelCase_					,						return_tensors='''pt'''      )
			self.assertTrue(encoding['''labels'''].min().item() >= 0      )
			self.assertTrue(encoding['''labels'''].max().item() <= 255      )






