






'''simple docstring'''



import numpy as np
class 							__SCREAMING_SNAKE_CASE       :




						def __init__(  self ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None      )							->Dict:



									'''simple docstring'''
									self.set_matricies(red=_a ,   green=_a ,   blue=_a ,   red_edge=_a ,   nir=_a      )




						def  __UpperCamelCase							(  self ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None      )							->Optional[Any]:



									'''simple docstring'''


									if red is not None:
												__a				     =    red
									if green is not None:
												__a				     =    green
									if blue is not None:
												__a				     =    blue
									if red_edge is not None:
												__a				     =    red_edge
									if nir is not None:
												__a				     =    nir
									return True




						def  __UpperCamelCase							(  self ,   lowerCamelCase="" ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=None      )							->Optional[Any]:



									'''simple docstring'''
									self.set_matricies(red=_a ,   green=_a ,   blue=_a ,   red_edge=_a ,   nir=_a      )
									__a				     =    {
									    """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  __UpperCamelCase							(  self      )							->Optional[int]:



									'''simple docstring'''
									return -0.18 + (1.17 * ((self.nir - self.red) / (self.nir + self.red)))




						def  __UpperCamelCase							(  self      )							->List[Any]:



									'''simple docstring'''
									return ((self.nir - self.redEdge) / (self.nir + self.redEdge)) / (
									    (self.nir - self.red) / (self.nir + self.red)
									)




						def  __UpperCamelCase							(  self      )							->Union[str, Any]:



									'''simple docstring'''
									return self.nir * (self.red / (self.green**2))




						def  __UpperCamelCase							(  self      )							->int:



									'''simple docstring'''
									return (2 * self.green - self.red - self.blue) / (
									    2 * self.green + self.red + self.blue
									)




						def  __UpperCamelCase							(  self      )							->List[str]:



									'''simple docstring'''
									return (self.nir - self.red) / (self.nir + self.red)




						def  __UpperCamelCase							(  self      )							->List[str]:



									'''simple docstring'''
									return (self.nir - self.blue) / (self.nir + self.blue)




						def  __UpperCamelCase							(  self      )							->Dict:



									'''simple docstring'''
									return (self.redEdge - self.red) / (self.redEdge + self.red)




						def  __UpperCamelCase							(  self      )							->List[Any]:



									'''simple docstring'''
									return (self.nir - self.green) / (self.nir + self.green)




						def  __UpperCamelCase							(  self      )							->Union[str, Any]:



									'''simple docstring'''
									return (self.nir - (self.green + self.blue)) / (
									    self.nir + (self.green + self.blue)
									)




						def  __UpperCamelCase							(  self      )							->Optional[Any]:



									'''simple docstring'''
									return (self.nir - (self.green + self.red)) / (
									    self.nir + (self.green + self.red)
									)




						def  __UpperCamelCase							(  self      )							->Optional[Any]:



									'''simple docstring'''
									return (self.nir - (self.blue + self.red)) / (self.nir + (self.blue + self.red))




						def  __UpperCamelCase							(  self      )							->Optional[Any]:



									'''simple docstring'''
									return (self.nir - (self.green + self.red + self.blue)) / (
									    self.nir + (self.green + self.red + self.blue)
									)




						def  __UpperCamelCase							(  self ,   lowerCamelCase=0.08 ,   lowerCamelCase=1.22 ,   lowerCamelCase=0.03      )							->List[str]:



									'''simple docstring'''
									return a * (
									    (self.nir - a * self.red - b)
									    / (a * self.nir + self.red - a * b + x * (1 + a**2))
									)




						def  __UpperCamelCase							(  self      )							->Optional[Any]:



									'''simple docstring'''
									return (0.1 * self.nir - self.blue) / (0.1 * self.nir + self.blue)




						def  __UpperCamelCase							(  self      )							->List[str]:



									'''simple docstring'''
									return (self.nir / self.green) - 1




						def  __UpperCamelCase							(  self      )							->Tuple:



									'''simple docstring'''
									return (self.nir / self.redEdge) - 1




						def  __UpperCamelCase							(  self      )							->List[Any]:



									'''simple docstring'''
									return (self.red - self.blue) / self.red




						def  __UpperCamelCase							(  self      )							->str:



									'''simple docstring'''
									__a				     =    self.ndvi()
									return ((ndvi + 0.5) / (abs(ndvi + 0.5      ))) * (abs(ndvi + 0.5      ) ** (1 / 2))




						def  __UpperCamelCase							(  self      )							->Tuple:



									'''simple docstring'''
									return self.nir - self.green




						def  __UpperCamelCase							(  self      )							->Optional[Any]:



									'''simple docstring'''
									return 2.5 * (
									    (self.nir - self.red) / (self.nir + 6 * self.red - 7.5 * self.blue + 1)
									)




						def  __UpperCamelCase							(  self      )							->int:



									'''simple docstring'''
									__a				     =    (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  __UpperCamelCase							(  self ,   lowerCamelCase=0.16      )							->str:



									'''simple docstring'''
									return (self.nir - self.green) / (self.nir + self.green + y)




						def  __UpperCamelCase							(  self ,   lowerCamelCase=0.5      )							->Optional[Any]:



									'''simple docstring'''
									return ((self.nir - self.green) / (self.nir + self.green + n)) * (1 + n)




						def  __UpperCamelCase							(  self      )							->List[Any]:



									'''simple docstring'''
									return np.arctan(
									    ((2 * self.red - self.green - self.blue) / 30.5) * (self.green - self.blue)      )




						def  __UpperCamelCase							(  self ,   lowerCamelCase=None ,   lowerCamelCase=None      )							->Optional[int]:



									'''simple docstring'''
									return (self.nir - b) / (a * self.red)




						def  __UpperCamelCase							(  self      )							->Dict:



									'''simple docstring'''
									return (self.nir / ((self.nir + self.red) / 2)) * (self.ndvi() + 1)




						def  __UpperCamelCase							(  self      )							->Optional[Any]:



									'''simple docstring'''
									return (self.red + self.green + self.blue) / 30.5




						def  __UpperCamelCase							(  self      )							->int:



									'''simple docstring'''
									return self.nir / self.red




						def  __UpperCamelCase							(  self      )							->Dict:



									'''simple docstring'''
									return (self.rvi() - 1) / (self.rvi() + 1)




						def  __UpperCamelCase							(  self      )							->Optional[int]:



									'''simple docstring'''
									return (
									    (2 * self.nir + 1)
									    - ((2 * self.nir + 1) ** 2 - 8 * (self.nir - self.red)) ** (1 / 2)
									) / 2




						def  __UpperCamelCase							(  self      )							->List[str]:



									'''simple docstring'''
									return self.green / (self.nir + self.red + self.green)




						def  __UpperCamelCase							(  self      )							->Tuple:



									'''simple docstring'''
									return self.nir / (self.nir + self.red + self.green)




						def  __UpperCamelCase							(  self      )							->Optional[int]:



									'''simple docstring'''
									return self.red / (self.nir + self.red + self.green)




						def  __UpperCamelCase							(  self      )							->str:



									'''simple docstring'''
									return (self.green - self.red) / (self.green + self.red)




						def  __UpperCamelCase							(  self      )							->List[Any]:



									'''simple docstring'''
									return (self.red - self.green) / (self.red + self.green)




						def  __UpperCamelCase							(  self      )							->Any:



									'''simple docstring'''
									__a				     =    np.max([np.max(self.red      ), np.max(self.green      ), np.max(self.blue      )]      )
									__a				     =    np.min([np.min(self.red      ), np.min(self.green      ), np.min(self.blue      )]      )
									return (max_value - min_value) / max_value




						def  __UpperCamelCase							(  self      )							->List[Any]:



									'''simple docstring'''
									return (2 * self.red - self.green - self.blue) / (self.green - self.blue)




						def  __UpperCamelCase							(  self      )							->Dict:



									'''simple docstring'''
									return self.nir / self.red




						def  __UpperCamelCase							(  self      )							->Optional[int]:



									'''simple docstring'''
									return (self.ndvi() + 0.5) ** (1 / 2)






						def  __UpperCamelCase							(  self      )							->Union[str, Any]:



									'''simple docstring'''
									return (self.nir - self.redEdge) / (self.nir + self.redEdge)







'''simple docstring'''



__UpperCamelCase      :       Tuple      			=      """0.18.2"""

from .configuration_utils import ConfigMixin
from .utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_inflect_available,
    is_invisible_watermark_available,
    is_k_diffusion_available,
    is_k_diffusion_version,
    is_librosa_available,
    is_note_seq_available,
    is_onnx_available,
    is_scipy_available,
    is_torch_available,
    is_torchsde_available,
    is_transformers_available,
    is_transformers_version,
    is_unidecode_available,
    logging,
)


try:
 if not is_onnx_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_onnx_objects import *  # noqa F403
else:
 from .pipelines import OnnxRuntimeModel

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_pt_objects import *  # noqa F403
else:
 from .models import (
     AutoencoderKL,
     ControlNetModel,
     ModelMixin,
     PriorTransformer,
     TaFilmDecoder,
     TransformeraDModel,
     UNetaDModel,
     UNetaDConditionModel,
     UNetaDModel,
     UNetaDConditionModel,
     VQModel,
 )
 from .optimization import (
     get_constant_schedule,
     get_constant_schedule_with_warmup,
     get_cosine_schedule_with_warmup,
     get_cosine_with_hard_restarts_schedule_with_warmup,
     get_linear_schedule_with_warmup,
     get_polynomial_decay_schedule_with_warmup,
     get_scheduler,
 )
 from .pipelines import (
     AudioPipelineOutput,
     ConsistencyModelPipeline,
     DanceDiffusionPipeline,
     DDIMPipeline,
     DDPMPipeline,
     DiffusionPipeline,
     DiTPipeline,
     ImagePipelineOutput,
     KarrasVePipeline,
     LDMPipeline,
     LDMSuperResolutionPipeline,
     PNDMPipeline,
     RePaintPipeline,
     ScoreSdeVePipeline,
 )
 from .schedulers import (
     CMStochasticIterativeScheduler,
     DDIMInverseScheduler,
     DDIMParallelScheduler,
     DDIMScheduler,
     DDPMParallelScheduler,
     DDPMScheduler,
     DEISMultistepScheduler,
     DPMSolverMultistepInverseScheduler,
     DPMSolverMultistepScheduler,
     DPMSolverSinglestepScheduler,
     EulerAncestralDiscreteScheduler,
     EulerDiscreteScheduler,
     HeunDiscreteScheduler,
     IPNDMScheduler,
     KarrasVeScheduler,
     KDPMaAncestralDiscreteScheduler,
     KDPMaDiscreteScheduler,
     PNDMScheduler,
     RePaintScheduler,
     SchedulerMixin,
     ScoreSdeVeScheduler,
     UnCLIPScheduler,
     UniPCMultistepScheduler,
     VQDiffusionScheduler,
 )
 from .training_utils import EMAModel

try:
 if not (is_torch_available() and is_scipy_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_scipy_objects import *  # noqa F403
else:
 from .schedulers import LMSDiscreteScheduler

try:
 if not (is_torch_available() and is_torchsde_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_torchsde_objects import *  # noqa F403
else:
 from .schedulers import DPMSolverSDEScheduler

try:
 if not (is_torch_available() and is_transformers_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
 from .pipelines import (
     AltDiffusionImgaImgPipeline,
     AltDiffusionPipeline,
     AudioLDMPipeline,
     CycleDiffusionPipeline,
     IFImgaImgPipeline,
     IFImgaImgSuperResolutionPipeline,
     IFInpaintingPipeline,
     IFInpaintingSuperResolutionPipeline,
     IFPipeline,
     IFSuperResolutionPipeline,
     ImageTextPipelineOutput,
     KandinskyImgaImgPipeline,
     KandinskyInpaintPipeline,
     KandinskyPipeline,
     KandinskyPriorPipeline,
     KandinskyVaaControlnetImgaImgPipeline,
     KandinskyVaaControlnetPipeline,
     KandinskyVaaImgaImgPipeline,
     KandinskyVaaInpaintPipeline,
     KandinskyVaaPipeline,
     KandinskyVaaPriorEmbaEmbPipeline,
     KandinskyVaaPriorPipeline,
     LDMTextToImagePipeline,
     PaintByExamplePipeline,
     SemanticStableDiffusionPipeline,
     ShapEImgaImgPipeline,
     ShapEPipeline,
     StableDiffusionAttendAndExcitePipeline,
     StableDiffusionControlNetImgaImgPipeline,
     StableDiffusionControlNetInpaintPipeline,
     StableDiffusionControlNetPipeline,
     StableDiffusionDepthaImgPipeline,
     StableDiffusionDiffEditPipeline,
     StableDiffusionImageVariationPipeline,
     StableDiffusionImgaImgPipeline,
     StableDiffusionInpaintPipeline,
     StableDiffusionInpaintPipelineLegacy,
     StableDiffusionInstructPixaPixPipeline,
     StableDiffusionLatentUpscalePipeline,
     StableDiffusionLDMaDPipeline,
     StableDiffusionModelEditingPipeline,
     StableDiffusionPanoramaPipeline,
     StableDiffusionParadigmsPipeline,
     StableDiffusionPipeline,
     StableDiffusionPipelineSafe,
     StableDiffusionPixaPixZeroPipeline,
     StableDiffusionSAGPipeline,
     StableDiffusionUpscalePipeline,
     StableUnCLIPImgaImgPipeline,
     StableUnCLIPPipeline,
     TextToVideoSDPipeline,
     TextToVideoZeroPipeline,
     UnCLIPImageVariationPipeline,
     UnCLIPPipeline,
     UniDiffuserModel,
     UniDiffuserPipeline,
     UniDiffuserTextDecoder,
     VersatileDiffusionDualGuidedPipeline,
     VersatileDiffusionImageVariationPipeline,
     VersatileDiffusionPipeline,
     VersatileDiffusionTextToImagePipeline,
     VideoToVideoSDPipeline,
     VQDiffusionPipeline,
 )

try:
 if not (is_torch_available() and is_transformers_available() and is_invisible_watermark_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_transformers_and_invisible_watermark_objects import *  # noqa F403
else:
 from .pipelines import StableDiffusionXLImgaImgPipeline, StableDiffusionXLPipeline

try:
 if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_transformers_and_k_diffusion_objects import *  # noqa F403
else:
 from .pipelines import StableDiffusionKDiffusionPipeline

try:
 if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_transformers_and_onnx_objects import *  # noqa F403
else:
 from .pipelines import (
     OnnxStableDiffusionImgaImgPipeline,
     OnnxStableDiffusionInpaintPipeline,
     OnnxStableDiffusionInpaintPipelineLegacy,
     OnnxStableDiffusionPipeline,
     OnnxStableDiffusionUpscalePipeline,
     StableDiffusionOnnxPipeline,
 )

try:
 if not (is_torch_available() and is_librosa_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_torch_and_librosa_objects import *  # noqa F403
else:
 from .pipelines import AudioDiffusionPipeline, Mel

try:
 if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
 from .pipelines import SpectrogramDiffusionPipeline

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_flax_objects import *  # noqa F403
else:
 from .models.controlnet_flax import FlaxControlNetModel
 from .models.modeling_flax_utils import FlaxModelMixin
 from .models.unet_ad_condition_flax import FlaxUNetaDConditionModel
 from .models.vae_flax import FlaxAutoencoderKL
 from .pipelines import FlaxDiffusionPipeline
 from .schedulers import (
     FlaxDDIMScheduler,
     FlaxDDPMScheduler,
     FlaxDPMSolverMultistepScheduler,
     FlaxKarrasVeScheduler,
     FlaxLMSDiscreteScheduler,
     FlaxPNDMScheduler,
     FlaxSchedulerMixin,
     FlaxScoreSdeVeScheduler,
 )


try:
 if not (is_flax_available() and is_transformers_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_flax_and_transformers_objects import *  # noqa F403
else:
 from .pipelines import (
     FlaxStableDiffusionControlNetPipeline,
     FlaxStableDiffusionImgaImgPipeline,
     FlaxStableDiffusionInpaintPipeline,
     FlaxStableDiffusionPipeline,
 )

try:
 if not (is_note_seq_available()):
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 from .utils.dummy_note_seq_objects import *  # noqa F403
else:
 from .pipelines import MidiProcessor