


"""simple docstring"""


from ...processing_utils import ProcessorMixin


class 			A__	(						__lowercase):


					"""simple docstring"""
					snake_case__	:					Dict													=['''image_processor''', '''feature_extractor''']
					snake_case__	:					Dict													='''TvltImageProcessor'''
					snake_case__	:					Any													='''TvltFeatureExtractor'''

					def __init__(	self:						Dict     ,		__a:						Dict     ,		__a:						List[Any]	)->    Tuple:
											super().__init__(image_processor=__a     ,		feature_extractor=__a	)

											lowerCamelCase					:					Union[str, Any]        =	image_processor
											lowerCamelCase					:					str        =	feature_extractor

					def __call__(	self:						Tuple     ,		__a:						Dict=None     ,		__a:						Optional[int]=None     ,		__a:						Any=None     ,		__a:						Any=None     ,		__a:						Tuple=False     ,		__a:						Union[str, Any]=False     ,		*__a:						Optional[Any]     ,		**__a:						Any     ,		)->    str:

											if images is None and audio is None:
																	raise ValueError("""You need to specify either an `images` or `audio` input to process."""	)

											lowerCamelCase					:					List[Any]        =	None
											if images is not None:
																	lowerCamelCase					:					List[str]        =	self.image_processor(__a     ,		mask_pixel=__a     ,		*__a     ,		**__a	)
											if images_mixed is not None:
																	lowerCamelCase					:					int        =	self.image_processor(__a     ,		is_mixed=__a     ,		*__a     ,		**__a	)
											if audio is not None:
																	lowerCamelCase					:					Tuple        =	self.feature_extractor(
																	    __a     ,		*__a     ,		sampling_rate=__a     ,		mask_audio=__a     ,		**__a	)

											lowerCamelCase					:					Dict        =	{}
											if audio is not None:
																	output_dict.update(__a	)
											if images is not None:
																	output_dict.update(__a	)
											if images_mixed_dict is not None:
																	output_dict.update(__a	)
											return output_dict







					@property
					def 		a__						(	self:						Optional[Any]	)->    List[Any]:
											lowerCamelCase					:					str        =	self.image_processor.model_input_names
											lowerCamelCase					:					Optional[int]        =	self.feature_extractor.model_input_names
											return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names	)	)








"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


__lowerCamelCase      :List[str]	    =		{
    'configuration_owlvit': [
        'OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'OwlViTConfig',
        'OwlViTOnnxConfig',
        'OwlViTTextConfig',
        'OwlViTVisionConfig',
    ],
    'processing_owlvit': ['OwlViTProcessor'],
}


try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCamelCase      :Optional[int]	    =		['OwlViTFeatureExtractor']
    __lowerCamelCase      :List[str]	    =		['OwlViTImageProcessor']

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCamelCase      :Optional[Any]	    =		[
        'OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST',
        'OwlViTModel',
        'OwlViTPreTrainedModel',
        'OwlViTTextModel',
        'OwlViTVisionModel',
        'OwlViTForObjectDetection',
    ]

if TYPE_CHECKING:
    from .configuration_owlvit import (
        OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
        OwlViTConfig,
        OwlViTOnnxConfig,
        OwlViTTextConfig,
        OwlViTVisionConfig,
    )
    from .processing_owlvit import OwlViTProcessor

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .feature_extraction_owlvit import OwlViTFeatureExtractor
        from .image_processing_owlvit import OwlViTImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_owlvit import (
            OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
            OwlViTForObjectDetection,
            OwlViTModel,
            OwlViTPreTrainedModel,
            OwlViTTextModel,
            OwlViTVisionModel,
        )

else:
    import sys

    __lowerCamelCase      :Dict	    =		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




