
"""simple docstring"""




from typing import List, Union

import numpy as np

from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging, requires_backends
from .base import PIPELINE_INIT_ARGS, Pipeline


if is_vision_available():
						from PIL import Image

						from ..image_utils import load_image

if is_torch_available():
						import torch

						from ..models.auto.modeling_auto import MODEL_FOR_DEPTH_ESTIMATION_MAPPING

lowerCAmelCase__				=					logging.get_logger(__name__)





@add_end_docstrings(__lowercase )
class 			snake_case  (				__lowercase ):

							def __init__(self							,							*SCREAMING_SNAKE_CASE_							,							**SCREAMING_SNAKE_CASE_     ):

									"""simple docstring"""







									super().__init__(*SCREAMING_SNAKE_CASE_							,							**SCREAMING_SNAKE_CASE_     )
									requires_backends(self							,							'''vision'''     )
									self.check_model_type(SCREAMING_SNAKE_CASE_     )

							def __call__(self							,							SCREAMING_SNAKE_CASE_							,							**SCREAMING_SNAKE_CASE_     ):

									"""simple docstring"""







									return super().__call__(SCREAMING_SNAKE_CASE_							,							**SCREAMING_SNAKE_CASE_     )

							def _lowercase       (self							,							**SCREAMING_SNAKE_CASE_     ):

									"""simple docstring"""







									return {}, {}, {}

							def _lowercase       (self							,							SCREAMING_SNAKE_CASE_     ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_    			=			load_image(SCREAMING_SNAKE_CASE_     )
									SCREAMING_SNAKE_CASE_    			=			image.size
									SCREAMING_SNAKE_CASE_    			=			self.image_processor(images=SCREAMING_SNAKE_CASE_							,							return_tensors=self.framework     )
									return model_inputs

							def _lowercase       (self							,							SCREAMING_SNAKE_CASE_     ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_    			=			self.model(**SCREAMING_SNAKE_CASE_     )
									return model_outputs







							def _lowercase       (self							,							SCREAMING_SNAKE_CASE_     ):

									"""simple docstring"""







									SCREAMING_SNAKE_CASE_    			=			model_outputs.predicted_depth
									SCREAMING_SNAKE_CASE_    			=			torch.nn.functional.interpolate(
									    predicted_depth.unsqueeze(1     )							,							size=self.image_size[::-1]							,							mode='''bicubic'''							,							align_corners=SCREAMING_SNAKE_CASE_     )
									SCREAMING_SNAKE_CASE_    			=			prediction.squeeze().cpu().numpy()
									SCREAMING_SNAKE_CASE_    			=			(output * 2_55 / np.max(SCREAMING_SNAKE_CASE_     )).astype('''uint8'''     )
									SCREAMING_SNAKE_CASE_    			=			Image.fromarray(SCREAMING_SNAKE_CASE_     )
									SCREAMING_SNAKE_CASE_    			=			{}
									SCREAMING_SNAKE_CASE_    			=			predicted_depth
									SCREAMING_SNAKE_CASE_    			=			depth
									return output_dict

"""simple docstring"""




def 							_lowerCamelCase			(			__a     ):
		if divisor % 5 == 0 or divisor % 2 == 0:
				return 0
		SCREAMING_SNAKE_CASE_    			=			1
		SCREAMING_SNAKE_CASE_    			=			1
		while repunit:
				SCREAMING_SNAKE_CASE_    			=			(10 * repunit + 1) % divisor
				repunit_index += 1
		return repunit_index



def 							_lowerCamelCase			(			__a = 1_000_000     ):
		SCREAMING_SNAKE_CASE_    			=			limit - 1
		if divisor % 2 == 0:
				divisor += 1
		while least_divisible_repunit(__a     ) <= limit:
				divisor += 2
		return divisor


if __name__ == "__main__":
						print(f'''{solution() = }''')