






from __future__ import annotations

import inspect
import unittest
from typing import List, Tuple

from transformers import RegNetConfig
from transformers.testing_utils import require_tf, require_vision, slow
from transformers.utils import cached_property, is_tf_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
			import tensorflow as tf

			from transformers import TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST, TFRegNetForImageClassification, TFRegNetModel


if is_vision_available():
			from PIL import Image

			from transformers import AutoImageProcessor
class  lowerCAmelCase_       :




							def __init__(   self     :   Any ,							SCREAMING_SNAKE_CASE_     :   Union[str, Any] ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=3 ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=32 ,							SCREAMING_SNAKE_CASE_     :   Dict=3 ,							SCREAMING_SNAKE_CASE_     :   List[Any]=10 ,							SCREAMING_SNAKE_CASE_     :   List[str]=[10, 20, 30, 40] ,							SCREAMING_SNAKE_CASE_     :   Any=[1, 1, 2, 1] ,							SCREAMING_SNAKE_CASE_     :   Optional[int]=True ,							SCREAMING_SNAKE_CASE_     :   Optional[int]=True ,							SCREAMING_SNAKE_CASE_     :   Dict="relu" ,							SCREAMING_SNAKE_CASE_     :   int=3 ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None ,							):
										lowerCAmelCase__      			=						parent
										lowerCAmelCase__      			=						batch_size
										lowerCAmelCase__      			=						image_size
										lowerCAmelCase__      			=						num_channels
										lowerCAmelCase__      			=						embeddings_size
										lowerCAmelCase__      			=						hidden_sizes
										lowerCAmelCase__      			=						depths
										lowerCAmelCase__      			=						is_training
										lowerCAmelCase__      			=						use_labels
										lowerCAmelCase__      			=						hidden_act
										lowerCAmelCase__      			=						num_labels
										lowerCAmelCase__      			=						scope
										lowerCAmelCase__      			=						len(SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   int	):
										lowerCAmelCase__      			=						floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]	)

										lowerCAmelCase__      			=						None
										if self.use_labels:
													lowerCAmelCase__      			=						ids_tensor([self.batch_size] ,							self.num_labels	)

										lowerCAmelCase__      			=						self.get_config()
										return config, pixel_values, labels




							def 						__snake_case					(   self     :   Union[str, Any]	):
										return RegNetConfig(
										    num_channels=self.num_channels ,							embeddings_size=self.embeddings_size ,							hidden_sizes=self.hidden_sizes ,							depths=self.depths ,							hidden_act=self.hidden_act ,							num_labels=self.num_labels ,							)




							def 						__snake_case					(   self     :   List[Any] ,							SCREAMING_SNAKE_CASE_     :   Optional[int] ,							SCREAMING_SNAKE_CASE_     :   Any ,							SCREAMING_SNAKE_CASE_     :   Dict	):
										lowerCAmelCase__      			=						TFRegNetModel(config=SCREAMING_SNAKE_CASE_	)
										lowerCAmelCase__      			=						model(SCREAMING_SNAKE_CASE_ ,							training=SCREAMING_SNAKE_CASE_	)
										# expected last hidden states: B, C, H // 32, W // 32
										self.parent.assertEqual(
										    result.last_hidden_state.shape ,							(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32) ,							)




							def 						__snake_case					(   self     :   Optional[Any] ,							SCREAMING_SNAKE_CASE_     :   int ,							SCREAMING_SNAKE_CASE_     :   Optional[int] ,							SCREAMING_SNAKE_CASE_     :   Any	):
										lowerCAmelCase__      			=						self.num_labels
										lowerCAmelCase__      			=						TFRegNetForImageClassification(SCREAMING_SNAKE_CASE_	)
										lowerCAmelCase__      			=						model(SCREAMING_SNAKE_CASE_ ,							labels=SCREAMING_SNAKE_CASE_ ,							training=SCREAMING_SNAKE_CASE_	)
										self.parent.assertEqual(result.logits.shape ,							(self.batch_size, self.num_labels)	)




							def 						__snake_case					(   self     :   Optional[Any]	):
										lowerCAmelCase__      			=						self.prepare_config_and_inputs()
										lowerCAmelCase__			,		lowerCAmelCase__			,		lowerCAmelCase__      			=						config_and_inputs
										lowerCAmelCase__      			=						{'''pixel_values''': pixel_values}
										return config, inputs_dict



@require_tf
class  lowerCAmelCase_       (				snake_case__     ,    snake_case__     ,    unittest.TestCase					):
							UpperCamelCase_		:Optional[Any]		      =    (TFRegNetModel, TFRegNetForImageClassification) if is_tf_available() else ()
							UpperCamelCase_		:List[Any]		      =    (
							    {'feature-extraction': TFRegNetModel, 'image-classification': TFRegNetForImageClassification}
							    if is_tf_available()
							    else {}
							)

							UpperCamelCase_		:Any		      =    False
							UpperCamelCase_		:List[Any]		      =    False
							UpperCamelCase_		:List[Any]		      =    False
							UpperCamelCase_		:Optional[Any]		      =    False
							UpperCamelCase_		:Optional[int]		      =    False




							def 						__snake_case					(   self     :   Optional[int]	):
										lowerCAmelCase__      			=						TFRegNetModelTester(self	)
										lowerCAmelCase__      			=						ConfigTester(self ,							config_class=SCREAMING_SNAKE_CASE_ ,							has_text_modality=SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   Tuple	):
										return




							@unittest.skip(reason='''RegNet does not use inputs_embeds'''	)
							def 						__snake_case					(   self     :   Dict	):
										pass




							@unittest.skipIf(
							    not is_tf_available() or len(tf.config.list_physical_devices('''GPU'''	)	) == 0 ,							reason='''TF does not support backprop for grouped convolutions on CPU.''' ,							)
							@slow
							def 						__snake_case					(   self     :   int	):
										super().test_keras_fit()




							@unittest.skip(reason='''RegNet does not support input and output embeddings'''	)
							def 						__snake_case					(   self     :   List[Any]	):
										pass




							def 						__snake_case					(   self     :   str	):
										lowerCAmelCase__			,		lowerCAmelCase__      			=						self.model_tester.prepare_config_and_inputs_for_common()

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

													lowerCAmelCase__      			=						['''pixel_values''']
													self.assertListEqual(arg_names[:1] ,							SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   Dict	):
										lowerCAmelCase__      			=						self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_model(*SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   Union[str, Any]	):
										def check_hidden_states_output(SCREAMING_SNAKE_CASE_     :   List[str] ,							SCREAMING_SNAKE_CASE_     :   List[Any] ,							SCREAMING_SNAKE_CASE_     :   Optional[int]	):
													lowerCAmelCase__      			=						model_class(SCREAMING_SNAKE_CASE_	)
													lowerCAmelCase__      			=						model(**self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	) ,							training=SCREAMING_SNAKE_CASE_	)

													lowerCAmelCase__      			=						outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

													lowerCAmelCase__      			=						self.model_tester.num_stages
													self.assertEqual(len(SCREAMING_SNAKE_CASE_	) ,							expected_num_stages + 1	)

													# RegNet's feature maps are of shape (batch_size, num_channels, height, width)
													self.assertListEqual(
													    list(hidden_states[0].shape[-2:]	) ,							[self.model_tester.image_size // 2, self.model_tester.image_size // 2] ,							)

										lowerCAmelCase__			,		lowerCAmelCase__      			=						self.model_tester.prepare_config_and_inputs_for_common()
										lowerCAmelCase__      			=						['''basic''', '''bottleneck''']
										for model_class in self.all_model_classes:
													for layer_type in layers_type:
																lowerCAmelCase__      			=						layer_type
																lowerCAmelCase__      			=						True
																check_hidden_states_output(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)

																# check that output_hidden_states also work using config
																del inputs_dict["output_hidden_states"]
																lowerCAmelCase__      			=						True

																check_hidden_states_output(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   Optional[int]	):
										lowerCAmelCase__			,		lowerCAmelCase__      			=						self.model_tester.prepare_config_and_inputs_for_common()

										def check_equivalence(SCREAMING_SNAKE_CASE_     :   str ,							SCREAMING_SNAKE_CASE_     :   Dict ,							SCREAMING_SNAKE_CASE_     :   int ,							SCREAMING_SNAKE_CASE_     :   Optional[int]={}	):
													lowerCAmelCase__      			=						model(SCREAMING_SNAKE_CASE_ ,							return_dict=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)
													lowerCAmelCase__      			=						model(SCREAMING_SNAKE_CASE_ ,							return_dict=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	).to_tuple()

													def recursive_check(SCREAMING_SNAKE_CASE_     :   List[Any] ,							SCREAMING_SNAKE_CASE_     :   int	):
																if isinstance(SCREAMING_SNAKE_CASE_ ,							(List, Tuple)	):
																			for tuple_iterable_value, dict_iterable_value in zip(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	):
																						recursive_check(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)
																elif tuple_object is None:
																			return
																else:
																			self.assertTrue(
																			    all(tf.equal(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)	) ,							msg=(
																			        '''Tuple and dict output are not equal. Difference:'''
																			        f' {tf.math.reduce_max(tf.abs(tuple_object - dict_object	)	)}'
																			    ) ,							)

																recursive_check(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)

										for model_class in self.all_model_classes:
													lowerCAmelCase__      			=						model_class(SCREAMING_SNAKE_CASE_	)

													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)
													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)
													check_equivalence(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)

													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							return_labels=SCREAMING_SNAKE_CASE_	)
													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							return_labels=SCREAMING_SNAKE_CASE_	)
													check_equivalence(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)

													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)
													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)
													check_equivalence(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							{'''output_hidden_states''': True}	)

													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							return_labels=SCREAMING_SNAKE_CASE_	)
													lowerCAmelCase__      			=						self._prepare_for_class(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							return_labels=SCREAMING_SNAKE_CASE_	)
													check_equivalence(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_ ,							{'''output_hidden_states''': True}	)




							def 						__snake_case					(   self     :   List[Any]	):
										lowerCAmelCase__      			=						self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_for_image_classification(*SCREAMING_SNAKE_CASE_	)




							@slow
							def 						__snake_case					(   self     :   Union[str, Any]	):
										for model_name in TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
													lowerCAmelCase__      			=						TFRegNetModel.from_pretrained(SCREAMING_SNAKE_CASE_	)
													self.assertIsNotNone(SCREAMING_SNAKE_CASE_	)





def 	lowerCAmelCase_		()		->    Optional[int]:


			'''simple docstring'''




			lowerCAmelCase__      			=						Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''       )
			return image




@require_tf
@require_vision
class  lowerCAmelCase_       (				unittest.TestCase					):




							@cached_property
							def 						__snake_case					(   self     :   List[str]	):
										return (
										    AutoImageProcessor.from_pretrained(TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]	)
										    if is_vision_available()
										    else None
										)




							@slow
							def 						__snake_case					(   self     :   Optional[int]	):
										lowerCAmelCase__      			=						TFRegNetForImageClassification.from_pretrained(TF_REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]	)

										lowerCAmelCase__      			=						self.default_image_processor
										lowerCAmelCase__      			=						prepare_img()
										lowerCAmelCase__      			=						image_processor(images=SCREAMING_SNAKE_CASE_ ,							return_tensors='''tf'''	)

										# forward pass
										lowerCAmelCase__      			=						model(**SCREAMING_SNAKE_CASE_ ,							training=SCREAMING_SNAKE_CASE_	)

										# verify the logits
										lowerCAmelCase__      			=						tf.TensorShape((1, 1_000)	)
										self.assertEqual(outputs.logits.shape ,							SCREAMING_SNAKE_CASE_	)

										lowerCAmelCase__      			=						tf.constant([-0.4_180, -1.5_051, -3.4_836]	)

										tf.debugging.assert_near(outputs.logits[0, :3] ,							SCREAMING_SNAKE_CASE_ ,							atol=1e-4	)













# Imports
import numpy as np
class  lowerCAmelCase_       :




							def __init__(   self     :   Any ,							SCREAMING_SNAKE_CASE_     :   Dict=None ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None ,							SCREAMING_SNAKE_CASE_     :   List[str]=None ,							SCREAMING_SNAKE_CASE_     :   Dict=None ,							SCREAMING_SNAKE_CASE_     :   int=None	):
											self.set_matricies(red=SCREAMING_SNAKE_CASE_ ,							green=SCREAMING_SNAKE_CASE_ ,							blue=SCREAMING_SNAKE_CASE_ ,							red_edge=SCREAMING_SNAKE_CASE_ ,							nir=SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   str ,							SCREAMING_SNAKE_CASE_     :   Union[str, Any]=None ,							SCREAMING_SNAKE_CASE_     :   Optional[int]=None ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None ,							SCREAMING_SNAKE_CASE_     :   Dict=None	):
											if red is not None:
															lowerCAmelCase__      			=						red
											if green is not None:
															lowerCAmelCase__      			=						green
											if blue is not None:
															lowerCAmelCase__      			=						blue
											if red_edge is not None:
															lowerCAmelCase__      			=						red_edge
											if nir is not None:
															lowerCAmelCase__      			=						nir
											return True




							def 						__snake_case					(   self     :   Union[str, Any] ,							SCREAMING_SNAKE_CASE_     :   Any="" ,							SCREAMING_SNAKE_CASE_     :   str=None ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None ,							SCREAMING_SNAKE_CASE_     :   List[str]=None ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None ,							SCREAMING_SNAKE_CASE_     :   Optional[Any]=None	):
											self.set_matricies(red=SCREAMING_SNAKE_CASE_ ,							green=SCREAMING_SNAKE_CASE_ ,							blue=SCREAMING_SNAKE_CASE_ ,							red_edge=SCREAMING_SNAKE_CASE_ ,							nir=SCREAMING_SNAKE_CASE_	)
											lowerCAmelCase__      			=						{
											    '''ARVI2''': self.arvaa,
											    '''CCCI''': self.ccci,
											    '''CVI''': self.cvi,
											    '''GLI''': self.gli,
											    '''NDVI''': self.ndvi,
											    '''BNDVI''': self.bndvi,
											    '''redEdgeNDVI''': self.red_edge_ndvi,
											    '''GNDVI''': self.gndvi,
											    '''GBNDVI''': self.gbndvi,
											    '''GRNDVI''': self.grndvi,
											    '''RBNDVI''': self.rbndvi,
											    '''PNDVI''': self.pndvi,
											    '''ATSAVI''': self.atsavi,
											    '''BWDRVI''': self.bwdrvi,
											    '''CIgreen''': self.ci_green,
											    '''CIrededge''': self.ci_rededge,
											    '''CI''': self.ci,
											    '''CTVI''': self.ctvi,
											    '''GDVI''': self.gdvi,
											    '''EVI''': self.evi,
											    '''GEMI''': self.gemi,
											    '''GOSAVI''': self.gosavi,
											    '''GSAVI''': self.gsavi,
											    '''Hue''': self.hue,
											    '''IVI''': self.ivi,
											    '''IPVI''': self.ipvi,
											    '''I''': self.i,
											    '''RVI''': self.rvi,
											    '''MRVI''': self.mrvi,
											    '''MSAVI''': self.m_savi,
											    '''NormG''': self.norm_g,
											    '''NormNIR''': self.norm_nir,
											    '''NormR''': self.norm_r,
											    '''NGRDI''': self.ngrdi,
											    '''RI''': self.ri,
											    '''S''': self.s,
											    '''IF''': self._if,
											    '''DVI''': self.dvi,
											    '''TVI''': self.tvi,
											    '''NDRE''': self.ndre,
											}

											try:
															return funcs[index]()
											except KeyError:
															print('''Index not in the list!'''	)
															return False




							def 						__snake_case					(   self     :   List[str]	):
											return -0.18 + (1.17 * ((self.nir - self.red) / (self.nir + self.red)))




							def 						__snake_case					(   self     :   Optional[int]	):
											return ((self.nir - self.redEdge) / (self.nir + self.redEdge)) / (
											    (self.nir - self.red) / (self.nir + self.red)
											)




							def 						__snake_case					(   self     :   str	):
											return self.nir * (self.red / (self.green**2))




							def 						__snake_case					(   self     :   List[str]	):
											return (2 * self.green - self.red - self.blue) / (
											    2 * self.green + self.red + self.blue
											)




							def 						__snake_case					(   self     :   List[str]	):
											return (self.nir - self.red) / (self.nir + self.red)




							def 						__snake_case					(   self     :   Optional[Any]	):
											return (self.nir - self.blue) / (self.nir + self.blue)




							def 						__snake_case					(   self     :   Optional[Any]	):
											return (self.redEdge - self.red) / (self.redEdge + self.red)




							def 						__snake_case					(   self     :   Tuple	):
											return (self.nir - self.green) / (self.nir + self.green)




							def 						__snake_case					(   self     :   List[Any]	):
											return (self.nir - (self.green + self.blue)) / (
											    self.nir + (self.green + self.blue)
											)




							def 						__snake_case					(   self     :   Optional[int]	):
											return (self.nir - (self.green + self.red)) / (
											    self.nir + (self.green + self.red)
											)




							def 						__snake_case					(   self     :   Optional[Any]	):
											return (self.nir - (self.blue + self.red)) / (self.nir + (self.blue + self.red))




							def 						__snake_case					(   self     :   Optional[int]	):
											return (self.nir - (self.green + self.red + self.blue)) / (
											    self.nir + (self.green + self.red + self.blue)
											)




							def 						__snake_case					(   self     :   Union[str, Any] ,							SCREAMING_SNAKE_CASE_     :   List[Any]=0.08 ,							SCREAMING_SNAKE_CASE_     :   List[str]=1.22 ,							SCREAMING_SNAKE_CASE_     :   Union[str, Any]=0.03	):
											return a * (
											    (self.nir - a * self.red - b)
											    / (a * self.nir + self.red - a * b + x * (1 + a**2))
											)




							def 						__snake_case					(   self     :   Tuple	):
											return (0.1 * self.nir - self.blue) / (0.1 * self.nir + self.blue)




							def 						__snake_case					(   self     :   Dict	):
											return (self.nir / self.green) - 1




							def 						__snake_case					(   self     :   str	):
											return (self.nir / self.redEdge) - 1




							def 						__snake_case					(   self     :   Tuple	):
											return (self.red - self.blue) / self.red




							def 						__snake_case					(   self     :   Any	):
											lowerCAmelCase__      			=						self.ndvi()
											return ((ndvi + 0.5) / (abs(ndvi + 0.5	))) * (abs(ndvi + 0.5	) ** (1 / 2))




							def 						__snake_case					(   self     :   Dict	):
											return self.nir - self.green




							def 						__snake_case					(   self     :   List[Any]	):
											return 2.5 * (
											    (self.nir - self.red) / (self.nir + 6 * self.red - 7.5 * self.blue + 1)
											)




							def 						__snake_case					(   self     :   Tuple	):
											lowerCAmelCase__      			=						(2 * (self.nir**2 - self.red**2) + 1.5 * self.nir + 0.5 * self.red) / (
											    self.nir + self.red + 0.5
											)
											return n * (1 - 0.25 * n) - (self.red - 0.125) / (1 - self.red)




							def 						__snake_case					(   self     :   Optional[Any] ,							SCREAMING_SNAKE_CASE_     :   Dict=0.16	):
											return (self.nir - self.green) / (self.nir + self.green + y)




							def 						__snake_case					(   self     :   Optional[int] ,							SCREAMING_SNAKE_CASE_     :   Any=0.5	):
											return ((self.nir - self.green) / (self.nir + self.green + n)) * (1 + n)




							def 						__snake_case					(   self     :   Any	):
											return np.arctan(
											    ((2 * self.red - self.green - self.blue) / 30.5) * (self.green - self.blue)	)




							def 						__snake_case					(   self     :   List[str] ,							SCREAMING_SNAKE_CASE_     :   List[str]=None ,							SCREAMING_SNAKE_CASE_     :   Union[str, Any]=None	):
											return (self.nir - b) / (a * self.red)




							def 						__snake_case					(   self     :   Union[str, Any]	):
											return (self.nir / ((self.nir + self.red) / 2)) * (self.ndvi() + 1)




							def 						__snake_case					(   self     :   List[str]	):
											return (self.red + self.green + self.blue) / 30.5




							def 						__snake_case					(   self     :   Optional[int]	):
											return self.nir / self.red




							def 						__snake_case					(   self     :   Dict	):
											return (self.rvi() - 1) / (self.rvi() + 1)




							def 						__snake_case					(   self     :   Union[str, Any]	):
											return (
											    (2 * self.nir + 1)
											    - ((2 * self.nir + 1) ** 2 - 8 * (self.nir - self.red)) ** (1 / 2)
											) / 2




							def 						__snake_case					(   self     :   List[Any]	):
											return self.green / (self.nir + self.red + self.green)




							def 						__snake_case					(   self     :   List[str]	):
											return self.nir / (self.nir + self.red + self.green)




							def 						__snake_case					(   self     :   Any	):
											return self.red / (self.nir + self.red + self.green)




							def 						__snake_case					(   self     :   Union[str, Any]	):
											return (self.green - self.red) / (self.green + self.red)




							def 						__snake_case					(   self     :   Dict	):
											return (self.red - self.green) / (self.red + self.green)




							def 						__snake_case					(   self     :   Optional[int]	):
											lowerCAmelCase__      			=						np.max([np.max(self.red	), np.max(self.green	), np.max(self.blue	)]	)
											lowerCAmelCase__      			=						np.min([np.min(self.red	), np.min(self.green	), np.min(self.blue	)]	)
											return (max_value - min_value) / max_value




							def 						__snake_case					(   self     :   str	):
											return (2 * self.red - self.green - self.blue) / (self.green - self.blue)




							def 						__snake_case					(   self     :   Optional[Any]	):
											return self.nir / self.red




							def 						__snake_case					(   self     :   Union[str, Any]	):
											return (self.ndvi() + 0.5) ** (1 / 2)




							def 						__snake_case					(   self     :   List[Any]	):
											return (self.nir - self.redEdge) / (self.nir + self.redEdge)





